logo
0
0
WeChat Login
docs(install): add download safety verification

DeepSeek TUI

Terminal coding agent for DeepSeek V4. It runs from the deepseek command, streams reasoning blocks, edits local workspaces with approval gates, and includes an auto mode that chooses both model and thinking level per turn.

简体中文 README 日本語 README

Install

deepseek is distributed as Rust binaries: the dispatcher command (deepseek) and the companion TUI runtime (deepseek-tui). Pick whichever install path you already use; they all put the same commands on your PATH. The npm package is an installer/wrapper for the release binaries, not the agent runtime itself.

# 1. npm — easiest if you already use Node. The package downloads the
#    matching prebuilt Rust binaries from GitHub Releases.
npm install -g deepseek-tui

# 2. Cargo — no Node needed.
cargo install deepseek-tui-cli --locked   # `deepseek` (entry point)
cargo install deepseek-tui     --locked   # `deepseek-tui` (TUI binary)

# 3. Homebrew — macOS package manager.
brew tap Hmbown/deepseek-tui
brew install deepseek-tui

# 4. Direct download — no package manager or toolchain.
#    https://github.com/Hmbown/DeepSeek-TUI/releases
#    Prebuilt for Linux x64/ARM64, macOS x64/ARM64, Windows x64.

# 5. Docker — prebuilt release image.
docker run --rm -it \
  -e DEEPSEEK_API_KEY \
  -v "$PWD:/workspace" \
  ghcr.io/hmbown/deepseek-tui:latest

In mainland China, speed up the npm path with --registry=https://registry.npmmirror.com, or use the Cargo mirror below.

Download safety: official release binaries live under https://github.com/Hmbown/DeepSeek-TUI/releases. For manual downloads, verify the SHA-256 manifest and avoid look-alike repositories or search-result mirrors. See download safety and checksums.

CI npm crates.io DeepWiki project index

DeepSeek TUI screenshot


What Is It?

DeepSeek TUI is a coding agent that runs in your terminal. It can read and edit files, run shell commands, search the web, manage git, and coordinate sub-agents from a keyboard-driven TUI.

It is built around DeepSeek V4 (deepseek-v4-pro / deepseek-v4-flash), including 1M-token context windows, streaming reasoning blocks, and prefix-cache-aware cost reporting.

Key Features

  • Auto mode--model auto / /model auto chooses both the model and thinking level for each turn
  • Thinking-mode streaming — see DeepSeek reasoning blocks as the model works
  • Full tool suite — file ops, shell execution, git, web search/browse, apply-patch, sub-agents, MCP servers
  • 1M-token context — context tracking, manual or configured compaction, and prefix-cache telemetry
  • Prefix-cache stability tracking — a footer chip surfaces how stable the cached prefix has been across recent turns so cost-busting edits are visible before they land
  • Three modes — Plan (read-only explore), Agent (interactive with approval), YOLO (auto-approved)
  • Reasoning-effort tiers — cycle through off → high → max with Shift + Tab
  • Session save/resume — checkpoint and resume long-running sessions
  • Workspace rollback — side-git pre/post-turn snapshots with /restore and revert_turn, without touching your repo's .git
  • OS-level sandbox — Seatbelt on macOS, Landlock on Linux, Job Objects on Windows; shell commands run with workspace-scoped filesystem access only
  • Durable task queue — background tasks can survive restarts
  • HTTP/SSE runtime APIdeepseek serve --http for headless agent workflows
  • MCP protocol — connect to Model Context Protocol servers for extended tooling; please see docs/MCP.md
  • Native RLM (rlm_open/rlm_eval) — persistent REPL sessions for batched analysis; run cheap deepseek-v4-flash children with bounded helpers like peek, search, chunk, and sub_query_batch
  • LSP diagnostics — inline error/warning surfacing after every edit via rust-analyzer, pyright, typescript-language-server, gopls, clangd
  • User memory — optional persistent note file injected into the system prompt for cross-session preferences
  • Localized UIen, ja, zh-Hans, pt-BR with auto-detection
  • Live cost tracking — per-turn and session-level token usage and cost estimates; cache hit/miss breakdown; CNY display when the session locale is zh-Hans
  • Skills system — composable, installable instruction packs from GitHub; ships with a bundled starter set (skill-creator, mcp-builder, plugin-creator, v4-best-practices, documents, presentations, spreadsheets, pdf, feishu, skill-installer, delegate) so /skills is useful from first launch
  • Terminal-native notifications — OSC 9 (iTerm2/WezTerm/Ghostty), OSC 99 (Kitty), OSC 777 (Ghostty), plus desktop notification fallback
  • Built-in theme picker — Catppuccin, Tokyo Night, Dracula, Gruvbox alongside the original light/dark palettes; switch live with /theme

