[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81459":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":12,"openIssues":13,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":9,"rankLanguage":9,"license":16,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},81459,"deepseek-cli","yinshuo-thu\u002Fdeepseek-cli","yinshuo-thu","The latest native DeepSeek CLI ",null,"TypeScript",31,1,6,0,40.9,"MIT License",false,"main",true,[],"2026-06-12 04:01:33","# 🐋 DeepSeek-CLI\n\n> A native, terminal-first coding agent for the **DeepSeek V4** model family — built to match the look-and-feel of Claude Code, command-for-command, while running entirely on your DeepSeek API key.\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](LICENSE)\n![Status](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-M2%20alpha-orange)\n\n---\n\n## Why this exists\n\nThere are two great DeepSeek terminal projects already (`Hmbown\u002FDeepSeek-TUI` in Rust, `CJackHwang\u002Fds2api` in Go), and both inspired this one. **DeepSeek-CLI** is different in three ways:\n\n1. **Identical UX to Claude Code.** Slash commands, tool cards, permission prompts, status bar, splash screen — all match the Claude reference, so muscle memory carries over.\n2. **TypeScript + Ink stack.** Same stack Anthropic uses for Claude Code itself; visual fidelity is highest here.\n3. **Native API + reverse-proxy login.** Officially supports `DEEPSEEK_API_KEY`, with optional ds2api-style web-session reverse proxy for users who prefer browser auth.\n\n> Roadmap: see [TODO.md](TODO.md). M2 (this release) adds the login proxy, plan\u002Fagent\u002Fyolo modes, reasoning tiers, and the two-pane splash. M3–M5 add subagents, MCP\u002FSkills\u002FHooks, and binary distribution.\n\n## Install\n\n> M5 will ship a one-liner installer. For now, install from source:\n\n```bash\ngit clone git@github.com:yinshuo-thu\u002Fdeepseek-cli.git\ncd deepseek-cli\nnpm install\nnpm run build\nnpm link        # exposes `deepseek` and `ds` globally\n```\n\nDev mode (no build step):\n\n```bash\nnpm run dev      # runs src\u002Fcli.tsx via tsx\n```\n\n## Quickstart\n\n```bash\nexport DEEPSEEK_API_KEY=sk-...\ndeepseek\n```\n\nFirst run with no key shows a wizard that prompts for one and writes it to `~\u002F.deepseek\u002Fconfig.json` (chmod 600).\n\nOne-shot mode for scripting:\n\n```bash\ndeepseek --print \"summarise this repo's README\" \u003C README.md\n```\n\n## Models\n\n| Model                 | Use it for                          | Pricing (USD \u002F 1M tok)       |\n|-----------------------|-------------------------------------|------------------------------|\n| `deepseek-v4-flash`   | default — fast, cheap, tool-capable | $0.14 in \u002F $0.28 out         |\n| `deepseek-v4-pro`     | hard reasoning, long context        | $0.435 in \u002F $0.87 out        |\n\nSwitch in-session: `\u002Fmodel deepseek-v4-pro`. When `\u002Freasoning max` is set, the agent transparently routes to `deepseek-reasoner` for that turn.\n\n## What works\n\nShipped through M2.0:\n\n- **Slash commands:** `\u002Fhelp` `\u002Fclear` `\u002Fmodel` `\u002Fmode` `\u002Freasoning` `\u002Fconfig` `\u002Fcost` `\u002Fresume` `\u002Fcwd` `\u002Flogin` `\u002Flogout` `\u002Fwhoami` `\u002Fexit`\n- **Tools:** Read · Write · Edit · Bash · Glob · Grep · list_dir · apply_patch · WebFetch · WebSearch\n- **Modes:** Plan \u002F Agent \u002F YOLO — Tab cycles through them with the input box empty\n- **Reasoning effort:** `off` \u002F `high` \u002F `max` — Shift+Tab cycles. `max` routes the turn to `deepseek-reasoner`\n- **Streaming agent loop** with permission prompts (allow once \u002F always \u002F deny) and Read-before-Write safety\n- **Per-project session persistence** at `~\u002F.deepseek\u002Fprojects\u002F\u003Cslug>\u002Fsessions\u002F` plus a `\u002Fresume` picker\n- **First-run API-key wizard** and ds2api-style **`\u002Flogin` flow** with a local OpenAI-compatible reverse proxy that wires the real DeepSeek-web format end-to-end (M2.1a) — see [the `\u002Flogin` caveats](#login-reverse-proxy-caveats) below\n- **Two-pane Claude-Code-style splash** with Recent activity + What's new\n- DeepSeek-blue theme and whale brand art; Esc cancels the stream, Ctrl+C twice to exit\n\n## `\u002Flogin` reverse-proxy caveats\n\nThe `\u002Flogin` flow speaks the **reverse-engineered chat.deepseek.com web protocol** — it is not an officially supported DeepSeek API surface. It works the same way [`ds2api`](https:\u002F\u002Fgithub.com\u002FCJackHwang\u002Fds2api) does: paste the `Cookie` header from your logged-in browser tab, and a local OpenAI-compatible proxy rewrites every `\u002Fv1\u002Fchat\u002Fcompletions` request into a DeepSeek-web `chat_session\u002Fcreate` + `chat\u002Fcompletion` SSE handshake (with a pure-JS `DeepSeekHashV1` solver for the proof-of-work challenge when DeepSeek demands one).\n\n> **Best-effort, may break, may violate DeepSeek's Terms of Service.** Use at your own risk. The official API-key flavor (`DEEPSEEK_API_KEY`) remains the default and recommended path; `\u002Flogin` is for users who prefer browser auth. DeepSeek can change the wire format, tighten Cloudflare gating, or revoke web sessions at any time, and we will not always patch the same week.\n\n### How to extract your cookie\n\n1. Open \u003Chttps:\u002F\u002Fchat.deepseek.com> in Chrome\u002FEdge\u002FFirefox and log in normally.\n2. Open DevTools (F12) → **Network** tab → reload the page.\n3. Click any request to `chat.deepseek.com\u002Fapi\u002Fv0\u002F...` → **Headers** → **Request Headers**.\n4. Copy the entire value of the `Cookie:` header (everything after `Cookie: `, all on one line — typically several KB).\n5. Run `\u002Flogin` in deepseek-cli, paste the cookie into the local browser page that opens, and submit.\n\nIf validation fails with \"session expired\" your cookie is stale (re-login at chat.deepseek.com). If it fails with \"DDoS-Guard challenge\" Cloudflare is gating that IP — pass a fresh challenge in your browser first, then retry.\n\n## Architecture\n\n```\nsrc\u002F\n├── cli.tsx            # entry: yargs, first-run wizard, render \u003CApp\u002F>\n├── App.tsx            # main TUI — state + agent loop driver\n├── api\u002F\n│   ├── client.ts      # streaming OpenAI-compatible client (SSE)\n│   └── types.ts       # ChatMessage, ToolCall, StreamEvent\n├── agents\u002F\n│   └── loop.ts        # stream → accumulate tool_calls → run → loop\n├── auth\u002F              # \u002Flogin proxy server + session store\n├── tools\u002F             # Read · Write · Edit · Bash · Glob · Grep · list_dir · apply_patch · WebFetch · WebSearch\n├── commands\u002F          # slash-command registry\n├── ui\u002F                # Splash, Message, StatusBar, Permission, ResumePicker, theme, markdown\n├── session\u002F           # per-project persistent message log\n└── config\u002F            # ~\u002F.deepseek\u002Fconfig.json + project key hashing\n```\n\n## Multi-agent orchestration\n\nThis project is *itself* built by a small fleet of role-specific Claude Code agents driven by the orchestrator in [`.claude\u002F`](.claude\u002F):\n\n- **`.claude\u002Fagents\u002F`** — agent definition files. Each is a Markdown front-matter spec for a role (`plan`, `dev`, `eval`, `summary`, `github`) plus its tools and behavioural rules.\n- **`.claude\u002Fruns\u002F`** — a chronological log of every round. Files like `2026-05-02-r03-dev-m20-skeleton.md` capture the prompt, the agent's output, and the evaluator's findings.\n\nThe typical loop is *Plan → DEV → Eval → Summary* per milestone, with the GitHub agent handling commits and PRs. New contributors can read `runs\u002F` to see exactly how each feature got built and why each design call was made.\n\n## Comparison with Claude Code\n\nDeepSeek-CLI is designed as a feature-parallel open-source alternative to Claude Code, running on DeepSeek models instead of Claude. The table below tracks parity:\n\n| Feature | DeepSeek-CLI | \u003Cimg src=\"https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F76263028?s=16&v=4\" height=\"14\" valign=\"middle\"> Claude Code |\n|---------|:---:|:---:|\n| **Core UX** | | |\n| Streaming chat + Markdown rendering | ✅ | ✅ |\n| LaTeX math display (inline & block) | ✅ | ✅ |\n| Reasoning \u002F thinking blocks | ✅ | ✅ |\n| Cost & token tracking (`\u002Fcost`) | ✅ | ✅ |\n| Plan \u002F Agent \u002F YOLO modes | ✅ | ✅ |\n| Permission prompts (once \u002F always \u002F deny) | ✅ | ✅ |\n| **Tools** | | |\n| Read · Write · Edit · Bash · Glob · Grep | ✅ | ✅ |\n| WebFetch · WebSearch | ✅ | ✅ |\n| apply\\_patch | ✅ | ✅ |\n| Multi-agent (Agent \u002F SendMessage \u002F Monitor) | ✅ | ✅ |\n| Multimodal \u002F image input | ❌ | ✅ |\n| **Slash Commands** | | |\n| `\u002Fhelp` · `\u002Fclear` · `\u002Fmodel` · `\u002Fmode` · `\u002Fcost` | ✅ | ✅ |\n| `\u002Fresume` + per-project session persistence | ✅ | ✅ |\n| `\u002Fcompact` (context compression) | ✅ | ✅ |\n| `\u002Fdoctor` · `\u002Finit` · `\u002Fbug` | ✅ | ✅ |\n| `\u002Flogin` (browser OAuth \u002F reverse proxy) | ✅ | ❌ |\n| `\u002Freasoning` effort tiers (off \u002F high \u002F max) | ✅ | ❌ |\n| **Extensions** | | |\n| MCP servers | ✅ | ✅ |\n| Skills (slash commands loaded from `.md`) | ✅ | ✅ |\n| Hooks (PreToolUse \u002F PostToolUse \u002F Stop \u002F UserPromptSubmit) | ✅ | ✅ |\n| **Auth & Distribution** | | |\n| API key auth (`DEEPSEEK_API_KEY`) | ✅ | ✅ |\n| Browser-session login proxy (ds2api-style) | ✅ | ❌ |\n| `npm link` global install | ✅ | ✅ |\n| IDE integration (VS Code \u002F JetBrains) | ❌ | ✅ |\n| One-line binary installer | 🔜 M5 | ✅ |\n| **Advanced** | | |\n| Memory system (project-level `CLAUDE.md`) | ❌ | ✅ |\n| Background \u002F scheduled agents | ❌ | ✅ |\n| Git-aware operations (native git tool) | ❌ | ✅ |\n\n## Configuration\n\n`~\u002F.deepseek\u002Fconfig.json`:\n\n```json\n{\n  \"baseUrl\": \"https:\u002F\u002Fapi.deepseek.com\",\n  \"model\": \"deepseek-v4-flash\",\n  \"theme\": \"dark\",\n  \"telemetry\": false,\n  \"apiFlavor\": \"openai\",\n  \"permissionMode\": \"agent\",\n  \"reasoningEffort\": \"off\"\n}\n```\n\nOverride per run with `--api-key`, `--base-url`, `--model` or env vars.\n\n## Contributing\n\nIssues and PRs welcome. The fastest way to make a change is `npm run dev` then iterate on `src\u002F`. Before opening a PR, run `npm run typecheck`.\n\n## License\n\nMIT — see [LICENSE](LICENSE).\n\n---\n\n> _DeepSeek-CLI is an independent project. Not affiliated with DeepSeek or Anthropic._\n","DeepSeek-CLI 是一个专为 DeepSeek V4 模型系列设计的终端优先编码代理工具。它采用 TypeScript 和 Ink 技术栈构建，提供与 Claude Code 相同的用户体验，包括斜杠命令、工具卡片等界面元素，确保用户能够无缝过渡。项目支持通过环境变量或反向代理登录方式使用 DeepSeek API 密钥，并具备多模型切换、多种工作模式（如计划\u002F代理\u002FYOLO模式）以及推理级别设置等功能，适用于需要高效编程辅助的各种开发场景。",2,"2026-06-11 04:05:09","CREATED_QUERY"]