Development & Runtime
dsh-safe-tui
aorucshiea/dsh-safe-tui · ★ 1
DeepSeek Harness safe-mode recovery TUI: minimal interactive terminal, no user plugins/presets, built-in repair
Manifest details
安装
dsh plugin --profile web add 'github:aorucshiea/dsh-safe-tui#3367883a1994df6bfd7b5bce6b8b20cedbbed316'GitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
For install and environment setup, plus plugin development tutorials, see DSH community docs ↗
README
Table of contents
A safe-mode recovery TUI for DeepSeek Harness.
Demo
What it is
When the main Web UI cannot start because of a broken plugin/client patch, use this standalone terminal to:
- Load only
dsh-base+dsh-safe-tui; no user plugins, no Web UI. - Disable user-authored presets (
includeUserRoot: false); only official system presets are exposed:minimal/standard/code/cordis. - Inherit existing DeepSeek history from
~/.dsh/sessions(/sessions). - Repair corrupted official client files from bundled pristine copies (
/repairor the standalone Repair shortcut). - Switch models and providers (
/models,/providers,/add-provider).
Difference:
dsh-safe-tuiis a safe-mode / recovery TUI. It does not load user plugins or Web UI and only exposes official system presets (minimal/standard/code/cordis). It is not a general-purpose daily-driver TUI skin (e.g.ccch1mneyyy/dsh-TUI); the two have different purposes and can complement each other.
Quick start
# Install the plugin into a fresh safe profile
dsh plugin --profile safe add github:aorucshiea/dsh-safe-tui#v0.7.0
Then either:
dsh --profile safe
or, if the deepseek command is available:
deepseek
The deepseek command opens the same full-screen TUI directly.
Getting the deepseek command
- If the package is installed through npm/global tooling, the
deepseekbinary is provided automatically. - On Windows you can also copy
deepseek.cmdfrom this repository into a directory onPATH, for example:
copy deepseek.cmd %APPDATA%\npm\
Then open a new terminal and run:
deepseek
TUI commands
/help /sessions /sessions all /new /preset [minimal|standard|code|cordis] /models /models <provider/model> /providers /add-provider /status /repair /clean /check /quit
Official system presets:
minimal— minimal mode: persistent bash +str_replace_editoronly.standard— standard mode: full coding agent (files, shell, search, skills, plans, goals, subagents, workflows).code— PTC mode: all standard capabilities plus the Code Mode TypeScript SDK for multi-step operations.cordis— creation mode: all standard capabilities plus runtime inspection, plugin experimentation, and preset authoring.Type
/to open the command palette.Use
↑/↓to navigate,Enterto choose,Escto cancel.Selecting
/model,/sessions, or/presetopens a second-level picker./sessionsuses an OpenCode-style Sessions dialog: type to filter, grouped by Today/Yesterday/date, workspace folder at the end of each row, current session marked with●; pressCtrl+Xtwice to delete the selected session./cleanordsh --profile safe --cleandeletes all empty sessions that have no AI-generated content.While a turn is generating, press
Ctrl+CorEscto cancel the current turn.In the
/presetpicker, pressior?to show/hide the highlighted preset's description.When the input is empty,
↑/↓orPgUp/PgDnscroll through conversation history; while typing,↑/↓recall command history.Model reasoning and tool calls are collapsed to one line by default; press
Ctrl+Oto expand/collapse details. The mouse wheel can also scroll history.You can switch
presetinside an existing session; a warning is shown because old tool calls may not match the new preset.
Web Console
When the Web profile loads this bundle, the conversation keeps a Console tab. Clicking it opens the Safe TUI in the built-in right details column (it pushes the chat instead of overlaying it) and resumes the same session.
- The detached
console-bridgeprocess owns the PTY and survives Web server restarts. - The browser reconnects to the current TUI screen (only the final screen frame is replayed).
- AI tools:
console_status,console_set_model,console_set_preset,console_handoff,console_return. - The official
minimalpreset is enforced with an agent-scoped tool mask: onlypwsh/bashandstr_replace_editorare visible.
Session lease
DSH persistence only enforces one writer inside a single process. To prevent the Web host and the detached Safe TUI from writing the same session concurrently, this plugin keeps cross-process leases under ~/.dsh/safe-tui/leases/. A Web agent holds a web lease; the Safe TUI holds a console lease while resuming or sending a turn. Stale leases are reclaimed by PID liveness and heartbeat timeout.
Other CLI usage
dsh --profile safe "your question" # one-shot
dsh --profile safe --list # list saved sessions
dsh --profile safe --resume <sessionId> # resume in TUI
dsh --profile safe --models # list models
dsh --profile safe --providers # list providers
dsh --profile safe --model <id> # switch default model
dsh --profile safe --check # health check
dsh --profile safe --repair # repair broken files
Repository
https://github.com/aorucshiea/dsh-safe-tui
License
MIT