第 2026-05-07 期
API · 在线
DeepSeek TUI
深度求索 · 终端代理
Section 02 · 文档

Documentation 文档

The short version of how it works. For the full architecture walk-through, seedocs/ARCHITECTURE.mdin the repo.

Modes 模式

Three operating modes — orthogonal to the approval system. Cycle with Tab.

Plan 计划

Read-only investigation. The agent can grep, read files, list dirs, fetch URLs — never write or shell out.

Agent 代理

Default. Multi-step tool use. Shell and side-effectful tools require approval per `approval_mode` setting.

YOLO 全权

Auto-approve everything + enable trust mode. Workspace boundary lifts. Use carefully.

Tools 工具

Curated surface — see docs/TOOL_SURFACE.md for design rationale.

File ops
read_file · list_dir · write_file · edit_file · apply_patch
Search
grep_files · file_search · web_search · fetch_url
Shell
exec_shell · exec_shell_wait · exec_shell_interact
Git / diag / test
git_status · git_diff · diagnostics · run_tests
Sub-agents
agent_spawn · agent_wait · agent_result · agent_cancel · agent_list · agent_send_input · agent_resume · agent_assign
Recursive LM
rlm — sandboxed Python REPL with llm_query()/rlm_query() for chunked processing of long inputs
MCP
mcp_<server>_<tool> — auto-registered from ~/.deepseek/mcp.json

Approval & Sandbox 审批

Mode and approval are independent axes. Set via /config.

suggest · 建议

Default — uses per-mode rules. Asks before risky ops.

auto · 自动

Auto-approve all tool calls. Equivalent to YOLO without trust.

never · 拒绝

Block anything not safe/read-only. Investigation only.

Sandbox: landlock (Linux), seatbelt (macOS), AppContainer / restricted tokens (Windows). Workspace boundary defaults to --workspace. /trust lifts the boundary.

Configuration 配置

# ~/.deepseek/config.toml
[api]
key = "sk-..."
base_url = "https://api.deepseek.com"
model = "deepseek-v4-pro"      # default; deepseek-v4-flash is the fast / sub-agent option

[ui]
default_mode = "agent"                      # plan | agent | yolo
approval_mode = "suggest"                   # suggest | auto | never
reasoning_effort = "high"                   # off | high | max

[hooks]
enabled = true
default_timeout_secs = 30

[[hooks.hooks]]
event = "session_start"                     # or: tool_call_before / tool_call_after
command = "~/.deepseek/hooks/pre.sh"        # / message_submit / mode_change / on_error / shell_env

Full reference: config.example.toml.

MCP Servers MCP

deepseek speaks the Model Context Protocol both ways: as a client (loads servers from ~/.deepseek/mcp.json) and as a server (deepseek mcp). Tools surface as mcp_<server>_<tool>.

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me"]
    },
    "sqlite": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "./data.db"]
    }
  }
}

Skills 技能

A skill is a folder under ~/.deepseek/skills/<name>/with a SKILL.md at the root. The agent loads skill names + descriptions on startup and can pull in the full body via the Skill tool when relevant.

Providers 提供商

Switch with deepseek auth set --provider <id>. The table below is a live projection of the ApiProvider enum in crates/tui/src/config.rs — currently 10 providers.

DeepSeek
deepseek
DEEPSEEK_API_KEY
DeepSeek (CN)
deepseek-cn
DEEPSEEK_API_KEY
NVIDIA NIM
nvidia-nim
NVIDIA_API_KEY
OpenAI
openai
OPENAI_API_KEY
OpenRouter
openrouter
OPENROUTER_API_KEY
Novita
novita
NOVITA_API_KEY
Fireworks
fireworks
FIREWORKS_API_KEY
sglang
sglang
SGLANG_API_KEY
vLLM
vllm
VLLM_API_KEY
Ollama
ollama
OLLAMA_API_KEY

Shortcuts 快捷键

TabCycle mode (Plan / Agent / YOLO)
Shift+TabCycle reasoning effort
Ctrl+LClear screen, keep session
Ctrl+CCancel current turn
Ctrl+DExit
/helpSlash command palette
/configEdit config interactively
/trustLift workspace boundary for session