| 1 | # Modes and Approvals |
| 2 | |
| 3 | DeepSeek TUI has two related concepts: |
| 4 | |
| 5 | - **TUI mode**: what kind of visible interaction you're in (Plan/Agent/YOLO). |
| 6 | - **Approval mode**: how aggressively the UI asks before executing tools. |
| 7 | |
| 8 | ## TUI Modes |
| 9 | |
| 10 | Press `Tab` to complete composer menus, queue a draft as a next-turn follow-up |
| 11 | while a turn is running, or cycle through the visible modes when the composer is |
| 12 | otherwise idle: **Plan → Agent → YOLO → Plan**. |
| 13 | Press `Shift+Tab` to cycle reasoning effort. |
| 14 | |
| 15 | - **Plan**: design-first prompting. Read-only investigation tools stay available; shell and patch execution stay off. Use this when you want to think out loud and produce a plan to hand to a human (yourself later, or a reviewer). |
| 16 | - **Agent**: multi-step tool use. Approvals for shell and paid tools (file writes are allowed without a prompt). |
| 17 | - **YOLO**: enables shell + trust mode and auto-approves all tools. Use only in trusted repos. |
| 18 | |
| 19 | All three modes have access to the `rlm` tool. Inside its Python REPL, `llm_query_batched` fans out 1–16 cheap parallel child calls pinned to `deepseek-v4-flash`. The model reaches for it when work is decomposable. |
| 20 | |
| 21 | ## Compatibility Notes |
| 22 | |
| 23 | - `/normal` is a hidden compatibility alias that switches to `Agent`. |
| 24 | - Older settings files with `default_mode = "normal"` still load as `agent`; saving rewrites the normalized value. |
| 25 | |
| 26 | ## Escape Key Behavior |
| 27 | |
| 28 | `Esc` is a cancel stack, not a mode switch. |
| 29 | |
| 30 | - Close slash menus or transient UI first. |
| 31 | - Cancel the active request if a turn is running. |
| 32 | - Discard a queued draft if the composer is empty. |
| 33 | - Clear the current input if text is present. |
| 34 | - Otherwise it is a no-op. |
| 35 | |
| 36 | ## Approval Mode |
| 37 | |
| 38 | You can override approval behavior at runtime: |
| 39 | |
| 40 | ```text |
| 41 | /config |
| 42 | # edit the approval_mode row to: suggest | auto | never |
| 43 | ``` |
| 44 | |
| 45 | Legacy note: `/set approval_mode ...` was retired in favor of `/config`. |
| 46 | |
| 47 | - `suggest` (default): uses the per-mode rules above. |
| 48 | - `auto`: auto-approves all tools (similar to YOLO approval behavior, but without forcing YOLO mode). |
| 49 | - `never`: blocks any tool that isn't considered safe/read-only. |
| 50 | |
| 51 | ## Small-Screen Status Behavior |
| 52 | |
| 53 | When terminal height is constrained, the status area compacts first so header/chat/composer/footer remain visible: |
| 54 | |
| 55 | - Loading and queued status rows are budgeted by available height. |
| 56 | - Queued previews collapse to compact summaries when full previews do not fit. |
| 57 | - `/queue` workflows remain available; compact status only affects rendering density. |
| 58 | |
| 59 | ## Workspace Boundary and Trust Mode |
| 60 | |
| 61 | By default, file tools are restricted to the `--workspace` directory. Enable trust mode to allow file access outside the workspace: |
| 62 | |
| 63 | ```text |
| 64 | /trust |
| 65 | ``` |
| 66 | |
| 67 | YOLO mode enables trust mode automatically. |
| 68 | |
| 69 | ## MCP Behavior |
| 70 | |
| 71 | MCP tools are exposed as `mcp_<server>_<tool>` and use the same approval flow as built-in tools. Read-only MCP helpers may auto-run in suggestive approval modes; MCP tools with possible side effects require approval. |
| 72 | |
| 73 | See `MCP.md`. |
| 74 | |
| 75 | ## Related CLI Flags |
| 76 | |
| 77 | Run `deepseek --help` for the canonical list. Common flags: |
| 78 | |
| 79 | - `-p, --prompt <TEXT>`: one-shot prompt mode (prints and exits) |
| 80 | - `--model <MODEL>`: when using the `deepseek` facade, forward a DeepSeek model override to the TUI |
| 81 | - `--workspace <DIR>`: workspace root for file tools |
| 82 | - `--yolo`: start in YOLO mode |
| 83 | - `-r, --resume <ID|PREFIX|latest>`: resume a saved session |
| 84 | - `-c, --continue`: resume the most recent session in this workspace |
| 85 | - `--max-subagents <N>`: clamp to `1..=20` |
| 86 | - `--no-alt-screen`: run inline without the alternate screen buffer |
| 87 | - `--mouse-capture` / `--no-mouse-capture`: opt in or out of internal mouse scrolling, transcript selection, and right-click context actions. Mouse capture is enabled by default on non-Windows terminals so drag selection copies only user/assistant transcript text; hold Shift while dragging or use `--no-mouse-capture` for raw terminal selection. It defaults off on Windows (CMD/terminal mouse-escape spam in the prompt) and inside JetBrains JediTerm — PyCharm/IDEA/CLion/etc. — where the terminal advertises mouse support but forwards SGR mouse events as raw text (#878, #898). Use `--mouse-capture` to opt in anywhere it's defaulted off. |
| 88 | - `--profile <NAME>`: select config profile |
| 89 | - `--config <PATH>`: config file path |
| 90 | - `-v, --verbose`: verbose logging |
| 91 |