Development & Runtime

dsh-safe-tui

aorucshiea/dsh-safe-tui · ★ 1

aorucshiea

DeepSeek Harness safe-mode recovery TUI: minimal interactive terminal, no user plugins/presets, built-in repair

License
MIT
Added
2026-10-30
Maintenance
active
Install kind
github
Manifest details
Manifest status
Declared
Manifest path
package.json#dsh
Manifest checked
2026-10-30T09:38:38.419Z
Lifecycle scripts
None found

Static manifest checks report declarations only; they are not compatibility or security review.

安装

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

Source README · body: en · Read Chinese README

Table of contents
  1. Demo
  2. What it is
  3. Quick start
  4. Getting the deepseek command
  5. TUI commands
  6. Web Console
  7. Session lease
  8. Other CLI usage
  9. Repository
  10. License

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 (/repair or the standalone Repair shortcut).
  • Switch models and providers (/models, /providers, /add-provider).

Difference: dsh-safe-tui is 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 deepseek binary is provided automatically.
  • On Windows you can also copy deepseek.cmd from this repository into a directory on PATH, 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_editor only.

  • 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, Enter to choose, Esc to cancel.

  • Selecting /model, /sessions, or /preset opens a second-level picker.

  • /sessions uses 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 ●; press Ctrl+X twice to delete the selected session.

  • /clean or dsh --profile safe --clean deletes all empty sessions that have no AI-generated content.

  • While a turn is generating, press Ctrl+C or Esc to cancel the current turn.

  • In the /preset picker, press i or ? to show/hide the highlighted preset's description.

  • When the input is empty, ↑ / ↓ or PgUp / PgDn scroll through conversation history; while typing, ↑ / ↓ recall command history.

  • Model reasoning and tool calls are collapsed to one line by default; press Ctrl+O to expand/collapse details. The mouse wheel can also scroll history.

  • You can switch preset inside 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-bridge process 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 minimal preset is enforced with an agent-scoped tool mask: only pwsh/bash and str_replace_editor are 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