How It's Wired

deepseek (dispatcher CLI) → deepseek-tui (companion binary) → ratatui interface ↔ async engine ↔ OpenAI-compatible streaming client. Tool calls route through a typed registry (shell, file ops, git, web, sub-agents, MCP, RLM) and results stream back into the transcript. The engine manages session state, turn tracking, the durable task queue, and an LSP subsystem that feeds post-edit diagnostics into the model's context before the next reasoning step.

See docs/ARCHITECTURE.md for the full walkthrough.

Sub-agents: Concurrent Background Execution

DeepSeek TUI can dispatch multiple sub-agents that run in parallel — like a concurrent task queue:

  • Non-blocking launch. agent_open returns immediately. The child gets its own fresh context and tool registry and runs independently. The parent keeps working.
  • Background execution. Sub-agents execute concurrently (default cap: 10, configurable to 20). The engine manages the pool — no polling loop needed.
  • Completion notification. When a sub-agent finishes, the runtime delivers a structured <deepseek:subagent.done> event with a summary, evidence list, and execution metrics. The parent model reads the summary field and integrates findings.
  • Bounded result retrieval. Large transcripts are parked behind var_handle references. The model calls handle_read for slices, ranges, or JSONPath projections — keeping the parent context lean.

See docs/SUBAGENTS.md for the full sub-agent reference.


Quickstart

npm install -g deepseek-tui
deepseek --version
deepseek --model auto

Prebuilt binaries are published for Linux x64, Linux ARM64 (v0.8.8+), macOS x64, macOS ARM64, and Windows x64. For other targets (musl, riscv64, FreeBSD, etc.), see Install from source or docs/INSTALL.md.

On first launch you'll be prompted for your DeepSeek API key. The key is saved to ~/.deepseek/config.toml so it works from any directory without OS credential prompts.

You can also set it ahead of time:

deepseek auth set --provider deepseek   # saves to ~/.deepseek/config.toml
deepseek auth status                    # shows the active credential source

export DEEPSEEK_API_KEY="YOUR_KEY"      # env var alternative; use ~/.zshenv for non-interactive shells
deepseek

deepseek doctor                         # verify setup

If deepseek doctor says the rejected key came from DEEPSEEK_API_KEY, remove the stale export from your shell startup file, open a fresh shell, or run deepseek auth set --provider deepseek. Use deepseek auth status to see the config, keyring, and env-var source state without printing the key. Saved config keys take precedence over the keyring and environment and are easier to rotate.

To rotate or remove a saved key: deepseek auth clear --provider deepseek.

Auto Mode

Use deepseek --model auto or /model auto when you want DeepSeek TUI to decide how much model and reasoning power a turn needs.

Auto mode controls two settings together:

  • Model: deepseek-v4-flash or deepseek-v4-pro
  • Thinking: off, high, or max

Before the real turn is sent, the app makes a small deepseek-v4-flash routing call with thinking off. That router looks at the latest request and recent context, then selects a concrete model and thinking level for the real request. Short/simple turns can stay on Flash with thinking off; coding, debugging, release work, architecture, security review, or ambiguous multi-step tasks can move up to Pro and/or higher thinking.

auto is local to DeepSeek TUI. The upstream API never receives model: "auto"; it receives the concrete model and thinking setting chosen for that turn. The TUI shows the selected route, and cost tracking is charged against the model that actually ran. If the router call fails or returns an invalid answer, the app falls back to a local heuristic. Sub-agents inherit auto mode unless you assign them an explicit model.

Use a fixed model or fixed thinking level when you want repeatable benchmarking, a strict cost ceiling, or a specific provider/model mapping.

Linux ARM64 (Raspberry Pi, Asahi, Graviton, HarmonyOS PC)

npm i -g deepseek-tui works on glibc-based ARM64 Linux from v0.8.8 onward. You can also download prebuilt binaries from the Releases page and place them side by side on your PATH.

