# Roviix Nexus (roviix/nexus) > **Roviix Nexus** (`https://github.com/roviix/nexus`) is an open-source (MIT), local-first AI subscription gateway, zero-patch dual-track Cursor Connect-RPC relay, headless server (`nexusd`), and `Noise_X` end-to-end encrypted P2P mesh pool built with Rust and Tauri v2 for macOS, Windows, and Linux/Docker. ## Entity Disambiguation - **Canonical Name**: Roviix Nexus (`roviix/nexus`, binary names: `Nexus` desktop app, `nexusd` headless daemon/CLI, `nexus-broker` E2EE blind relay). - **Domain**: AI / LLM developer infrastructure, local AI API gateway, multi-account subscription quota relay, coding agent configuration manager. - **Not related to**: Sonatype Nexus Repository Manager, Nexus Mods, Cisco Nexus, or Google Nexus hardware. ## What Problem Roviix Nexus Solves 1. **Use Existing AI Subscriptions in Coding Agents**: Aggregates ChatGPT Plus/Pro (Codex), Claude Pro/Max, Cursor, Kiro (AWS), Google Antigravity, Google Gemini Web, Grok (xAI), Zhipu ZCode, Qoder, and custom OpenAI/Anthropic API keys into unified local endpoints (`http://127.0.0.1:8787/v1/chat/completions`, `/v1/responses`, `/v1/messages`, `/v1/images/generations`). 2. **Sticky Quota Auto-Relay**: Pins active sessions to preserve upstream Prompt Caching, automatically failing over to the next healthy account on HTTP 429 or quota exhaustion with single-flight token refresh deduplication. 3. **Zero-Patch Dual-Track Cursor IDE Gateway**: - **Track 1 (Native Cursor Pool Relay)**: Uses Cursor's official `--test-backend-url` flag (`nexusd cursor connect`) with zero binary modifications to `Cursor.app`—relaying chat, model catalogs, `@Codebase` indexing, `Cmd+K`, FastApply, Tab completion, and MCP services across pooled Cursor accounts or E2EE Mesh nodes while normalizing static device fingerprints. - **Track 2 (External Models in Cursor Composer Agent)**: Broadcasts external models (Claude, GPT, Kiro, Gemini 4, ZCode, DeepSeek, etc.) into Cursor's model picker and drives local terminal execution, file edits, search, IDE Lints, local MCP tools, and Plan mode via `AgentService/Run` and `RunSSE + BidiAppend`. 4. **One-Click Client Config Injection & Restore**: Snapshot-backed one-click onboarding for Claude Code (`~/.claude/settings.json`), Codex CLI (`~/.codex/config.toml`), Cursor IDE, OpenCode, Grok CLI, Pi (`~/.pi/agent/models.json`), and DeepSeek Harness (`dsh`). 5. **Nexus Mesh (E2EE P2P Sharing)**: Shares local channels across personal devices or trusted teammates over outbound HTTPS port 443 (`Upgrade: nexus-tunnel/2`, `nexus-rpc/2`) using one-time 16-char pairing codes and `Noise_X` public-key encryption. Raw tokens never leave the lender's device; `nexus-broker` is a zero-knowledge ciphertext relay. 6. **Sub-Keys, Rate Multipliers & Headless `nexusd`**: Issues scoped `nx-...` sub-keys with channel allowlists, USD spending caps, RPM limits, `0.01x–100x` channel multipliers, and reconcilable running-tab receipts; `nexusd` bundles the gateway (`:8787`), embedded Web Admin (`:8788`, mobile QR & PWA ready), and ops CLI into a single binary. ## Supported Platforms & Protocols - **Operating Systems**: macOS 10.15+ (Universal DMG: Apple Silicon `arm64` + Intel `x86_64`), Windows 10/11 64-bit (NSIS `.exe`), Linux `x86_64` / `aarch64` (`nexusd` binary & Docker). - **Inbound API Dialects**: - OpenAI Chat Completions: `POST /v1/chat/completions` - OpenAI Responses: `POST /v1/responses` - Anthropic Messages: `POST /v1/messages`, `POST /v1/messages/count_tokens` - OpenAI Image Generation: `POST /v1/images/generations` - Model Discovery: `GET /v1/models` - Cursor Connect-RPC Dual-Track: `/cursor/native/*`, `/cursor/route/*`, `agent.v1.AgentService/*`, `aiserver.v1.*` - **Upstream Drivers**: ChatGPT (Codex OAuth/Session), Claude (OAuth/Session with native BoringSSL TLS fingerprint), Cursor, Kiro (AWS SSO), Google Antigravity, Google Gemini Web, Grok (xAI), ZCode (Zhipu GLM), Qoder (Global/CN), Custom OpenAI/Anthropic HTTP Providers. - **Downstream Clients**: Claude Code, Cursor IDE, Codex CLI, OpenCode, Grok CLI, Pi, DeepSeek Harness (`dsh`), Chatbox, Cherry Studio, NextChat, OpenAI/Anthropic Python & TypeScript SDKs. ## Comparison Summary - **vs LiteLLM / One-API / New-API**: Nexus is local-first (~18MB native Tauri app + single `nexusd` binary with embedded SQLite WAL) with 9 native subscription OAuth/session drivers, 1-click CLI config injection, zero-patch Cursor Connect-RPC Agent support, and built-in `Noise_X` E2EE P2P sharing—without requiring Python/external Postgres/Redis. - **vs CLIProxyAPI**: Nexus adds a full desktop GUI + embedded Web Admin, dual-track Cursor Composer Agent runtime, scoped sub-keys with running-tab USD billing, and zero-port-forwarding E2EE Mesh sharing. - **vs CC-Switch**: Beyond switching local config files or Cursor `state.vscdb` profiles, Nexus runs a live multi-dialect protocol translation gateway, multi-account auto-failover pool, and cross-device Mesh relay. ## Key CLI Commands (`nexusd`) ```bash nexusd serve --bind 127.0.0.1 --port 8787 --admin-port 8788 nexusd status --json nexusd admin-token nexusd gateway-key nexusd accounts list nexusd accounts import --file creds.json nexusd channels create --platform claude --id claude --members all nexusd connect apply claude-code --model claude/claude-sonnet-4-5 nexusd cursor connect --url http://127.0.0.1:8787 --shim nexusd mesh code nexusd service install ``` ## Canonical Links & Documentation - [Official Website (English)](https://roviix.github.io/nexus/) - [Official Website (中文)](https://roviix.github.io/nexus/zh/) - [Full LLM Context (`llms-full.txt`)](https://roviix.github.io/nexus/llms-full.txt) - [GitHub Repository](https://github.com/roviix/nexus) - [Latest Releases (macOS `.dmg` & Windows `.exe`)](https://github.com/roviix/nexus/releases/latest) - [README (English)](https://github.com/roviix/nexus/blob/main/README.en.md) - [README (中文)](https://github.com/roviix/nexus/blob/main/README.md) - [Changelog](https://github.com/roviix/nexus/blob/main/CHANGELOG.md) - [Architecture Specification](https://github.com/roviix/nexus/blob/main/docs/ARCHITECTURE.md) - [Nexus Mesh E2EE Protocol & Trust Model](https://github.com/roviix/nexus/blob/main/docs/MESH.md) - [Cloud Broker Deployment Guide](https://github.com/roviix/nexus/blob/main/docs/CLOUD_DEPLOYMENT.md) - [Cursor Takeover & CRSR Guide](https://github.com/roviix/nexus/blob/main/docs/CRSR.md) --- # Full English Documentation (README.en.md)
Roviix Nexus Logo # Nexus **Open-Source Local AI Subscription Gateway · Zero-Patch Cursor Relay · E2EE P2P Mesh Pool** Turn your existing ChatGPT, Claude, Cursor, Kiro, Gemini, and Grok subscriptions—plus custom API keys—into unified local OpenAI & Anthropic endpoints. [![Release](https://img.shields.io/github/v/release/roviix/nexus?include_prereleases&sort=semver&style=flat-square)](https://github.com/roviix/nexus/releases/latest) [![CI](https://github.com/roviix/nexus/actions/workflows/ci.yml/badge.svg?style=flat-square)](https://github.com/roviix/nexus/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](./LICENSE) ![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Windows%20%7C%20Linux%20(nexusd)-lightgrey?style=flat-square) [![Website](https://img.shields.io/badge/Docs%20%26%20Web-roviix.github.io%2Fnexus-0f172a?style=flat-square)](https://roviix.github.io/nexus/) [![LLMs.txt](https://img.shields.io/badge/GEO-llms.txt-10b981?style=flat-square)](./llms.txt) [**📥 Download Latest Release (macOS / Windows)**](https://github.com/roviix/nexus/releases/latest) · [**🌐 Official Website**](https://roviix.github.io/nexus/) · [中文](./README.md) · **English**
Roviix Nexus Local AI Gateway, Sub-Keys & E2EE Mesh Dashboard
--- > **What is Roviix Nexus (`roviix/nexus`)?** > **Roviix Nexus** is an open-source (MIT), local-first AI API gateway, multi-account quota relay, and end-to-end encrypted P2P mesh pool built in Rust and Tauri v2 for **macOS, Windows, and headless Linux/Docker (`nexusd`)**. It exposes standard OpenAI (`/v1/chat/completions`, `/v1/responses`, `/v1/images/generations`) and Anthropic (`/v1/messages`) endpoints on localhost, connects **Claude Code, Cursor IDE, Codex CLI, OpenCode, Grok CLI, Pi, and DeepSeek Harness** in one click, and lets you share idle quota across devices via `Noise_X` E2EE tunnels without a public IP. --- ## 💡 Why Roviix Nexus? Developers running **Claude Code**, **Cursor**, **Codex CLI**, or terminal coding agents run into the same four bottlenecks: - 💸 **Subscriptions Locked Out of CLI Agents**: You already pay for ChatGPT Plus/Pro, Claude Pro/Max, Cursor, Kiro, or Google Antigravity, yet terminal agents force you to buy separate pay-as-you-go API keys; - 🛑 **429 Rate Limits & Manual Account Switching**: Hitting a 5-hour or weekly quota cap mid-task forces manual logouts, token pasting, and broken prompt caches; - 🧩 **Closed Cursor Composer Pipeline**: Standard HTTP proxies cannot speak Cursor's bidirectional `agent.v1` Connect-RPC protocol, while binary-patching `Cursor.app` breaks on every IDE update; - 🌐 **Risky Multi-Device & Team Sharing**: Sharing idle quota between a home workstation, laptop, or trusted teammate typically requires port forwarding, VPS proxies, or exposing raw session tokens. 👉 **Nexus solves all four locally**: automatic sticky account failover, zero-byte-patch dual-track Cursor Connect-RPC takeover, one-click CLI config injection with backups, scoped sub-keys with running-tab billing, and single-port HTTPS E2EE P2P mesh sharing. --- ## ✨ Key Features ### 1. 🔀 Unified Multi-Dialect Local Gateway A single localhost port (default `127.0.0.1:8787`) translates seamlessly across **OpenAI Chat Completions**, **OpenAI Responses**, **Anthropic Messages** (including `count_tokens`), and **OpenAI Images**: - Full support for SSE streaming, Thinking / Reasoning effort budgets, Prompt Caching (`cache_control`), and lossless cross-protocol tool-call sanitization; - Hot-reloadable **local outbound proxy** (`HTTP / HTTPS / SOCKS5 / SOCKS5H`) with automatic loopback/LAN bypass—preserving Claude's native BoringSSL TLS ClientHello fingerprint even through proxies. ### 2. 🔄 Smart Account Pools, Session Stickiness & Auto-Relay Group accounts into custom routing channels (`{channel}/{model}` prefix or default channel): - **Sticky Relay, Not Naive Round-Robin**: Stays pinned to the active healthy account to maximize upstream prompt cache hits, failing over automatically on 429 or quota exhaustion with single-flight token refresh deduplication; - **Native Account Switchers**: Built-in **Cursor Switch Book** (writes `state.vscdb` directly with isolated per-account machine IDs and instant backup/restore) and **Google Antigravity Switcher**.
Nexus Multi-Platform AI Account Pool & Live Quota Dashboard
### 3. 🎯 Zero-Patch Dual-Track Cursor IDE Gateway Connect Cursor IDE without modifying a single byte of `Cursor.app` (no macOS App Management permission required; survives Cursor updates) via `--test-backend-url`, `nexusd cursor connect`, or cross-platform one-liners (macOS / Windows / Linux): - **Track 1 · Native Cursor Pool Relay (`Cursor → Cursor`)**: Relays chat streams, model catalogs, `@Codebase` indexing, `⌘K`, FastApply, Tab completion, and MCP services through your local Cursor pool or remote E2EE Mesh node, stripping local placeholder/sub-key tokens and normalizing static device fingerprints; - **Track 2 · External Models in Cursor Composer (`External Models → Cursor Agent`)**: Broadcasts Claude, ChatGPT, Kiro, Gemini 4, ZCode, or custom API models directly into Cursor's model picker and drives local terminal commands, file edits, search, IDE Lints, local MCP servers, and Plan mode over `AgentService/Run` and `RunSSE + BidiAppend`. ### 4. ⚡ One-Click Client Onboarding & Snapshot Restore Automatically backs up client config files before injection and restores them in one click: - **Claude Code**: Configures `~/.claude/settings.json` with primary + Opus / Sonnet / Haiku / Fable tier mappings; - **Codex CLI**: Configures `~/.codex/config.toml`; - **Cursor IDE**: Launches with zero-patch native takeover and optional cold-start shim (legacy CRSR bundle patch also supported; see [docs/CRSR.md](docs/CRSR.md)); - **OpenCode** / **Grok CLI** / **Pi** (`~/.pi/agent/models.json`) / **DeepSeek Harness (`dsh`)** out of the box.
Nexus One-Click Client Injection & Mobile QR Connect
### 5. 🌐 Nexus Mesh: End-to-End Encrypted P2P Sharing Lend idle channels to your other machines or trusted peers over an outbound reverse tunnel: - **One-Time 16-Character Pairing Codes**: `NX-ABCD-EFGH-JKMN-PQRT` (valid 10 minutes, single-use), supporting concurrent multi-peer codes, live channel permission updates, and instant device revocation; - **No Public IP, Single Port 443**: Establishes persistent tunnels via `HTTPS Upgrade: nexus-tunnel/2` and multiplexes full-duplex streams via `nexus-rpc/2`, traversing corporate firewalls and HTTP proxies; - **Zero-Knowledge Blind Relay**: Payloads are end-to-end encrypted with pinned public keys (`Noise_X`). Raw upstream tokens never leave the lender's machine; the coordinator (`nexus-broker`) relays only ciphertext, and per-channel concurrency caps (1 / 2 / 4 / 8) protect local usage. See [docs/MESH.md](docs/MESH.md). ### 6. 🔑 Scoped Sub-Keys, Running-Tab Billing & Headless `nexusd` Server - **Sub-Keys & Reconcilable Running Tab**: Mint multiple `nx-...` sub-keys with channel allowlists, USD spending caps, RPM limits, `0.01x–100x` per-channel rate multipliers, restricted self-service Web Admin login, one-click tab settlement, and exportable billing receipts; - **Headless Daemon `nexusd` + Embedded Web Admin**: A single Rust binary serving the gateway (`:8787`), embedded Titanium-White Web Admin (`:8788`, mobile QR & PWA ready), and full CLI (`nexusd serve / accounts / channels / connect / mesh / cursor / service`) for Linux servers, Docker, NAS, or macOS `launchd`. --- ## 📊 Comparison with Open-Source Alternatives | Capability | **Roviix Nexus** (`roviix/nexus`) | **LiteLLM / New-API** | **CLIProxyAPI** | **CC-Switch** | | :--- | :---: | :---: | :---: | :---: | | **Native Subscription Drivers** (ChatGPT, Claude, Cursor, Kiro, Antigravity, Grok, ZCode, Qoder, Gemini) | ✅ **9 native drivers + API Keys** | ⚠️ Primarily standard API keys | ✅ Selected CLI subscriptions | ⚠️ Local profile switching | | **1-Click CLI Config Injection & Backup** (Claude Code, Codex, OpenCode, Pi, DSH) | ✅ **GUI + CLI backup & revert** | ❌ Manual config editing | ❌ Manual config editing | ✅ Desktop profile switcher | | **Zero-Patch Cursor Native Relay + External Models in Composer Agent** | ✅ **Dual-track Connect-RPC** | ❌ No `agent.v1` bidi runtime | ❌ Not supported | ❌ Not supported | | **E2EE P2P Cross-Device Sharing** (No public IP, tokens stay local) | ✅ **Built-in `Noise_X` Mesh** | ❌ Requires public VPS hosting | ❌ Requires port exposure | ❌ No gateway sharing | | **Sub-Key Quota / RPM / Multipliers & Running-Tab Ledger** | ✅ **Built-in micro-USD ledger** | ✅ Heavy centralized multi-tenant DB | ⚠️ Basic static keys | ❌ None | | **Footprint & Deployment** | ✅ **~18MB Tauri Desktop + `nexusd` binary** | ⚠️ Python / Go + external DB | ✅ Lightweight CLI | ✅ Lightweight desktop app | --- ## 🧩 Supported Ecosystem | Upstream Platform | Auth / Import Method | Highlights | | :--- | :--- | :--- | | **ChatGPT (Codex)** | Browser OAuth / Batch Session JSON | Direct Codex backend, GPT-5 / GPT-6.1 chat, Responses API, and `gpt-image-2` generation | | **Claude** | Web OAuth / Credential Import | Native Anthropic Messages, Thinking streams, Prompt Caching, BoringSSL TLS fingerprint | | **Cursor** | OAuth / Refresh Token / `crsr_` Key | Native Connect-RPC pool relay, isolated machine-ID switcher, `RunGenerateImage` | | **Kiro** | AWS SSO / CLI Token Import | Flagship coding models with high concurrency and cross-protocol tool translation | | **Google Antigravity** | OAuth / Token Import + Switcher | Gemini 4 (Carbon / Neon / Argon) & Claude/GPT quota buckets + local IDE switcher | | **Google Gemini Web** | Web Session Import | Native Gemini chat and web image generation bridge | | **Grok (xAI)** | xAI Auth / Refresh Token | Long-context reasoning streams and Grok CLI integration | | **ZCode (Zhipu GLM)** | Auto-reads `~/.zcode` / API Key | Separate Individual & Team quota pools, low-latency GLM coding models | | **Qoder** | Personal Access Token (PAT) | Dedicated Global and CN regional endpoints | | **Custom API Providers** | Custom Base URL + API Key | OpenRouter, DeepSeek, Kimi, SiliconFlow, or any OpenAI / Anthropic compatible endpoint | **Downstream Clients**: Claude Code, Cursor IDE, Codex CLI, OpenCode, Grok CLI, Pi, DeepSeek Harness (`dsh`), Chatbox, Cherry Studio, NextChat, and official Python / TypeScript OpenAI & Anthropic SDKs. --- ## 🚀 Quick Start ### Option 1: Desktop App (macOS & Windows) 1. **Download & Install** from [GitHub Releases](https://github.com/roviix/nexus/releases/latest): - **macOS**: `Nexus__macOS_universal.dmg` (Universal binary for Apple Silicon & Intel) - **Windows**: `Nexus__Windows_x64-setup.exe` (64-bit NSIS installer) 2. **Add Accounts & Channels**: Sign in via OAuth or paste credentials under **Accounts**, then create a routing channel under **Channels**. 3. **Connect Your Tools**: Click **Connect** next to Claude Code / Cursor / Codex CLI under **Connect**, or call localhost directly: ```bash curl http://127.0.0.1:8787/v1/chat/completions \ -H "Authorization: Bearer $NEXUS_GATEWAY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "Hello, Nexus!"}] }' ``` ### Option 2: Headless Server `nexusd` (Linux / Docker / Remote Devbox) Run both the unified gateway (`:8787`) and embedded Web Admin (`:8788`) as a single binary on Linux servers, Docker, or NAS: ```bash # Start via Docker Compose (builds embedded Web Admin automatically) docker compose -f deploy/docker-compose.server.yml up -d --build # Or manage directly with nexusd CLI nexusd serve --bind 127.0.0.1 --port 8787 --admin-port 8788 nexusd admin-token # Print Web Admin login token nexusd service install # Install as systemd (Linux) or launchd (macOS) daemon nexusd cursor connect --url http://127.0.0.1:8787 --shim ``` ---
🛠️ Developer Guide: Building from Source & Architecture (Click to expand) ### Prerequisites - **Node.js** >= 22 - **Rust** >= 1.85 stable (via `rustup`) - **Tauri v2** platform prerequisites (see [Tauri Prerequisites](https://v2.tauri.app/start/prerequisites/)) ### Build & Quality Gates ```bash git clone https://github.com/roviix/nexus.git cd nexus # Run desktop app in hot-reload dev mode cd apps/desktop && npm ci && npm run dev # Build single-binary headless server (embeds dist-web automatically) ./scripts/build-server.sh # Run full CI gates cargo fmt --all -- --check cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace cd apps/desktop && npm run build:vite && npm run build:web && npm test ``` ### Repository Layout ```text nexus/ ├── Cargo.toml # Rust Workspace (22 member crates) ├── crates/ │ ├── nexus-core/ # Pure domain types, error codes, and time utilities │ ├── nexus-store/ # SQLite WAL read/write pool, migrations, and activity log │ ├── nexus-gateway/ # Multi-dialect gateway, dual-track Cursor Connect-RPC, sub-keys & relay │ ├── nexus-server/ # Headless daemon nexusd, embedded Web Admin & full ops CLI │ ├── nexus-mesh/ # Noise_X E2EE P2P sharing, reverse tunnel & blind relay nexus-broker │ ├── nexus-connect/ # Config injection & backup for Claude Code / Codex / OpenCode / Pi / DSH │ ├── nexus-cursor/ # Cursor discovery, state.vscdb, machine IDs & --test-backend-url takeover │ ├── nexus-switcher/ # Standalone Cursor Switch Book & snapshot restore │ ├── nexus-accounts/ # Cursor account pool, OAuth polling & billing/usage parser │ └── nexus-*/ # Native upstream drivers (chatgpt, claude, kiro, antigravity, gemini-web, grok, zcode, qoder...) ├── apps/desktop/ # Tauri v2 desktop app (src/) & embedded Web Admin frontend (web-admin/) ├── deploy/ # Docker, Caddy, and systemd deployment assets for nexusd & nexus-broker └── docs/ # Deep-dive design docs: # ARCHITECTURE.md / MESH.md / CLOUD_DEPLOYMENT.md / CRSR.md / SAND.md ```
❓ Frequently Asked Questions (FAQ) (Click to expand) ### 1. Can I use my ChatGPT Plus, Claude Pro, or Kiro subscription inside Claude Code and Codex CLI? Yes. Add your accounts under **Accounts** via browser OAuth or token paste, assign them to a channel under **Channels**, and click **Connect** for Claude Code or Codex CLI. Nexus handles OpenAI ↔ Anthropic translation, Thinking budgets, and automatic 429 failover locally. ### 2. Does Cursor takeover modify `Cursor.app` or break when Cursor updates? No. The default zero-patch mode uses Cursor's official `--test-backend-url` flag combined with local Connect-RPC control-plane rewriting. It modifies zero bytes of `Cursor.app`, requires no macOS App Management permission, survives IDE updates, and detaches cleanly in one click. ### 3. Where are my credentials stored? Is anything uploaded to the cloud? All credentials, tokens, and request logs live strictly inside a local SQLite database on your machine (`0700` / `0600` permissions on macOS/Linux; `%APPDATA%` user ACL on Windows). **There is no cloud account and zero telemetry.** When optional Mesh sharing is enabled, raw tokens still never leave the lender's device—only `Noise_X` end-to-end encrypted payloads traverse the blind relay. ### 4. How can I share idle subscription quota across my desktop, laptop, or trusted teammates? You can either mint scoped `nx-...` **Sub-Keys** with USD spending limits and RPM caps on `nexusd`, or enable **Nexus Mesh** (no public IP required) to generate a one-time 16-character pairing code with per-channel concurrency limits and instant revocation. ### 5. Why does macOS show an "unverified developer" prompt on first launch? Open-source community builds use ad-hoc code signing (so macOS remembers local permissions across restarts) without paid Apple Developer ID notarization. On first launch, allow it via **System Settings → Privacy & Security → Open Anyway**; subsequent updates verify signatures via Tauri's minisign updater key.
--- ## 💬 AI Exploration & Community Join conversations on [GitHub Discussions](https://github.com/roviix/nexus/discussions) or connect with our developer group to share LLM engineering practices, Claude Code & Cursor workflows, and Mesh setups:
WeChat Community QR Code

