dsh-tui:DeepSeek Harness 的终端交互入口

前言

DSH 可以通过插件扩展不同 profile。已有 dsh --profile headless 适合管道和无人值守流程;但当需要在终端里直接操作会话、查看状态、审批工具调用、切换权限、管理计划与目标时,会需要一个更近的交互层。tomowang/dsh-tui 提供这个终端入口。

定位

  • npm 包:@tomowang/dsh-tui
  • 维护者:tomowang
  • 许可证:MIT
  • 目标:作为 DeepSeek Harness(dsh)的开源终端前端
  • 包中 dsh.bundle.patch 指向 ./cordis.patch.yml

核心能力

会话状态

状态栏显示 session id、active LLM provider/model、current agent preset、live run state with spinner、queued-message count、logged event count。

统计行显示 turn/step counts、LLM/tool wall time、TTFT and decode tok/s、cache-hit %、billed tokens、context-usage summary。

模型与预设

/model 可以切换 active model,并 add、edit、delete custom LLM providers。

--agent-preset 用于在新会话中指定 agent preset;/presets 用于浏览和切换 presets。

会话检视

/trajectory/context/plugins 用于查看会话轨迹、上下文与插件信息。

工具调用与推理

运行中的工具调用显示为 live spinner;结束后收拢为一行结果。

/toolsCtrl+O 打开 Tool Cards overlay,可浏览 tool calls/results;Enter/Space 可将卡片收回标题。

Reasoning 在流式输出时显示动画 thinking line,结束后收为 one-line summary;完整文本可通过 /trajectory 查看。

Assistant text 若带有明确 Markdown signal,会在终端中做 Markdown 渲染。

权限与审批

Shift+Tab 循环权限预设:read-onlyworkspace-writedanger-full-accesscustom

终端内可处理 approvals 和 questions:allow once/rejectask_user_question 与 plan review 支持 multi-select 和 Other;支持时发送 OSC 9 desktop notification。

计划与目标

/plan [message] 进入 plan mode,/plan off 离开;model-proposed plan 会进入 Approve/Keep-planning 审查。

/goal <objective> 设置目标;/goal clear|edit <objective>|pause|resume 管理目标;active and armed 时可自动进行 continuation rounds。

输入与压缩

/compact 用于 summarize and compact session history。

Prompt history 会跨进程和 /clear 保存,用 / 召回。

输入支持 Readline 风格:word/line motion、kill/yank-style deletes、multi-line drafts;double Ctrl+C/Ctrl+D 退出。

本地命令与文件引用

空 prompt 下以 ! 开头会把 Enter 切换为 local shell command,prompt border 变黄,输出进入 transcript。

输入 @ 打开 repo files 的 fuzzy-filtered 下拉;Tab/Enter 插入选中路径。

终端体验

启动时会 best-effort 检查 npm registry,如果发布更新版本,会显示 upgrade command。

终端窗口/标题在 session title 存在时显示 <session title> — dsh-tui,否则显示 dsh-tui

全屏幕 transcript 使用 alternate screen buffer,支持 mouse wheel/trackpad、PageUp/PageDown、auto-follow;退出时会 flatten last screenful 到 scrollback。

当 backing service 未挂载时,overlays 会退化为 plain notices,而不是让 TUI 直接失败。

安装与启用

先确认环境满足要求:Node ^22.19 || >=24,并设置 DEEPSEEK_API_KEY

1、安装 DSH launcher:

npm install -g @deepseek-ai/dsh

2、在 tui profile 中安装 dsh-tui

dsh plugin --profile tui add @tomowang/dsh-tui

3、启动终端 profile:

dsh --profile tui

如果已有会话或想按 preset 开新会话,也可以用:

dsh --profile tui --resume <sessionId>
dsh --profile tui --agent-preset <presetId>
dsh --profile tui --dump-config

注意:stdinstdout 都必须是真实 TTY。插件在管道中会直接报错,而不是降级;管道场景继续使用 dsh --profile headless

典型用法

  • Ctrl+C 取消当前运行中的 turn。
  • Shift+Tab 循环 read-only / workspace-write / danger-full-access / custom
  • /toolsCtrl+O 打开 Tool Cards overlay;Enter/Space 将卡片收回标题。
  • esc 跳过 terminal 内的 approval/question 选项列表。
  • 空 prompt 下输入 ! 后,Enter 会执行 local shell command。
  • 输入 @ 打开文件引用补全,Tab/Enter 插入路径。
  • /plan [message] 进入 plan mode,/plan off 离开 plan mode。
  • /goal <objective> 设置目标;/goal clear|edit <objective>|pause|resume 管理目标。
  • /compact 压缩会话历史。
  • / 召回历史输入。
  • PageUp/PageDown 滚动全屏幕 transcript。

适用场景与注意

适合需要把 DSH 会话放到终端里操作的开发者:查看状态、切换模型和权限、审批工具调用、管理计划与目标、压缩历史、引用仓库文件。

由于插件会运行在 DSH 宿主环境中,并可触发工具调用、本地 shell、权限预设等能力,安装前应检查源码、许可证和依赖。本文列出的许可证为 MIT;插件目录页是独立插件目录链接,不等同于官方应用商店,与 DeepSeek/幻方没有官方从属关系。

链接

  • 目录页:https://www.skillhub.cn/plugins/tomowang/dsh-tui
  • GitHub:https://github.com/tomowang/dsh-tui
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