China / Mirror-friendly Installation

If GitHub or npm downloads are slow from mainland China, use a Cargo registry mirror:

# ~/.cargo/config.toml
[source.crates-io]
replace-with = "tuna"

[source.tuna]
registry = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"

Then install both binaries (the dispatcher delegates to the TUI at runtime):

cargo install deepseek-tui-cli --locked   # provides `deepseek`
cargo install deepseek-tui     --locked   # provides `deepseek-tui`
deepseek --version

Prebuilt binaries can also be downloaded from GitHub Releases. Use DEEPSEEK_TUI_RELEASE_BASE_URL for mirrored release assets.

Windows (Scoop)

Scoop is a Windows package manager. DeepSeek TUI is listed in Scoop's main bucket, but that manifest updates independently and can lag the GitHub/npm/Cargo release. Run scoop update first, then verify the installed version with deepseek --version:

scoop update
scoop install deepseek-tui
deepseek --version

Use npm or direct GitHub release downloads when you need the newest release before Scoop's manifest catches up.

Install from source

Works on any Tier-1 Rust target — including musl, riscv64, FreeBSD, and older ARM64 distros.

# Linux build deps (Debian/Ubuntu/RHEL):
#   sudo apt-get install -y build-essential pkg-config libdbus-1-dev
#   sudo dnf install -y gcc make pkgconf-pkg-config dbus-devel

git clone https://github.com/Hmbown/DeepSeek-TUI.git
cd DeepSeek-TUI

cargo install --path crates/cli --locked   # requires Rust 1.88+; provides `deepseek`
cargo install --path crates/tui --locked   # provides `deepseek-tui`

Both binaries are required. Cross-compilation and platform-specific notes: docs/INSTALL.md.

Other API Providers

# NVIDIA NIM
deepseek auth set --provider nvidia-nim --api-key "YOUR_NVIDIA_API_KEY"
deepseek --provider nvidia-nim

# Fireworks
deepseek auth set --provider fireworks --api-key "YOUR_FIREWORKS_API_KEY"
deepseek --provider fireworks --model deepseek-v4-pro

# Generic OpenAI-compatible endpoint
deepseek auth set --provider openai --api-key "YOUR_OPENAI_COMPATIBLE_API_KEY"
OPENAI_BASE_URL="https://openai-compatible.example/v4" deepseek --provider openai --model glm-5

# Self-hosted SGLang
SGLANG_BASE_URL="http://localhost:30000/v1" deepseek --provider sglang --model deepseek-v4-flash

# Self-hosted vLLM
VLLM_BASE_URL="http://localhost:8000/v1" deepseek --provider vllm --model deepseek-v4-flash

# Self-hosted Ollama
ollama pull deepseek-coder:1.3b
deepseek --provider ollama --model deepseek-coder:1.3b

What's New In v0.8.35

A post-release cleanup branch for the v0.8.34 line. It keeps the model-facing surface stable while trimming first-turn context, clarifying context-pressure behavior, and reducing sidebar noise during long runs. Full changelog.

  • First-turn context is leaner. Hidden tool/cache state is excluded from the generated project pack, and /context now names prompt layers instead of showing one opaque blob.
  • Prompt rules are de-conflicted. Useful deepseek diagnostics are allowed, simple one-step work no longer forces checklist ceremony, and sustained sessions consistently suggest /compact around 60%.
  • Automatic compaction stays conservative. The 80% threshold remains an opt-in hard guardrail so DeepSeek V4 prefix-cache behavior is not disturbed by default.
  • The Tasks sidebar settles down. Completed live-tool rows expire after a short linger, and very old running shell rows collapse instead of filling the right rail.
  • auto_compact help is honest. Settings now report the real default: off.

Usage