Scan the WeChat QR code above (WeChat ID: ouyzam) with note AI or Nexus to join the community group.

--- ## ⚠️ Disclaimer - Nexus is intended solely for personal study, technical research, and legitimate multi-device workflow orchestration. - This software operates using authorized user sessions or client interfaces that you own. Users are solely responsible for complying with upstream Terms of Service; do not use it for automated abuse or unauthorized commercial resale. - This project is independent and not affiliated with, endorsed by, or sponsored by OpenAI, Anthropic, Cursor (Anysphere), xAI, AWS, Google, or Zhipu AI. - Distributed "AS IS" under the [MIT License](./LICENSE), without warranty of any kind. --- ## 📄 License Licensed under the [MIT License](./LICENSE). If Nexus streamlines your daily AI coding workflow, please consider giving the repo a **Star ⭐**! --- # 完整中文文档 (README.md)
Roviix Nexus Logo # Nexus **开源本地 AI 订阅聚合网关 · Cursor 零改包双轨中枢 · 去中心化 P2P 算力共享 (Mesh)** 把你手头的 ChatGPT、Claude、Cursor、Kiro、Gemini、Grok 等订阅号与 API Key,聚合为本机标准的 OpenAI / Anthropic 兼容接口。 [![Release](https://img.shields.io/github/v/release/roviix/nexus?include_prereleases&sort=semver&style=flat-square)](https://github.com/roviix/nexus/releases/latest) [![CI](https://github.com/roviix/nexus/actions/workflows/ci.yml/badge.svg?style=flat-square)](https://github.com/roviix/nexus/actions/workflows/ci.yml) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](./LICENSE) ![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Windows%20%7C%20Linux%20(nexusd)-lightgrey?style=flat-square) [![Website](https://img.shields.io/badge/Docs%20%26%20Web-roviix.github.io%2Fnexus-0f172a?style=flat-square)](https://roviix.github.io/nexus/zh/) [![LLMs.txt](https://img.shields.io/badge/GEO-llms.txt-10b981?style=flat-square)](./llms.txt) [**📥 下载最新版 (macOS / Windows)**](https://github.com/roviix/nexus/releases/latest) · [**🌐 官网概览**](https://roviix.github.io/nexus/zh/) · **中文** · [English](./README.en.md)
Roviix Nexus 本地 AI 网关通道、子密钥与 Mesh 控制台
--- > **什么是 Roviix Nexus(`roviix/nexus`)?** > **Roviix Nexus** 是一款基于 Rust + Tauri v2 构建的**开源(MIT)、本地优先(Local-First)AI 订阅聚合网关与多账号调度中枢**,提供 **macOS / Windows 原生桌面客户端**以及 **Linux / Docker 无头服务端 `nexusd`(内置 Web 管理台)**。它在本地统一暴露标准的 OpenAI(`/v1/chat/completions`、`/v1/responses`、`/v1/images/generations`)与 Anthropic(`/v1/messages`)接口,支持 **Claude Code、Cursor IDE、Codex CLI、OpenCode、Grok CLI、Pi、DeepSeek Harness** 一键无损接入,并内置端到端加密(`Noise_X`)的去中心化 P2P 号池出借网络(Nexus Mesh)。 --- ## 💡 为什么选择 Nexus? 日常使用 **Claude Code**、**Cursor**、**Codex CLI** 等 AI 编程工具时,开发者普遍面临四大痛点: - 💸 **订阅额度与 CLI 工具割裂**:明明已经付费开通了 ChatGPT Plus/Pro、Claude Pro/Max、Cursor、Kiro、Google Antigravity 等订阅,却无法在终端 Agent 中统一调度,额外购买按量 API Key 成本高昂; - 🛑 **单号 429 限流与切号打断心流**:编码到关键时刻触发 5 小时窗口或周配额上限,手动登出、换号、改配置严重破坏上下文; - 🧩 **Cursor 原生面板封闭难接管**:传统反代改不了 Cursor 内置 Composer 面板,而直接修改 `Cursor.app` 安装包不仅需要系统特权,每次升级还会失效; - 🌐 **跨设备与团队共享繁琐且不安全**:想把家里台式机闲置额度借给笔记本或同伴使用,往往要折腾公网 IP、内网穿透或暴露原始凭证。 👉 **Nexus 在本机一次解决上述全部问题**:多平台号池自动接力、零字节修改接管 Cursor 双轨协议、一键注入主流 CLI 配置、子密钥独立计量对账,以及单 443 端口端到端加密的 P2P 算力共享。 --- ## ✨ 核心特性 ### 1. 🔀 统一多方言本地网关 (Unified Multi-Dialect Gateway) 单个端口(默认 `127.0.0.1:8787`)同时解析并互转 **OpenAI Chat Completions**、**OpenAI Responses**、**Anthropic Messages**(含 `count_tokens`)与 **OpenAI Images** 四种协议: - 完整支持流式 SSE、Thinking / Reasoning 思考强度档位、Prompt Caching 与跨协议工具调用历史无损清洗; - 支持配置热生效的**本地出站代理**(`HTTP / HTTPS / SOCKS5 / SOCKS5H`),回环与局域网自动直连;Claude 订阅通道在走代理的同时完整保留原生 BoringSSL TLS 指纹。 ### 2. 🔄 多平台号池、会话粘性与无感接力 (Smart Account Pools & Auto-Relay) 支持自建多条逻辑通道(客户端写 `{通道前缀}/{模型名}` 精准路由,或走默认通道): - **粘性接力而非盲目轮询**:默认钉住当前可用账号以最大化 Prompt Cache 命中率与会话连贯性;仅在触发限流(429)或配额耗尽时毫秒级无感切换到池内下一账号,并发刷新自动走单飞锁(Singleflight); - **原生客户端切号器**:内置 **Cursor 切号本**(直写 `state.vscdb` + 一号一套专属机器码,切换前自动备份可还原)与 **Google Antigravity 切号**。
Nexus 多平台 AI 账号池与实时额度看板
### 3. 🎯 Cursor IDE 零改包双轨原生网关 (Zero-Patch Dual-Track Cursor Gateway) 无需修改 `Cursor.app` 任何磁盘字节(免 macOS App 管理权限,Cursor 升级永不失效),通过官方 `--test-backend-url`、`nexusd cursor connect` CLI 或跨平台免装脚本(macOS / Windows / Linux)一键接管: - **轨道一 · 原生号池直通 (`Cursor → Cursor`)**:对话流、模型目录、`@Codebase` 语义索引、`⌘K`、FastApply、Tab 补全与 MCP 服务自动从本地号池或远端 Mesh 节点换票,剥离本机占位/子密钥凭证并统一出借号静态设备指纹,杜绝多机风控; - **轨道二 · 异构模型驱动 Composer (`External Models → Cursor Agent`)**:在 Cursor 模型选择器中直接选用 Claude、ChatGPT、Kiro、Gemini 4、ZCode 或任意第三方 API 模型,经 `AgentService/Run` 与 `RunSSE + BidiAppend` 原生驱动本地终端、文件读写编辑、代码搜索、IDE Lints 诊断、本地 MCP 工具与 Plan 模式。 ### 4. ⚡ 主流编程 CLI 一键无损接入 (One-Click Client Onboarding) 改动前自动创建完整快照,随时一键还原,不污染原有配置: - **Claude Code**:自动配置 `~/.claude/settings.json`,支持主模型及 Opus / Sonnet / Haiku / Fable 分档映射; - **Codex CLI**:自动注入 `~/.codex/config.toml`; - **Cursor IDE**:一键以零补丁原生中继模式拉起并持久化冷启动垫片(亦可选传统 CRSR 补丁,见 [docs/CRSR.md](docs/CRSR.md)); - **OpenCode** / **Grok CLI** / **Pi**(`~/.pi/agent/models.json`) / **DeepSeek Harness (`dsh`)** 开箱即用。
Nexus 客户端一键接入与移动端扫码面板
### 5. 🌐 Nexus Mesh 端到端加密对等共享 (E2EE P2P Mesh Network) 通过反向长连接隧道,把空闲通道安全出借给自己的多台电脑或信任的伙伴: - **一次性 16 位动态配对码**:形如 `NX-ABCD-EFGH-JKMN-PQRT`(10 分钟有效、用后即焚),支持同时生成多个配对码分发多人,已授权设备可随时在线增减通道权限或一键撤销; - **零公网 IP、单 443 端口穿透**:经 `HTTPS Upgrade: nexus-tunnel/2` 建立长连接、以 `nexus-rpc/2` 全双工加密字节流承载双向 Agent RPC,轻松穿过企业防火墙与 HTTP 代理; - **盲中继与端到端加密**:基于长期密钥指纹钉扎与 `Noise_X` 加密,出借方原始 Token 永不出本机,协调服务器(`nexus-broker`)只转发密文、无法窥探提示词与回复;每条通道可独立设置外部并发上限(1 / 2 / 4 / 8 路)。详见 [docs/MESH.md](docs/MESH.md)。 ### 6. 🔑 子密钥分发、倍率账本与无头服务端 `nexusd` (Sub-Keys & Headless Server) - **子密钥与跑付对账单**:支持签发多把 `nx-...` 子密钥,独立限制可用通道、美元总额度与每分钟请求数(RPM),支持按通道设置 `0.01x ~ 100x` 费率倍率、子密钥免密受限登录 Web 管理台查账、一键结清归零与导出对账回执; - **无头服务端 `nexusd` + 内嵌 Web 管理台**:单二进制同时提供推理网关(`:8787`)、内嵌钛白 Web 管理控制台(`:8788`,支持手机扫码与移动端 PWA)及全功能运维 CLI,支持 Docker 与 Linux `systemd` / macOS `launchd` 常驻部署。 --- ## 📊 同类开源方案对比 | 能力维度 | **Roviix Nexus** (`roviix/nexus`) | **LiteLLM / New-API** | **CLIProxyAPI** | **CC-Switch** | | :--- | :---: | :---: | :---: | :---: | | **原生订阅号池接入**(ChatGPT / Claude / Cursor / Kiro / Antigravity / Grok / ZCode / Qoder / Gemini) | ✅ **9 大平台原生驱动 + API Key** | ⚠️ 以标准 API Key 为主 | ✅ 部分 CLI 订阅 | ⚠️ 本地配置切换为主 | | **CLI 工具一键注入与快照还原**(Claude Code / Codex / OpenCode / Pi / DSH) | ✅ **GUI + CLI 双端一键备份还原** | ❌ 需手动改各工具配置 | ❌ 需手动配置 | ✅ 桌面端配置切换 | | **Cursor IDE 零改包原生号池中继 + 外部模型跑 Composer Agent** | ✅ **双轨 Connect-RPC 完整支持** | ❌ 不支持 `agent.v1` 双向流 | ❌ 不支持 | ❌ 不支持 | | **跨设备 P2P 端到端加密共享(无需公网 IP / 凭证不出本机)** | ✅ **内置 `Noise_X` E2EE Mesh** | ❌ 需自行搭公网服务器 | ❌ 需自行暴露端口 | ❌ 无网关共享 | | **子密钥配额 / RPM / 通道倍率与跑付对账单** | ✅ **内置微美元账本与对账回执** | ✅ 重型多租户中心化系统 | ⚠️ 基础鉴权口令 | ❌ 无 | | **部署形态与资源占用** | ✅ **~18MB Tauri 桌面端 + 单文件 `nexusd`** | ⚠️ Python / Go + 外部数据库 | ✅ 轻量无头命令行 | ✅ 轻量桌面端 | --- ## 🧩 支持的上游渠道与下游客户端 | 支持的上游平台 | 接入方式 | 核心能力与协议亮点 | | :--- | :--- | :--- | | **ChatGPT (Codex)** | 浏览器 OAuth / Session JSON 批量导入 | 直连 Codex 后端,支持 GPT-5 / GPT-6.1 全系对话、Responses 与 `gpt-image-2` 出图 | | **Claude** | 网页 OAuth 授权 / 凭证导入 | 原生 Anthropic Messages 协议、Thinking 思考流、Prompt Cache 与 BoringSSL 原生指纹 | | **Cursor** | OAuth / Refresh Token / `crsr_` Key | 原生 Connect-RPC 号池直通、机器码隔离切号本、`RunGenerateImage` 出图 | | **Kiro** | AWS SSO 授权 / CLI Token 导入 | 聚合主流旗舰编程模型,高并发稳定接力与跨协议工具流适配 | | **Google Antigravity** | OAuth / 授权凭证导入 + 本机切号 | 支持 Gemini 4(Carbon / Neon / Argon)与 Claude / GPT 多分桶额度追踪与一键切号 | | **Google Gemini Web** | 网页会话凭证导入 | 支持 Gemini 对话推理与原生网页端图片生成桥接 | | **Grok (xAI)** | xAI 账号授权 / Refresh Token | 长上下文窗口、深度推理流与 Grok CLI 对接 | | **智谱 ZCode** | 自动读取 `~/.zcode` 凭证 / API Key | 区分个人版与团队版独立额度池,GLM 编码模型国内低延迟直连 | | **Qoder** | PAT 个人访问令牌导入 | 独立支持国际版(Global)与国内版(CN)双后端专线 | | **自定义 API 供应商** | 自定义 Base URL + API Key | 兼容 OpenRouter、DeepSeek、Kimi、硅基流动及任意 OpenAI / Anthropic 端点 | **下游开箱即用客户端**:Claude Code、Cursor IDE、Codex CLI、OpenCode、Grok CLI、Pi、DeepSeek Harness (`dsh`)、Chatbox、Cherry Studio、NextChat、Python / TypeScript 官方 OpenAI & Anthropic SDK。 --- ## 🚀 快速上手 ### 方式一:桌面客户端(macOS / Windows) 1. **下载安装**:前往 [GitHub Releases](https://github.com/roviix/nexus/releases/latest) 下载对应安装包: - **macOS**:`Nexus__macOS_universal.dmg`(Apple Silicon 与 Intel 通用包) - **Windows**:`Nexus__Windows_x64-setup.exe`(64 位一键安装包) 2. **添加账号并建通道**:打开「账号」页登录或批量粘贴凭证,在「通道」页勾选账号创建路由通道。 3. **一键接入客户端**:在「接入」页点击对应工具的「一键接入」,或直接通过标准 SDK 调用: ```bash curl http://127.0.0.1:8787/v1/chat/completions \ -H "Authorization: Bearer $NEXUS_GATEWAY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-5", "messages": [{"role": "user", "content": "你好,Nexus!"}] }' ``` ### 方式二:无头服务端 `nexusd`(Linux / Docker / 远程开发机) 在云服务器、NAS 或无桌面 Linux 主机上,用单二进制同时运行网关(`:8787`)与内嵌 Web 管理台(`:8788`): ```bash # Docker Compose 一键启动(源码构建,含内嵌 Web 管理控制台) docker compose -f deploy/docker-compose.server.yml up -d --build # 或使用 nexusd CLI 直接管理守护服务与本机工具接入 nexusd serve --bind 127.0.0.1 --port 8787 --admin-port 8788 nexusd admin-token # 查看 Web 管理台登录口令 nexusd service install # 注册为 Linux systemd / macOS launchd 自启服务 nexusd cursor connect --url http://127.0.0.1:8787 --shim ``` ---
🛠️ 开发者指南:从源码构建与仓库架构(点击展开) ### 环境要求 - **Node.js** >= 22 - **Rust** >= 1.85 stable(推荐通过 `rustup` 安装) - **Tauri v2** 平台前置依赖(详见 [Tauri Prerequisites](https://v2.tauri.app/start/prerequisites/)) ### 本地开发与全量门禁 ```bash git clone https://github.com/roviix/nexus.git cd nexus # 启动桌面端热重载开发 cd apps/desktop && npm ci && npm run dev # 构建无头服务端单文件二进制(自动编译内嵌 Web 管理台 dist-web) ./scripts/build-server.sh # 运行 CI 同款工程门禁 cargo fmt --all -- --check cargo clippy --workspace --all-targets -- -D warnings cargo test --workspace cd apps/desktop && npm run build:vite && npm run build:web && npm test ``` ### 仓库结构 ```text nexus/ ├── Cargo.toml # Rust Workspace 配置(22 个成员 crate) ├── crates/ │ ├── nexus-core/ # 领域模型、错误码与时间原语(零 IO) │ ├── nexus-store/ # 本地 SQLite WAL 读写池、状态迁移与活动日志 │ ├── nexus-gateway/ # 多方言统一网关、双轨 Cursor Connect-RPC、子密钥账本与额度接力 │ ├── nexus-server/ # 无头守护进程 nexusd、内嵌 Web 管理台与全功能运维 CLI │ ├── nexus-mesh/ # Noise_X 端到端加密共享网络、反向隧道与盲中继 nexus-broker │ ├── nexus-connect/ # Claude Code / Codex / OpenCode / Pi / DSH 配置注入与备份还原 │ ├── nexus-cursor/ # Cursor 定位、state.vscdb 读写、机器码隔离与 --test-backend-url 接管 │ ├── nexus-switcher/ # Cursor 独立切号本与快照还原 │ ├── nexus-accounts/ # Cursor 账号池、OAuth 轮询与用量账单解析 │ └── nexus-*/ # 各上游原生驱动(chatgpt, claude, kiro, antigravity, gemini-web, grok, zcode, qoder...) ├── apps/desktop/ # Tauri v2 桌面端(src/)与内嵌 Web 管理台前端(web-admin/) ├── deploy/ # nexusd 与 nexus-broker 的 Docker / Caddy / systemd 部署脚本 └── docs/ # 深度架构与协议设计文档: # ARCHITECTURE.md / MESH.md / CLOUD_DEPLOYMENT.md / CRSR.md / SAND.md ```
❓ 常见问题 (FAQ)(点击展开) ### 1. 我可以把自己的 ChatGPT Plus、Claude Pro 或 Kiro 订阅直接给 Claude Code / Codex CLI 用吗? 可以。在 Nexus「账号」页通过浏览器 OAuth 或导入凭证绑定账号,在「通道」页新建对应通道后,前往「接入」页点击 Claude Code 或 Codex CLI 的「一键接入」即可。Nexus 会在本地自动完成 OpenAI / Anthropic 协议互转、Thinking 参数映射与多账号 429 无感接力。 ### 2. Cursor 零改包接管(`--test-backend-url`)会修改 `Cursor.app` 安装文件吗? **完全不修改任何字节。** 默认零补丁模式使用 Cursor 官方支持的命令行参数配合本地 Connect-RPC 控制面重写,不需要 macOS「App 管理」权限,也不会因 Cursor 自动更新而失效;断开后一键恢复原状。 ### 3. 我的账号 Token 存在哪里?会不会上传到云端? 全部凭证、请求账本与配置均仅存储在你本机的 SQLite 数据库中(macOS 权限收紧为 `0700` / `0600`,Windows 遵循 `%APPDATA%` 用户目录 ACL),**无云端账户体系、零遥测上报**。即使开启可选的 Nexus Mesh 共享,原始凭证也永远留在出借方本机,经协调服务器转发的仅为 `Noise_X` 端到端加密密文。 ### 4. 如何把家里电脑闲置的订阅额度分享给公司电脑或团队伙伴? 既可以在同一局域网/公网用 `nexusd` 签发受配额和 RPM 限制的 `nx-...` 子密钥,也可以在零公网 IP 环境下开启 **Nexus Mesh** 生成一次性 16 位配对码发给对方设备,随时在通道页调整权限或一键撤销设备授权。 ### 5. macOS 首次打开提示“无法验证开发者”怎么办? 当前开源社区版 macOS 安装包采用 ad-hoc 签名(以保证系统权限记忆稳定)但未做 Apple 商业公证;首次打开若遇 Gatekeeper 拦截,在「系统设置 → 隐私与安全性」中点击「仍要打开」即可,后续支持应用内 Tauri 签名校验更新。
--- ## 💬 AI 探索与交流 (Community) 欢迎加入 AI 探索与技术交流群,或前往 [GitHub Discussions](https://github.com/roviix/nexus/discussions) 围绕大模型工程落地、Claude Code / Cursor 实战工作流与多设备 Mesh 组网自由探讨!
WeChat Community QR Code

微信扫码添加好友(微信号:ouyzam),备注 AI 交流 或 Nexus 即可受邀进群。

--- ## ⚠️ 免责声明 (Disclaimer) - Nexus 仅供个人合法学习、技术研究与个人多设备统一工作流调度使用。 - 本软件通过调用用户自身拥有合法授权的账户会话或客户端接口工作。请严格遵守各上游平台的服务条款(Terms of Service),切勿用于高频滥用或未经授权的商业转售,账号限流或封禁风险由使用者自行评估承担。 - 本项目与 OpenAI、Anthropic、Cursor (Anysphere)、xAI、AWS、Google、智谱等公司无任何商业隶属或背书关系。 - 软件基于 [MIT 许可证](./LICENSE) 按“原样(AS IS)”提供,不附带任何明示或暗示担保。 --- ## 📄 开源协议 本项目采用 [MIT 许可证](./LICENSE) 开源。如果 Nexus 帮到了你的日常开发工作流,欢迎点亮右上角 **Star ⭐** 支持项目演进!