{"slug": "nexus-cli-pure-go-bridge-to-deepseek-r1-v3-with-claude-code-and-ollama-support", "title": "Nexus-CLI – Pure Go Bridge to DeepSeek R1/V3 with Claude Code and Ollama Support", "summary": "A developer released Nexus-CLI, a pure Go command-line tool and local API proxy that connects applications and coding agents to DeepSeek V3 (deepseek-chat) and R1 (deepseek-reasoner) models through a free chat.deepseek.com web account rather than a paid DeepSeek API key. Nexus-CLI solves DeepSeek's DeepSeekHashV1 proof-of-work challenges in parallel across CPU cores, clearing difficulty 144,000 challenges in roughly 40–50 milliseconds with zero runtime dependencies, and its `nexus serve` proxy exposes OpenAI, Anthropic Messages (compatible with Claude Code and the Anthropic SDK) and native Ollama endpoints. The tool also adds a multi-account pool with round-robin rotation to work around HTTP 429 rate limits, structured JSON Schema outputs, and a one-command launcher for Claude Code, Codex, OpenCode, Goose and Aider, and requires Go 1.20 or later to build.", "body_md": "A high-performance Golang CLI utility and local API proxy server that enables any application or coding agent to connect to DeepSeek **V3** (`deepseek-chat`) and **R1** (` deepseek-reasoner` / Thinking) models via a free web account (`chat.deepseek.com`), without requiring an official paid DeepSeek API key.\n\nRewritten from scratch in pure Go (Golang) based on in-depth analysis of Node.js (`FreeDeepseekAPI-EN`) and Python (` deepseek_bridge`) projects, featuring **zero runtime dependencies**.\n\n1. **Pure Go Parallel PoW (Proof-of-Work) Solver:**  - Solves DeepSeek server challenges using the `DeepSeekHashV1` algorithm (Keccak-f[1600] 1..23 rounds SHA3-256) parallelized across CPU cores.\n  - Solves difficulty 144,000 challenges in just **~40–50 milliseconds** (no CGO, WASM, or Python dependencies required).\n2. Solves DeepSeek server challenges using the \n3. **Interactive Terminal Chat (REPL):**  - Streams the R1 model's thought process (`reasoning_content` ) in real-time with dedicated styling (italic/cyan).\n  - Polished ANSI UI with colorful prompts and animated loading spinners.\n  - Built-in slash commands: `/help` ,`/new` ,`/model` ,`/thinking` ,`/search` ,`/whoami` ,`/clear` ,`/exit` .\n4. Streams the R1 model's thought process (\n5. **One-Off & Unix Pipe Support:**  - Direct CLI queries: `nexus \"What is quantum computing?\"`\n  - Linux/macOS pipe workflows: `cat main.go | nexus \"Review this code for security and performance\"`\n6. Direct CLI queries: \n7. **OpenAI, Anthropic & Ollama Compatible Proxy Server (`nexus serve`):**  - `POST /v1/chat/completions` (OpenAI format, SSE streaming, and JSON)\n  - `POST /v1/messages` (Anthropic Messages API — 100% compatible with**Claude Code** and the Anthropic SDK!)\n  - `POST /v1/responses` (OpenAI Responses API)\n  - `GET /v1/models` and`GET /v1/model-capabilities`\n  - `GET /v1/sessions` and`POST /v1/sessions/reset`\n  - Connects seamlessly with Open WebUI, Continue.dev, Cursor, Cline, and any other OpenAI/Anthropic client.\n8. **Native Ollama API Emulation 🦙:**  - Emulates `GET /api/tags` ,`POST /api/chat` ,`POST /api/generate` ,`GET /api/version` .\n  - Direct plug-and-play compatibility with Open WebUI, Dify, AnythingLLM, Cursor, LlamaIndex, and official Ollama SDKs.\n9. Emulates \n10. **Structured Outputs & JSON Schema 🎯:**  - Enforce strict JSON output or validate against JSON Schemas across CLI, Ollama, and OpenAI endpoints.\n11. **Universal Integrations (Launcher) 🚀:**  - One-command launcher for Claude Code, DeepSeek Harness, Codex, OpenCode, Goose, and Aider (Nexus automatically boots the proxy in the background).\n12. **Multi-Account Pool 👥:**  - Rotate multiple DeepSeek accounts using Round-Robin scheduling to eliminate rate-limit roadblocks (HTTP 429).\n13. **Authentication Management (`nexus auth`):**  - Manual login: `nexus auth login` (extract`userToken` from browser LocalStorage)\n  - Automatic via Chrome: `nexus auth chrome` (reads session token from browser memory via CDP)\n  - Account inspection: `nexus auth whoami`\n14. Manual login: \n15. **System Diagnostics (Doctor):**  - `nexus doctor` — instantly checks token validity, server connectivity, PoW solver performance, and session creation.\n\nRequires Go 1.20+:\n\n```\n# Clone repository and navigate to directory:\ngit clone https://github.com/xamrayev/nexus-cli.git\ncd nexus-cli\n\n# Build the executable binary:\ngo build -o bin/nexus .\n\n# Install globally to system PATH (optional):\ngo install .\n```\n\nThere are 3 ways to connect your DeepSeek account:\n\n```\n./bin/nexus auth login\n```\n\nYou will be prompted for your `userToken`:\n\n1. Open `https://chat.deepseek.com` in your browser.\n2. Press `F12` (or`Cmd+Option+I` on macOS).\n3. Navigate to `Application` ->`Local Storage` ->`https://chat.deepseek.com` -> copy the`userToken` value and paste it into the prompt.\n\n```\n./bin/nexus auth chrome\n```\n\nThis automatically launches a Chrome window. Once you log in, Nexus securely captures and stores the session token.\n\nCreate a `.env` file in the project root:\n\n```\nDEEPSEEK_TOKEN=your_deepseek_token_here\n./bin/nexus chat\n```\n\nOr simply:\n\n```\n./bin/nexus\n```\n\nReal-time R1 reasoning stream:\n\n```\nnexus ❯ Why is the sky blue?\n\n💭 Thinking Process:\nThe user is asking about the physical cause behind the color of the sky...\nNeed to explain the mechanism of Rayleigh scattering of sunlight by atmospheric molecules...\n\n🤖 DeepSeek (deepseek-reasoner):\nThe primary reason the sky appears blue is due to a phenomenon called Rayleigh scattering...\n./bin/nexus \"Provide 3 key facts about general relativity\"\ncat main.go | ./bin/nexus \"Analyze this code for security vulnerabilities and performance bottlenecks\"\n./bin/nexus serve --port 9655\n```\n\nYou can now route any tool (Cursor, Open WebUI, Claude Code) to `http://localhost:9655/v1`!\n\n**Sample cURL request in OpenAI format:**\n\n```\ncurl http://localhost:9655/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"deepseek-reasoner\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}],\n    \"stream\": true\n  }'\n```\n\nNexus implements the Ollama API specification. Open WebUI, Dify, AnythingLLM, Cursor, LlamaIndex, and official Ollama libraries can connect directly to `http://localhost:9655`:\n\n```\n# 1. Fetch available models (Ollama format)\ncurl http://localhost:9655/api/tags\n\n# 2. Ollama Chat request (NDJSON streaming)\ncurl http://localhost:9655/api/chat -d '{\n  \"model\": \"deepseek-reasoner\",\n  \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}],\n  \"stream\": true\n}'\n```\n\n**Using the official Python Ollama SDK:**\n\n``` python\nimport ollama\n\nclient = ollama.Client(host=\"http://localhost:9655\")\nresp = client.chat(model=\"deepseek-reasoner\", messages=[\n    {\"role\": \"user\", \"content\": \"Write a simple HTTP server in Go\"}\n])\nprint(resp[\"message\"][\"content\"])\n```\n\nEnforce strict JSON output or conform to a specified schema:\n\n```\n# 1. Direct JSON from CLI (pipeable to jq)\n./bin/nexus \"Top 3 programming languages and their primary domains\" --format json | jq .\n\n# 2. Via Ollama API:\ncurl http://localhost:9655/api/chat -d '{\n  \"model\": \"deepseek-reasoner\",\n  \"messages\": [{\"role\": \"user\", \"content\": \"List 3 fruits in JSON\"}],\n  \"format\": \"json\",\n  \"stream\": false\n}'\n\n# 3. Via OpenAI API (response_format):\ncurl http://localhost:9655/v1/chat/completions -d '{\n  \"model\": \"deepseek-reasoner\",\n  \"messages\": [{\"role\": \"user\", \"content\": \"Return device specs as JSON\"}],\n  \"response_format\": {\"type\": \"json_object\"}\n}'\n```\n\nLaunch coding tools and agents with a single command — Nexus automatically boots the proxy server in the background:\n\n```\n# 1. Claude Code CLI (powered by DeepSeek R1 / V3)\n./bin/nexus launch claude\n./bin/nexus launch claude -p \"Refactor this Go code\"\n\n# 2. Official DeepSeek Harness CLI (@deepseek-ai/dsh)\n./bin/nexus launch dsh\n\n# 3. OpenAI Codex CLI (auto-configured with responses wire API)\n./bin/nexus launch codex\n\n# 4. OpenCode CLI (with automated config injection)\n./bin/nexus launch opencode\n\n# 5. Block Goose AI Agent (via OpenAI provider)\n./bin/nexus launch goose\n\n# 6. Aider Pair Programming CLI (with DeepSeek R1)\n./bin/nexus launch aider\n\n# 7. ChatGPT Desktop (macOS) & local bridge\n./bin/nexus launch chatgpt\n\n# 8. Multi-Account Pool Monitor\n./bin/nexus launch pool\n\n# 9. DeepSeek Agentic Eval & Benchmark Harness\n./bin/nexus launch harness\n```\n\nAvoid rate limits (HTTP 429) by cycling through multiple DeepSeek accounts using Round-Robin rotation:\n\n```\n# Add a new account\n./bin/nexus auth add acc2 --chrome\n\n# List accounts and check their status\n./bin/nexus auth list\n\n# Switch active account\n./bin/nexus auth switch acc2\n\n# Validate all accounts in the pool\n./bin/nexus auth test\n./bin/nexus doctor\nnexus-cli/\n├── bin/\n│   └── nexus                     # Compiled binary executable\n├── cmd/\n│   └── nexus/main.go             # CLI command dispatcher\n├── pkg/\n│   ├── deepseek/\n│   │   ├── pow.go                # Pure Go parallel DeepSeekHashV1 Keccak PoW solver\n│   │   ├── pow_test.go           # PoW test suite & benchmarks\n│   │   ├── stream.go             # SSE JSON patch & OpenAI stream parser\n│   │   ├── stream_test.go        # Stream tests\n│   │   ├── auth.go               # Token, session, and profile manager\n│   │   ├── chrome_auth.go        # Automated Chrome CDP authentication\n│   │   ├── client.go             # DeepSeek Web API client (Chat, Sessions, Auto-retry)\n│   │   └── types.go              # Model configs and type definitions\n│   ├── server/\n│   │   ├── server.go             # Local HTTP proxy server (Routing, CORS, Auth)\n│   │   ├── server_test.go        # Server endpoint unit tests\n│   │   ├── openai.go             # OpenAI Chat Completions API adapter\n│   │   ├── anthropic.go          # Anthropic Messages API adapter (for Claude Code)\n│   │   └── session.go            # Agent session isolation and cleanup\n│   ├── launcher/\n│   │   └── launcher.go           # Launchers for Claude Code, Codex, Goose, Aider, etc.\n│   └── cli/\n│       ├── terminal.go           # ANSI styling, banners, and spinners\n│       ├── repl.go               # Interactive terminal chat & slash commands\n│       ├── runner.go             # Single-prompt and Unix pipe runner\n│       └── doctor.go             # End-to-end system diagnostics\n├── main.go                       # Application entry point\n├── go.mod                        # Go module definition\n├── README.md                     # Main documentation (English)\n├── README.ru.md                  # Russian documentation (Русский)\n└── README.uz.md                  # Uzbek documentation (O'zbekcha)\n```\n\nDistributed under the MIT License.", "url": "https://wpnews.pro/news/nexus-cli-pure-go-bridge-to-deepseek-r1-v3-with-claude-code-and-ollama-support", "canonical_source": "https://github.com/xamrayev/nexus-cli", "published_at": "2026-10-21 04:37:18+00:00", "updated_at": "2026-10-21 04:48:13.842903+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "large-language-models", "ai-agents", "ai-products"], "entities": ["Nexus-CLI", "DeepSeek", "DeepSeek V3", "DeepSeek R1", "Claude Code", "Ollama", "Open WebUI", "Cursor"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/nexus-cli-pure-go-bridge-to-deepseek-r1-v3-with-claude-code-and-ollama-support", "markdown": "https://wpnews.pro/news/nexus-cli-pure-go-bridge-to-deepseek-r1-v3-with-claude-code-and-ollama-support.md", "text": "https://wpnews.pro/news/nexus-cli-pure-go-bridge-to-deepseek-r1-v3-with-claude-code-and-ollama-support.txt", "jsonld": "https://wpnews.pro/news/nexus-cli-pure-go-bridge-to-deepseek-r1-v3-with-claude-code-and-ollama-support.jsonld"}}