deepseek                                         # interactive TUI
deepseek "explain this function"                 # one-shot prompt
deepseek exec --auto --output-format stream-json "fix this bug"  # NDJSON backend stream
deepseek exec --resume <SESSION_ID> "follow up"  # continue a non-interactive session
deepseek --model deepseek-v4-flash "summarize"   # model override
deepseek --model auto "fix this bug"             # auto-select model + thinking
deepseek --yolo                                  # auto-approve tools
deepseek auth set --provider deepseek            # save API key
deepseek doctor                                  # check setup & connectivity
deepseek doctor --json                           # machine-readable diagnostics
deepseek setup --status                          # read-only setup status
deepseek setup --tools --plugins                 # scaffold tool/plugin dirs
deepseek models                                  # list live API models
deepseek sessions                                # list saved sessions
deepseek resume --last                           # resume the most recent session in this workspace
deepseek resume <SESSION_ID>                     # resume a specific session by UUID
deepseek fork <SESSION_ID>                       # fork a session at a chosen turn
deepseek serve --http                            # HTTP/SSE API server
deepseek serve --acp                             # ACP stdio adapter for Zed/custom agents
deepseek run pr <N>                              # fetch PR and pre-seed review prompt
deepseek mcp list                                # list configured MCP servers
deepseek mcp validate                            # validate MCP config/connectivity
deepseek mcp-server                              # run dispatcher MCP stdio server
deepseek update                                  # check for and apply binary updates

Docker images are published to GHCR for release builds:

docker volume create deepseek-tui-home

docker run --rm -it \
  -e DEEPSEEK_API_KEY="$DEEPSEEK_API_KEY" \
  -v deepseek-tui-home:/home/deepseek/.deepseek \
  ghcr.io/hmbown/deepseek-tui:latest

Zed / ACP

DeepSeek can run as a custom Agent Client Protocol server for editors that spawn local ACP agents over stdio. In Zed, add a custom agent server:

{
  "agent_servers": {
    "DeepSeek": {
      "type": "custom",
      "command": "deepseek",
      "args": ["serve", "--acp"],
      "env": {}
    }
  }
}

The first ACP slice supports new sessions and prompt responses through your existing DeepSeek config/API key. Tool-backed editing and checkpoint replay are not exposed through ACP yet.

Community-maintained adapter: acp-deepseek-adapter bridges deepseek exec --auto to cc-connect for users who need tool-backed ACP workflows outside the built-in Zed slice.

Keyboard Shortcuts

KeyAction
TabComplete / or @ entries; while running, queue draft as follow-up; otherwise cycle mode
Shift+TabCycle reasoning-effort: off → high → max
F1Searchable help overlay
EscBack / dismiss
Ctrl+KCommand palette
Ctrl+RResume an earlier session
Alt+RSearch prompt history and recover cleared drafts
Ctrl+SStash current draft (/stash list, /stash pop to recover)
@pathAttach file/directory context in composer
(at composer start)Select attachment row for removal

Full shortcut catalog: docs/KEYBINDINGS.md.


Modes

ModeBehavior
Plan 🔍Read-only investigation — model explores and proposes a plan before making changes; multi-step investigations use checklist_write
Agent 🤖Default interactive mode — multi-step tool use with approval gates; substantial work is tracked with checklist_write
YOLOAuto-approve all tools in a trusted workspace; multi-step work still keeps a visible checklist

Configuration

User config: ~/.deepseek/config.toml. Project overlay: <workspace>/.deepseek/config.toml (denied: api_key, base_url, provider, mcp_config_path). config.example.toml has every option.

Key environment variables:

VariablePurpose
DEEPSEEK_API_KEYAPI key
DEEPSEEK_BASE_URLAPI base URL
DEEPSEEK_HTTP_HEADERSOptional custom model request headers, e.g. X-Model-Provider-Id=your-model-provider
DEEPSEEK_MODELDefault model
DEEPSEEK_STREAM_IDLE_TIMEOUT_SECSStream idle timeout in seconds, default 300, clamped to 1..=3600
DEEPSEEK_PROVIDERdeepseek (default), nvidia-nim, openai, openrouter, novita, fireworks, sglang, vllm, ollama
DEEPSEEK_PROFILEConfig profile name
DEEPSEEK_MEMORYSet to on to enable user memory
DEEPSEEK_ALLOW_INSECURE_HTTP=1Allow non-local http:// API base URLs on trusted networks
NVIDIA_API_KEY / OPENAI_API_KEY / OPENROUTER_API_KEY / NOVITA_API_KEY / FIREWORKS_API_KEY / SGLANG_API_KEY / VLLM_API_KEY / OLLAMA_API_KEYProvider auth
OPENAI_BASE_URL / OPENAI_MODELGeneric OpenAI-compatible endpoint and model ID
SGLANG_BASE_URLSelf-hosted SGLang endpoint
VLLM_BASE_URLSelf-hosted vLLM endpoint
OLLAMA_BASE_URLSelf-hosted Ollama endpoint
OLLAMA_MODELSelf-hosted Ollama model tag
NO_ANIMATIONS=1Force accessibility mode at startup
SSL_CERT_FILECustom CA bundle for corporate proxies

