@deepseekcode/cli 1.0.28 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -99
- package/dist/cli.js +1066 -1014
- package/package.json +1 -1
- package/web/dist/assets/AutomationView-Y4qkPsrX.js +1 -0
- package/web/dist/assets/{ChannelConfigView-DGK82bWj.js → ChannelConfigView-BqEclPUB.js} +3 -3
- package/web/dist/assets/{ConnectorsView-5kzDUnd8.js → ConnectorsView-Cz4uqSmh.js} +1 -1
- package/web/dist/assets/{FileTreeView-BQfRRAXr.js → FileTreeView-BWPOqGPh.js} +1 -1
- package/web/dist/assets/{HookConfigView-CdQVgzog.js → HookConfigView-japq3zFX.js} +1 -1
- package/web/dist/assets/ModelsView-Dbo4GErV.js +1 -0
- package/web/dist/assets/{PluginsView-bQipmAy8.js → PluginsView-C1BPNAQx.js} +1 -1
- package/web/dist/assets/SessionGrid-BGpz0-op.css +1 -0
- package/web/dist/assets/SessionGrid-F23LrdJ2.js +42 -0
- package/web/dist/assets/{SettingsPanel-CpmNWZmn.js → SettingsPanel-CGJbV37j.js} +3 -3
- package/web/dist/assets/{SkillsView-DLGgMIsT.js → SkillsView-CecX9sxV.js} +1 -1
- package/web/dist/assets/{TemplatesTab-4085BhAx.js → TemplatesTab-BtbjQDQk.js} +1 -1
- package/web/dist/assets/{TerminalView-BVZAuLTB.js → TerminalView-6U_87hSL.js} +1 -1
- package/web/dist/assets/{ThreeScene-CukEnQe-.js → ThreeScene-Zhjwe9nT.js} +1 -1
- package/web/dist/assets/{ToolsView-DeCt1EIB.js → ToolsView-DO0_61eJ.js} +1 -1
- package/web/dist/assets/{icons-Cu8fYt4q.js → icons-Di-qMB6n.js} +124 -109
- package/web/dist/assets/index-BbLAiXis.css +1 -0
- package/web/dist/assets/index-Dkxsd1Rx.js +484 -0
- package/web/dist/assets/{markdown-Bym7wmT0.js → markdown-D-c9V8Xq.js} +1 -1
- package/web/dist/assets/{panels-BEKHl5l-.js → panels-CpHTincc.js} +1 -1
- package/web/dist/assets/{react-vendor-D76F8wnc.js → react-vendor-DU8XgZt2.js} +1 -1
- package/web/dist/assets/{state-CZakZ3-m.js → state-D2vcUGVk.js} +1 -1
- package/web/dist/index.html +7 -7
- package/web/dist/assets/AutomationView-CpFBgFvV.js +0 -1
- package/web/dist/assets/ModelsView-Dpwx3f-Q.js +0 -1
- package/web/dist/assets/SessionGrid-DFVjPnhc.js +0 -39
- package/web/dist/assets/index-Bg6EQpr3.js +0 -484
- package/web/dist/assets/index-CYAcRfnc.css +0 -1
package/README.md
CHANGED
|
@@ -1,123 +1,150 @@
|
|
|
1
1
|
# @deepseekcode/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@deepseekcode/cli)
|
|
4
|
+
[](https://www.npmjs.com/package/@deepseekcode/cli)
|
|
5
|
+
[](https://nodejs.org)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
**DeepSeekCode CLI** — a TypeScript-first AI coding agent with an interactive terminal UI, a built-in web UI, and a local HTTP/WS runtime. It starts a full agent core in-process, opens an [Ink](https://github.com/vadimdemedes/ink) (React-for-terminal) interface in your terminal, and serves a companion web UI you can use for configuration and remote access.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
node packages/cli/dist/cli.js codeview # AI code review
|
|
13
|
-
node packages/cli/dist/cli.js --resume # Resume last session
|
|
14
|
-
```
|
|
9
|
+
- **TUI** — interactive, keyboard-first coding agent in your terminal
|
|
10
|
+
- **Local runtime** — spins up an in-process server (HTTP + WebSocket), no separate install needed
|
|
11
|
+
- **Web UI** — configuration & model management at `http://localhost:8080`
|
|
12
|
+
- **Non-interactive modes** — `exec`, `codeview`, `test-fix` for scripts & CI
|
|
13
|
+
- **Multi-theme** — dark / light / nord / dracula / monokai / one-dark / tokyo-night
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
Requires **Node.js >= 18**.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
store.ts # Microtask-batched state store
|
|
25
|
-
ink/ # Forked Ink renderer (frame budget, Yoga caching)
|
|
26
|
-
hooks/ # React hooks for state, animation, WebSocket, mouse, keyboard
|
|
27
|
-
components/ # UI components (ChatArea, StatusLine, TextInput, etc.)
|
|
28
|
-
tui/ # Interaction primitives (selection, navigation, search)
|
|
29
|
-
commands/ # Slash command registry and handlers
|
|
30
|
-
utils/ # Utilities (session persistence, logging, config)
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Install
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install -g @deepseekcode/cli
|
|
31
23
|
```
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
Or with your favorite package manager:
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
```bash
|
|
28
|
+
# pnpm
|
|
29
|
+
pnpm add -g @deepseekcode/cli
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- **Dynamic tick rate**: idle (2fps) → active (5fps) → streaming (10fps). Default changed from 50ms/20fps to 200ms/5fps.
|
|
40
|
-
- **Auto-stop**: Clock stops entirely when last subscriber unsubscribes.
|
|
31
|
+
# yarn
|
|
32
|
+
yarn global add @deepseekcode/cli
|
|
41
33
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
# bun
|
|
35
|
+
bun add -g @deepseekcode/cli
|
|
36
|
+
```
|
|
45
37
|
|
|
46
|
-
|
|
47
|
-
- `onComputeLayout` tracks a `layoutVersion` counter; if no DOM mutations happened since last computation, `calculateLayout()` (the most expensive per-frame operation) is skipped entirely.
|
|
38
|
+
This installs two commands: **`dscode`** (short) and **`deepseekcode`** (full name).
|
|
48
39
|
|
|
49
|
-
|
|
50
|
-
- Interaction hooks (mouse wheel, text selection, keyboard selection, message navigation) only mount after `connected === true`.
|
|
51
|
-
- Startup state updates are batched into a single `updateAppState()` call (from 3-5 sequential calls).
|
|
40
|
+
## Quick Start
|
|
52
41
|
|
|
53
|
-
|
|
42
|
+
```bash
|
|
43
|
+
dscode
|
|
44
|
+
```
|
|
54
45
|
|
|
55
|
-
The CLI
|
|
46
|
+
That's it. The CLI starts the local agent runtime and opens the interactive terminal. On first run (no provider configured) it prints a link to the web UI where you can set up your LLM provider and model:
|
|
56
47
|
|
|
57
|
-
|
|
48
|
+
```bash
|
|
49
|
+
# model/provider setup page (also served by the CLI)
|
|
50
|
+
# → http://localhost:8080/#models
|
|
51
|
+
```
|
|
58
52
|
|
|
59
|
-
|
|
60
|
-
|-------|-----------|-------|
|
|
61
|
-
| Dark (default) | `dark` | ANSI named colors, broad compat |
|
|
62
|
-
| Light | `light` | Light terminal variant |
|
|
63
|
-
| Nord | `nord` | ❄️ Arctic blue-grey palette |
|
|
64
|
-
| Dracula | `dracula` | 🧛 Dark purple-vibrant |
|
|
65
|
-
| Monokai | `monokai` | 🎨 Classic code editor |
|
|
66
|
-
| One Dark | `one-dark` | 🌙 Atom's iconic dark |
|
|
67
|
-
| Tokyo Night | `tokyo-night` | 🌃 Deep navy + vibrant accents |
|
|
53
|
+
If your terminal's stdin isn't a TTY (e.g. a script or CI pipeline), the CLI skips the TUI and runs **headless** — the web UI stays available at the printed URL.
|
|
68
54
|
|
|
69
|
-
|
|
55
|
+
Connect to an **existing** backend instead of starting a local one:
|
|
70
56
|
|
|
71
57
|
```bash
|
|
72
|
-
|
|
73
|
-
DEEPSEEKCODE_THEME=nord node packages/cli/dist/cli.js run
|
|
74
|
-
DEEPSEEKCODE_THEME=dracula node packages/cli/dist/cli.js start
|
|
75
|
-
DEEPSEEKCODE_THEME=/path/to/my-theme.json node packages/cli/dist/cli.js run
|
|
76
|
-
|
|
77
|
-
# Custom color overrides (partial merge on current theme)
|
|
78
|
-
DEEPSEEKCODE_THEME_COLORS='{"primary":"#ff0000"}' node packages/cli/dist/cli.js run
|
|
58
|
+
dscode run --backend http://localhost:8080
|
|
79
59
|
```
|
|
80
60
|
|
|
81
|
-
|
|
61
|
+
Resume your last session (or a specific one):
|
|
82
62
|
|
|
83
|
-
```
|
|
84
|
-
|
|
63
|
+
```bash
|
|
64
|
+
dscode --resume # last session
|
|
65
|
+
dscode --resume <id> # specific session
|
|
66
|
+
```
|
|
85
67
|
|
|
86
|
-
|
|
87
|
-
<Text color={t.primary}>Brand</Text>
|
|
88
|
-
<Text color={t.error}>Error</Text>
|
|
89
|
-
<Text backgroundColor={t.success}>Success</Text>
|
|
68
|
+
## CLI Commands
|
|
90
69
|
|
|
91
|
-
|
|
92
|
-
|
|
70
|
+
| Command | Description |
|
|
71
|
+
|---------|-------------|
|
|
72
|
+
| `dscode` / `dscode start` | Start local runtime + interactive TUI (also serves Web UI + API) |
|
|
73
|
+
| `dscode start --auto` | Start with auto-approval mode enabled |
|
|
74
|
+
| `dscode run --backend URL` | Connect to an existing backend instead of starting one |
|
|
75
|
+
| `dscode exec <command>` | Execute a command non-interactively (JSONL output) |
|
|
76
|
+
| `dscode exec --file <path>` | Read the command from a file |
|
|
77
|
+
| `dscode codeview` | AI code review — bugs + unwired features (JSON output) |
|
|
78
|
+
| `dscode review` | Review current code changes (legacy) |
|
|
79
|
+
| `dscode test-fix` | Run the auto-fix test loop |
|
|
80
|
+
| `dscode --resume [id]` | Resume the last session, or a specific one |
|
|
81
|
+
| `dscode version` | Print version |
|
|
93
82
|
|
|
94
|
-
|
|
95
|
-
registerTheme('my-theme', { primary: '#ff6600', bg: '#1a1a2e', ... })
|
|
96
|
-
setTheme('my-theme')
|
|
83
|
+
Run `dscode --help` (or `-h`) for the full list.
|
|
97
84
|
|
|
98
|
-
|
|
99
|
-
listThemes() // ['dark', 'dracula', 'light', 'monokai', ...]
|
|
100
|
-
```
|
|
85
|
+
### Non-interactive examples
|
|
101
86
|
|
|
102
|
-
|
|
87
|
+
```bash
|
|
88
|
+
# Execute a command, get JSONL results
|
|
89
|
+
dscode exec "fix the failing test in src/utils"
|
|
103
90
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
├── types.ts # ThemeColors interface (60+ color keys)
|
|
107
|
-
├── registry.ts # Theme registry + t Proxy
|
|
108
|
-
├── detect.ts # Terminal background detection (OSC 11)
|
|
109
|
-
├── loader.ts # JSON theme file loader
|
|
110
|
-
└── builtins/ # Built-in theme factories
|
|
111
|
-
├── index.ts, dark.ts, light.ts,
|
|
112
|
-
├── nord.ts, dracula.ts, monokai.ts,
|
|
113
|
-
├── one-dark.ts, tokyo-night.ts
|
|
114
|
-
```
|
|
91
|
+
# Plain text output, command from file
|
|
92
|
+
dscode exec --file ./task.txt --text
|
|
115
93
|
|
|
116
|
-
|
|
94
|
+
# AI code review focused on security, write report to file
|
|
95
|
+
dscode codeview --focus security --output review.json
|
|
117
96
|
|
|
118
|
-
|
|
97
|
+
# Auto-fix test loop (max 5 retries, analyze only)
|
|
98
|
+
dscode test-fix --packages packages/cli --retries 5 --dry-run
|
|
99
|
+
```
|
|
119
100
|
|
|
120
|
-
|
|
101
|
+
## Interactive Commands
|
|
102
|
+
|
|
103
|
+
Inside the TUI, use `/help` for the full list (most commands have Chinese aliases). Highlights:
|
|
104
|
+
|
|
105
|
+
| Command | Action |
|
|
106
|
+
|---------|--------|
|
|
107
|
+
| `/help` | Show all commands |
|
|
108
|
+
| `/model [name]` | Open model picker or switch model directly |
|
|
109
|
+
| `/theme [name]` | Show or change terminal theme |
|
|
110
|
+
| `/plan` | Toggle plan mode (review before executing) |
|
|
111
|
+
| `/auto` | Toggle auto-approval mode |
|
|
112
|
+
| `/mode <mode>` | Cycle/set mode: act · auto-act · plan · auto-plan · goal · auto-goal |
|
|
113
|
+
| `/goal` | Set goal-directed mode |
|
|
114
|
+
| `/thinking` | Toggle think mode on/off |
|
|
115
|
+
| `/context` | Show current conversation state |
|
|
116
|
+
| `/sessions [id]` / `/resume [id]` | List history / switch session |
|
|
117
|
+
| `/tasks` | Toggle sub-task output panel |
|
|
118
|
+
| `/undo [list]` | Undo the most recent file change |
|
|
119
|
+
| `/clear` | Clear local conversation messages |
|
|
120
|
+
| `/mcp <action>` | Manage MCP servers |
|
|
121
|
+
| `/skills` | Insert a skill |
|
|
122
|
+
| `/trace <traceId>` | Query a trace by id |
|
|
123
|
+
| `/stop` `/pause` `/continue` | Control AI generation |
|
|
124
|
+
| `/exit` | Exit |
|
|
125
|
+
|
|
126
|
+
## Options
|
|
127
|
+
|
|
128
|
+
| Option | Description |
|
|
129
|
+
|--------|-------------|
|
|
130
|
+
| `-p, --port <port>` | HTTP port (default: first available from 8080) |
|
|
131
|
+
| `--ws-port <port>` | WebSocket port (default: HTTP port + 1) |
|
|
132
|
+
| `-w, --workspace <dir>` | Workspace directory (default: current directory) |
|
|
133
|
+
| `-F, --force` | Kill an existing process on the target port before starting |
|
|
134
|
+
| `-b, --backend <url>` | Backend URL for `run` mode |
|
|
135
|
+
| `--ws <url>` | Override WebSocket URL |
|
|
136
|
+
| `--provider <name>` | Provider to use (exec/review) |
|
|
137
|
+
| `--model <name>` | Model to use (exec/review) |
|
|
138
|
+
| `--theme <name\|path>` | Theme name or JSON theme file path |
|
|
139
|
+
| `--prompt-version <ver>` | Prompt template version |
|
|
140
|
+
| `--timeout <ms>` | Per-attempt LLM timeout (default: 300000 = 5 min) |
|
|
141
|
+
| `--stall-threshold <ms>` | Stream stall detection threshold (default: 240000 = 4 min) |
|
|
142
|
+
| `--no-update-check` | Disable the startup new-version notice |
|
|
143
|
+
| `--no-auto-update` | Disable background auto-update (notice still shown) |
|
|
144
|
+
|
|
145
|
+
## Configuration
|
|
146
|
+
|
|
147
|
+
The CLI reads `~/.agent/config.yaml`:
|
|
121
148
|
|
|
122
149
|
```yaml
|
|
123
150
|
backend_url: http://localhost:8080
|
|
@@ -125,20 +152,53 @@ ws_url: ws://localhost:8081/ws
|
|
|
125
152
|
workspace_dir: /path/to/workspace
|
|
126
153
|
```
|
|
127
154
|
|
|
128
|
-
|
|
155
|
+
Provider / model settings are managed through the web UI at `http://localhost:8080/#models`.
|
|
129
156
|
|
|
130
|
-
|
|
131
|
-
默认会在**后台自动重装全局包**(`npm install -g @deepseekcode/cli@latest`),
|
|
132
|
-
新版本在下次启动时生效,升级结果会在下一次启动时报告。
|
|
157
|
+
## Themes
|
|
133
158
|
|
|
134
|
-
|
|
135
|
-
- 关闭自动安装(保留版本提示):`DEEPSEEKCODE_NO_AUTO_UPDATE=1` 或 `--no-auto-update`
|
|
136
|
-
- 连版本检查一起关闭:`DEEPSEEKCODE_NO_UPDATE_CHECK=1` 或 `--no-update-check`
|
|
159
|
+
Set the theme at startup via the `DEEPSEEKCODE_THEME` env var (or `--theme`):
|
|
137
160
|
|
|
138
|
-
|
|
161
|
+
| Theme | Env Value | Style |
|
|
162
|
+
|-------|-----------|-------|
|
|
163
|
+
| Dark (default) | `dark` | ANSI named colors, broad compat |
|
|
164
|
+
| Light | `light` | Light terminal variant |
|
|
165
|
+
| Nord | `nord` | Arctic blue-grey palette |
|
|
166
|
+
| Dracula | `dracula` | Dark purple-vibrant |
|
|
167
|
+
| Monokai | `monokai` | Classic code editor |
|
|
168
|
+
| One Dark | `one-dark` | Atom's iconic dark |
|
|
169
|
+
| Tokyo Night | `tokyo-night` | Deep navy + vibrant accents |
|
|
139
170
|
|
|
140
171
|
```bash
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
172
|
+
DEEPSEEKCODE_THEME=nord dscode
|
|
173
|
+
DEEPSEEKCODE_THEME=/path/to/my-theme.json dscode
|
|
174
|
+
|
|
175
|
+
# Partial overrides on the current theme (JSON)
|
|
176
|
+
DEEPSEEKCODE_THEME_COLORS='{"primary":"#ff0000"}' dscode
|
|
144
177
|
```
|
|
178
|
+
|
|
179
|
+
Switch themes at runtime with `/theme [name]`.
|
|
180
|
+
|
|
181
|
+
## Auto-Update
|
|
182
|
+
|
|
183
|
+
On startup, `dscode` checks npm for the latest version asynchronously (non-blocking). When a newer version is found, the CLI **automatically reinstalls the global package** in the background (`npm install -g @deepseekcode/cli@latest`); the new version takes effect on the next launch.
|
|
184
|
+
|
|
185
|
+
- Only affects **global npm installs** — source builds and `npx`/`bunx` caches are never touched.
|
|
186
|
+
- Disable auto-install (keep the version notice): `DEEPSEEKCODE_NO_AUTO_UPDATE=1` or `--no-auto-update`
|
|
187
|
+
- Disable the check entirely: `DEEPSEEKCODE_NO_UPDATE_CHECK=1` or `--no-update-check`
|
|
188
|
+
|
|
189
|
+
## Environment Variables
|
|
190
|
+
|
|
191
|
+
| Variable | Description |
|
|
192
|
+
|----------|-------------|
|
|
193
|
+
| `DEEPSEEKCODE_THEME` | Theme name or JSON theme file |
|
|
194
|
+
| `DEEPSEEKCODE_THEME_COLORS` | JSON partial color overrides |
|
|
195
|
+
| `DEEPSEEKCODE_HTTP_PORT` / `DEEPSEEKCODE_WS_PORT` | Default HTTP / WebSocket ports |
|
|
196
|
+
| `DEEPSEEKCODE_QUIET=1` | Suppress non-fatal startup warnings |
|
|
197
|
+
| `DEEPSEEKCODE_NO_AUTO_UPDATE=1` | Disable background auto-update |
|
|
198
|
+
| `DEEPSEEKCODE_NO_UPDATE_CHECK=1` | Disable the version check |
|
|
199
|
+
| `DEEPSEEKCODE_FORCE_UTF8=0` | Skip forcing the Windows console to UTF-8 |
|
|
200
|
+
| `DSC_HEAP_LIMIT_MB` | Node heap limit hint for large sessions (default: 8192) |
|
|
201
|
+
|
|
202
|
+
## License
|
|
203
|
+
|
|
204
|
+
[Apache-2.0](https://www.npmjs.com/package/@deepseekcode/cli)
|