跳过主要内容
N

dsh-tui

nexlineai/dsh-tui

A full-screen interactive terminal UI for the DeepSeek Harness agent runtime — live streaming, reasoning blocks, tool cards, sessions, permissions, plan mode, and a full slash-command suite. The web UI, reimagined for the terminal.

安装

dsh plugin --profile web add github:nexlineai/dsh-tui

README

dsh-tui

A full-screen interactive terminal UI for the DeepSeek Harness agent runtime — the web UI, reimagined for the terminal.

npm CI license platform

dsh-tui runs the official DeepSeek Harness agent (tools, file editing, shell, subagents, sessions, permissions, plan mode) behind a Claude Code / opencode-style interface — live token streaming, reasoning blocks, boxed tool cards, prompt history, and a full slash-command suite. No browser, no Electron, just your terminal.

It is not a model wrapper or a plain chat REPL — it drives the real agent runtime.


Features

  • Live streaming — answers render token-by-token as the model generates.
  • Reasoning displaythinking blocks stream dim/italic, with per-turn effort control (/model <id> high).
  • Tool cards — box-drawn ⏱ bash blocks with lifecycle markers (● running → ✓ done / ✖ error) and arg/result previews.
  • Full agent toolkit — the agent can read/edit files, run commands, delegate subagents, and execute plans.
  • Session management — list and resume any persisted session (/resume).
  • Permission modesread-only / workspace-write / danger-full-access, switchable live (/permissions).
  • Plan mode — toggle plan-first behavior (/plan).
  • Compaction — shrink the conversation on demand (/compact).
  • Trajectory — a filtered event timeline of the whole session (/trajectory).
  • Diagnostics — environment + model-catalog health check (/doctor).
  • Scrollback — mouse wheel / PgUp / PgDn, with ↑ N indicator.
  • Markdown rendering — fenced code blocks, inline code, bold, headings, lists.
  • Cross-platform — macOS and Linux terminals (iTerm2, Terminal.app, kitty, alacritty, xterm, …).

Install

dsh-tui is a DeepSeek Harness plugin. You need the official dsh installed first:

# 1. Install the official DeepSeek Harness (once)
npx @deepseek-ai/dsh web --help   # or: npm i -g @deepseek-ai/dsh

# 2. Create a `tui` profile and add this plugin
dsh plugin --profile tui add @nexlineai/dsh-tui

# 3. Run it
dsh --profile tui

The profile initializes on first use; dsh-tui composes over the same @deepseek-ai/dsh-base core as the web UI.

Model key

export DEEPSEEK_API_KEY=sk-...

The TUI uses the same credential sources as the harness (DEEPSEEK_API_KEY / settings.yaml).


Demo

A representative session transcript — streaming answer, reasoning block, tool card, trajectory, doctor, model picker — is in demo/session.md.


Commands

CommandDescription
/helplist commands
/modellist models + reasoning efforts; ● active marks current
/model <id> [effort]switch live, e.g. /model deepseek-v4-pro high
/resumelist persisted sessions (id, title, date)
/resume <n>continue that session with full history
/permissionslist permission presets
/permissions <name>switch (read-only / workspace-write / danger-full-access)
/plantoggle plan mode
/compactcompact the conversation now
/trajectoryshow the session event timeline
/settingsone-screen summary of model/permission/plan/stream state
/doctorenvironment + model catalog health check
/versiondsh-tui + runtime versions
/statussession, cwd, event and turn counts
/reasoning on|offshow/hide the thinking display
/stream on|offtoggle live token streaming
/clearclear the conversation area
/exit (or q, quit, :q, Ctrl+D)leave

Keybindings

KeyAction
Entersubmit
/ prompt history
/ move cursor
Home / End (Ctrl+A / Ctrl+E)line start / end
Backspace / Deletedelete
Ctrl+U / Ctrl+Kkill to start / end
Ctrl+Wdelete previous word
Escclear the input line
Tabcomplete a slash command
Ctrl+Cclear (empty → exit)
Ctrl+Dexit
PgUp / PgDn / mouse wheelscroll the conversation

Layout

┌ DeepSeek Harness TUI            deepseek-official/deepseek-v4-pro · session a1b2c3d4 ┐
│ ─────────────────────────────────────────────────────────────── 15:35:34 · 2s · 12→45 tok │
│ ❯ list the files                                                                     │
│ ✻ thinking                                                                            │
│   · a simple listing; I'll use bash ls                                                 │
│ This is the repository root — a plugin-based agent harness with pnpm workspaces...    │
│ ┌─ ⏱ bash ──────────────────────────────────────────────────────────────────────────┐ │
│ │ $ ls -la                                                                           │ │
│ └─ ✓ done ───────────────────────────────────────────────────────────────────────────┘ │
│ ❯ your input                                                                          │
│ ~/project · stream on · 1 turns · 500→120 tok                              ↑ /help  │
└───────────────────────────────────────────────────────────────────────────────────────┘

How it differs from the web UI

Same agent, same permissions, same sessions — but everything happens in your terminal. dsh-tui is aimed at people who live in a terminal, want a keyboard-first flow, or run the harness over SSH / inside a multiplexer like herdr or tmux.

Why a separate CLI?

The official dsh ships a web UI and a one-shot headless mode — no interactive terminal agent. dsh-tui fills that gap as an installable plugin, without forking the runtime.


Contributing

Bug reports, terminal-compatibility notes, and PRs are welcome — see CONTRIBUTING.md. For rendering issues, please include your terminal, $TERM, and the output of /version and /doctor.

License

MIT — see LICENSE. Not affiliated with DeepSeek AI; the runtime it drives is MIT-licensed upstream.

相关插件