@jwcode/cli
v1.0.37
Published
DeepSeekCode TypeScript CLI
Downloads
230
Readme
@deepseekcode/cli
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 (React-for-terminal) interface in your terminal, and serves a companion web UI you can use for configuration and remote access.
- TUI — interactive, keyboard-first coding agent in your terminal
- Local runtime — spins up an in-process server (HTTP + WebSocket), no separate install needed
- Web UI — configuration & model management at
http://localhost:8080 - Non-interactive modes —
exec,codeview,test-fixfor scripts & CI - Multi-theme — dark / light / nord / dracula / monokai / one-dark / tokyo-night
Requires Node.js >= 18.
Install
npm install -g @deepseekcode/cliOr with your favorite package manager:
# pnpm
pnpm add -g @deepseekcode/cli
# yarn
yarn global add @deepseekcode/cli
# bun
bun add -g @deepseekcode/cliThis installs two commands: dscode (short) and deepseekcode (full name).
Quick Start
dscodeThat'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:
# model/provider setup page (also served by the CLI)
# → http://localhost:8080/#modelsIf 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.
Connect to an existing backend instead of starting a local one:
dscode run --backend http://localhost:8080Resume your last session (or a specific one):
dscode --resume # last session
dscode --resume <id> # specific sessionCLI Commands
| Command | Description |
|---------|-------------|
| dscode / dscode start | Start local runtime + interactive TUI (also serves Web UI + API) |
| dscode start --auto | Start with auto-approval mode enabled |
| dscode run --backend URL | Connect to an existing backend instead of starting one |
| dscode exec <command> | Execute a command non-interactively (JSONL output) |
| dscode exec --file <path> | Read the command from a file |
| dscode codeview | AI code review — bugs + unwired features (JSON output) |
| dscode review | Review current code changes (legacy) |
| dscode test-fix | Run the auto-fix test loop |
| dscode --resume [id] | Resume the last session, or a specific one |
| dscode version | Print version |
Run dscode --help (or -h) for the full list.
Non-interactive examples
# Execute a command, get JSONL results
dscode exec "fix the failing test in src/utils"
# Plain text output, command from file
dscode exec --file ./task.txt --text
# AI code review focused on security, write report to file
dscode codeview --focus security --output review.json
# Auto-fix test loop (max 5 retries, analyze only)
dscode test-fix --packages packages/cli --retries 5 --dry-runInteractive Commands
Inside the TUI, use /help for the full list (most commands have Chinese aliases). Highlights:
| Command | Action |
|---------|--------|
| /help | Show all commands |
| /model [name] | Open model picker or switch model directly |
| /theme [name] | Show or change terminal theme |
| /plan | Toggle plan mode (review before executing) |
| /auto | Toggle auto-approval mode |
| /mode <mode> | Cycle/set mode: act · auto-act · plan · auto-plan · goal · auto-goal |
| /goal | Set goal-directed mode |
| /thinking | Toggle think mode on/off |
| /context | Show current conversation state |
| /sessions [id] / /resume [id] | List history / switch session |
| /tasks | Toggle sub-task output panel |
| /undo [list] | Undo the most recent file change |
| /clear | Start a new session (current session is saved, resumable via /sessions) |
| /mcp <action> | Manage MCP servers |
| /skills | Insert a skill |
| /trace <traceId> | Query a trace by id |
| /stop /pause /continue | Control AI generation |
| /exit | Exit |
Options
| Option | Description |
|--------|-------------|
| -p, --port <port> | HTTP port (default: first available from 8080) |
| --ws-port <port> | WebSocket port (default: HTTP port + 1) |
| -w, --workspace <dir> | Workspace directory (default: current directory) |
| -F, --force | Kill an existing process on the target port before starting |
| -b, --backend <url> | Backend URL for run mode |
| --ws <url> | Override WebSocket URL |
| --provider <name> | Provider to use (exec/review) |
| --model <name> | Model to use (exec/review) |
| --theme <name\|path> | Theme name or JSON theme file path |
| --prompt-version <ver> | Prompt template version |
| --timeout <ms> | Per-attempt LLM timeout (default: 300000 = 5 min) |
| --stall-threshold <ms> | Stream stall detection threshold (default: 240000 = 4 min) |
| --no-update-check | Disable the startup new-version notice |
| --no-auto-update | Disable background auto-update (notice still shown) |
Configuration
The CLI reads ~/.agent/config.yaml:
backend_url: http://localhost:8080
ws_url: ws://localhost:8081/ws
workspace_dir: /path/to/workspaceProvider / model settings are managed through the web UI at http://localhost:8080/#models.
Themes
Set the theme at startup via the DEEPSEEKCODE_THEME env var (or --theme):
| Theme | Env Value | Style |
|-------|-----------|-------|
| Dark (default) | dark | ANSI named colors, broad compat |
| Light | light | Light terminal variant |
| Nord | nord | Arctic blue-grey palette |
| Dracula | dracula | Dark purple-vibrant |
| Monokai | monokai | Classic code editor |
| One Dark | one-dark | Atom's iconic dark |
| Tokyo Night | tokyo-night | Deep navy + vibrant accents |
DEEPSEEKCODE_THEME=nord dscode
DEEPSEEKCODE_THEME=/path/to/my-theme.json dscode
# Partial overrides on the current theme (JSON)
DEEPSEEKCODE_THEME_COLORS='{"primary":"#ff0000"}' dscodeSwitch themes at runtime with /theme [name].
Auto-Update
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.
- Only affects global npm installs — source builds and
npx/bunxcaches are never touched. - Disable auto-install (keep the version notice):
DEEPSEEKCODE_NO_AUTO_UPDATE=1or--no-auto-update - Disable the check entirely:
DEEPSEEKCODE_NO_UPDATE_CHECK=1or--no-update-check
Environment Variables
| Variable | Description |
|----------|-------------|
| DEEPSEEKCODE_THEME | Theme name or JSON theme file |
| DEEPSEEKCODE_THEME_COLORS | JSON partial color overrides |
| DEEPSEEKCODE_HTTP_PORT / DEEPSEEKCODE_WS_PORT | Default HTTP / WebSocket ports |
| DEEPSEEKCODE_QUIET=1 | Suppress non-fatal startup warnings |
| DEEPSEEKCODE_NO_AUTO_UPDATE=1 | Disable background auto-update |
| DEEPSEEKCODE_NO_UPDATE_CHECK=1 | Disable the version check |
| DEEPSEEKCODE_FORCE_UTF8=0 | Skip forcing the Windows console to UTF-8 |
| DSC_HEAP_LIMIT_MB | Node heap limit hint for large sessions (default: 8192) |
Terminal Verdict Figures
The terminal_figure tool and the Web UI's terminal-verdict button replay captured ANSI bytes through xterm.js and Playwright, then compose a PNG with Python Pillow.
The published package includes the replay/composition scripts and declares its Node dependencies. The host still needs:
- a Python interpreter with Pillow installed;
- a Playwright Chromium browser (
npx playwright install chromiumor the equivalent for your package manager).
If either prerequisite is unavailable, the feature returns an actionable setup error and does not silently write outside the workspace. Capture remains a separate CLI/TUI step because it depends on the specific interface under test.
License
Proprietary — © 2026 DeepSeekCode. All rights reserved.
This software is proprietary and closed source; it is not open source. Copying, modifying, distributing, sublicensing, or selling it requires the prior written permission of the copyright holder.
See LICENSE.md for the full terms.