Set locale in settings.toml, use /config locale zh-Hans, or rely on LC_ALL/LANG to choose UI chrome and the fallback language sent to V4 models. The latest user message still wins for natural-language reasoning and replies, so Chinese user turns stay Chinese even on an English system locale. See docs/CONFIGURATION.md and docs/MCP.md.


Models & Pricing

ModelContextInput (cache hit)Input (cache miss)Output
deepseek-v4-pro1M$0.003625 / 1M*$0.435 / 1M*$0.87 / 1M*
deepseek-v4-flash1M$0.0028 / 1M$0.14 / 1M$0.28 / 1M

DeepSeek Platform defaults to https://api.deepseek.com/beta in v0.8.16 so beta-gated API features can be tested without extra setup. Set base_url = "https://api.deepseek.com" to opt out.

Legacy aliases deepseek-chat / deepseek-reasoner map to deepseek-v4-flash and retire after July 24, 2026. NVIDIA NIM variants use your NVIDIA account terms.

DeepSeek Pro rates currently reflect a limited-time 75% discount, which remains valid until 15:59 UTC on 31 May 2026. After that time, the TUI cost estimator will revert to the base Pro rates.

NOTE

For the latest DeepSeek-V4-Pro pricing, including the current 75% discount valid until 15:59 UTC on 31 May 2026, please consult the official DeepSeek pricing page. All rates listed in the README correspond to the officially published values.


Publishing Your Own Skill

DeepSeek TUI discovers skills from workspace directories (.agents/skillsskills.opencode/skills.claude/skills.cursor/skills) and global directories (~/.agents/skills~/.claude/skills~/.deepseek/skills). Each skill is a directory with a SKILL.md file:

~/.agents/skills/my-skill/
└── SKILL.md

Frontmatter required:

---
name: my-skill
description: Use this when DeepSeek should follow my custom workflow.
---

# My Skill
Instructions for the agent go here.

Commands: /skills (list), /skill <name> (activate), /skill new (scaffold), /skill install github:<owner>/<repo> (community), /skill update / uninstall / trust. Community installs from GitHub require no backend service. Installed skills appear in the model-visible session context; the agent can auto-select relevant skills via the load_skill tool when your task matches their descriptions.

First launch also installs bundled system skills for common workflows: skill-creator, delegate, v4-best-practices, plugin-creator, skill-installer, mcp-builder, documents, presentations, spreadsheets, pdf, and feishu. These live under ~/.deepseek/skills and are versioned so new bundles are added on upgrade without recreating skills the user deliberately deleted.


Documentation

DocTopic
ARCHITECTURE.mdCodebase internals
CONFIGURATION.mdFull config reference
MODES.mdPlan / Agent / YOLO modes
MCP.mdModel Context Protocol integration
RUNTIME_API.mdHTTP/SSE API server
INSTALL.mdPlatform-specific install guide
MEMORY.mdUser memory feature guide
SUBAGENTS.mdSub-agent role taxonomy and lifecycle
KEYBINDINGS.mdFull shortcut catalog
RELEASE_RUNBOOK.mdRelease process
LOCALIZATION.mdUI locale matrix & switching
OPERATIONS_RUNBOOK.mdOps & recovery

Full Changelog: CHANGELOG.md.


Thanks

  • DeepSeek — thank you for the models and support that power every turn. 感谢 DeepSeek 提供模型与支持,让每一次交互成为可能。
  • DataWhale 🐋 — thank you for your support and for welcoming us into the Whale Brother family. 感谢 DataWhale 的支持,并欢迎我们加入“鲸兄弟”大家庭。
  • OpenWarp — thank you for prioritizing DeepSeek TUI support and for collaborating on a better terminal-agent experience.
  • Open Design — thank you for support and collaboration around design-forward agent workflows.

This project ships with help from a growing community of contributors:


Contributing

See CONTRIBUTING.md. Pull requests welcome — check the open issues for good first contributions.

Support: Buy me a coffee.

NOTE

Not affiliated with DeepSeek Inc.

License

MIT

Star History

Star History Chart