dsh-tianshu-tui README

The project's README from github.com/huiliyi37/dsh-tianshu-tui. As one markdown file: README.md.

dsh-tianshu-tui — DeepSeek Harness coding 终端

npm license node release dshfind

中文 | English

dsh-tianshu-tui

dsh-tianshu-tui是官方 [DeepSeek Harness] 上的交互式终端 TUI 面板插件。渲染核心为自研极简 ANSI引擎,轻量渲染使用体验极度流畅。(由作者的[天枢 Tianshu-harness] 演进而来。UI 是纯展示层:所有 agent 状态都来自会话事件流,流式 Markdown/工具卡、16+ 主题、slash 命令与选择器、输入历史与本地偏好持久化、LSP 诊断。在此之上做了工程层的改造,如图像与视觉桥接、代码智能检索、memory记忆与跨会话召回等。

[!WARNING] 生态边界(Ecosystem boundary):本插件属于官方 DeepSeek Harness(@deepseek-ai/* 生态)——peerDependencies 与代码 import 均指向 @deepseek-ai/*。不要把它装配进 oh-my-tianshu(@huiliyi37 生态,CLI 为 @huiliyi37/dsh-tianshu)的 tui profile。oh-my-tianshu 的官方 TUI 是 @huiliyi37/dsh-tui:两者同源(共享 109/117 个 TUI 源文件)但生态不同,混装会让插件在运行时靠 ~/.dsh/profiles/node_modules 中指向官方 dsh 的旧符号链接兜底解析 @deepseek-ai/*,形成跨生态脆弱耦合。

文档

文档 说明
快速开始 安装、启动与常见问题
交互手册 快捷键与命令全表
配置 装配选项、环境变量与运行时配置
架构 分层、数据流与设计决策
主题 16 个内置主题与自定义
插件生态 伴生插件与扩展点
VS Code 在 VS Code 中使用
ADAPTER.md TUI ↔ harness 边界契约
贡献指南 PR 规范与验证矩阵
开发说明 结构、构建与发布

安装

本包不是独立程序。须先有官方 CLI @deepseek-ai/dsh(npm latest,当前 0.1.2-rc.1;需 ≥ 0.1.2-rc.1,peer 依赖对齐)。只 npm i 本包跑不起来。

一键安装(推荐):仓库自带跨平台脚本,自动检测 Node/pnpm、经 pnpm 安装官方 CLI + 装配本插件并启动(国内网络默认走 npmmirror 镜像):

# macOS / Linux(bash)
bash <(curl -fsSL https://raw.githubusercontent.com/huiliyi37/dsh-tianshu-tui/main/scripts/install-tui.sh)
# 只安装不启动:
bash <(curl -fsSL https://raw.githubusercontent.com/huiliyi37/dsh-tianshu-tui/main/scripts/install-tui.sh) --no-launch

# Windows(PowerShell)
powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/huiliyi37/dsh-tianshu-tui/main/scripts/install-tui.ps1 | iex"
# 只安装不启动:
powershell -ExecutionPolicy Bypass -File scripts\install-tui.ps1 -NoLaunch   # 克隆仓库后本地跑

1. 准备环境

⚠ npm 11 的 OOM 坑:官方 CLI @deepseek-ai/dsh 依赖树较大(60+ 子包),npm 11(Node 24 自带)安装时会 JavaScript heap out of memory(卡住数分钟后 OOM,实测复现)。请用 pnpm(下方命令)。若你已经在用 npx -y @deepseek-ai/dsh 且卡住/报 heap OOM,切到 pnpm 即可。

不要直接敲 dsh。 若 PATH 上已有旧的 dsh(例如 ~/.local/bin/dsh,dsh --version 低于 0.1.0-rc.8),会走到本地 staging,出现 ERR_FS_EISDIR / Path is a directory .../@deepseek-ai/dsh。请始终用下面的 pnpm dlx 命令。

2. 把本插件装进 tui profile

pnpm dlx @deepseek-ai/dsh plugin --profile tui add @huiliyi37/dsh-tianshu-tui

pnpm 可能提示 peer missing,可忽略:peer 由官方 dsh 宿主提供,不必另装。没有 pnpm 也可以 npx -y pnpm dlx @deepseek-ai/dsh plugin --profile tui add @huiliyi37/dsh-tianshu-tui。

从 npm 安装后,每次启动会对照 npm latest:有新版本就写入 profile,提示重启后生效。也可在 TUI 里敲 /update 手动检查(只查不装,给出更新命令)。不想联网检查时设 DSH_TUI_SKIP_UPDATE=1。github: / link: 安装不会改写成 npm 包。

也可以从 Git 装:pnpm dlx @deepseek-ai/dsh plugin --profile tui add github:huiliyi37/dsh-tianshu-tui(仓库已包含 lib/index.js,不必再打包)。

3. 启动

pnpm dlx @deepseek-ai/dsh --profile tui

看到欢迎页品牌 dsh-tianshu-tui 即成功。Ctrl+Q 或 /exit 退出。

已全局安装官方 CLI(pnpm add -g @deepseek-ai/dsh)且 dsh --version 不低于 0.1.0-rc.8 时,把上面的 pnpm dlx @deepseek-ai/dsh 换成 dsh 即可。

4. agent 预设(/preset)

命令是 /preset(没有 /presets)。本包 bundle 对标官方 web:关掉 host 上的 agent 面,挂上 @deepseek-ai/dsh-agent-presets(依赖钉死 0.1.2-rc.1,npm latest 仍停在过时的 0.0.1-rc.1)。plugin add 本包即连带装上花名册;新会话在 setup 里 mount,/preset 换的是官方 shipped 面(标准 / PTC / 极简 / 创造),不是叠在 dsh-base 工具上。

用法:

若 npx 仍报 ERR_FS_EISDIR,是 ~/.dsh/profiles/node_modules 里旧的安装 fallback 与官方 CLI 冲突。换干净目录再启动:

DSH_HOME=/tmp/dsh-tianshu pnpm dlx @deepseek-ai/dsh plugin --profile tui add @huiliyi37/dsh-tianshu-tui
DSH_HOME=/tmp/dsh-tianshu pnpm dlx @deepseek-ai/dsh --profile tui

不要在 DeepSeek Harness 工作区根目录对本包跑 tsdown:会把未发布的 @deepseek-ai/dsh-root 写进 bundle,加载必失败。

与其他发行版共存

本插件运行在官方 DeepSeek Harness(@deepseek-ai/dsh)之上,数据 home 为 ~/.dsh。 独立集成发行 oh-my-tianshu(原 tianshu-public,@huiliyi37/dsh-tianshu,自带 tianshu CLI 的完整 harness)是另一条独立发行线,使用独立的 $DSH_HOME(默认值独立化落地后为 ~/.dsh-tianshu)——两套系统 home 隔离,可同时安装、互不干扰(会话 / profile / settings 各自独立)。共存时 tianshu 侧设 export DSH_HOME=~/.dsh-tianshu 即可。

命名备忘(防止混淆):

名字 是什么
dsh-tianshu-tui(本插件) 官方 dsh 的 TUI 插件(本仓库)
oh-my-tianshu / @huiliyi37/oh-my-tianshu(原 tianshu-public) 独立集成发行,自带 CLI(命令 oh-my-tianshu)
Tianshu-Tui(上游) 本插件渲染核心的 Apache-2.0 来源(天枢)

2026-08-16 已改名:原 @huiliyi37/dsh-tianshu(命令 tianshu)统一为 @huiliyi37/oh-my-tianshu(命令 oh-my-tianshu),与仓库名一致;旧包已 deprecate,请迁移安装。

需要图片再询问能力时,再装配同仓伴生包 vision-ask/。LSP 模型工具面(lsp_goto_definition / lsp_find_references / lsp_diagnostics)已随本包内置(@huiliyi37/dsh-lsp 伴生插件,bundle patch 自动 insert)——装 TUI 一个包即得展示桥 + 模型工具面,二者共享同一 LSP server 集(不双份 spawn)。TUI 桥的诊断源探测顺序:内置伴生插件 lsp 服务(getDiagnostics 形状)→ 官方 ctx.lsp seam(deepseek-harness 的 dsh-lsp,经 query(getDiagnostics) 适配)→ 内置桥降级。⚠ 此前单独装过旧社区版(github:omdsh-dev/dsh-lsp)的用户请先 plugin remove 旧版再升级——新旧同时装配会重复注册同名模型工具。

更新说明

当前 npm latest:@huiliyi37/[email protected](GitHub Release)。

0.1.2-rc.29(2026-09-09):宿主线上到 0.1.2-rc.1(官方 latest 已转正,修复 #56 启动即崩)——Session.events 移除改 snapshotEvents()、userQuestions 改 waterfall answerer(global 注册)、CallId→ToolCallId、preset code→ptc、fork 血缘改 isSeeded+inheritedEventCount、bundle patch 补 subagent-model-selection-settings;旧宿主(≤0.1.1-rc.2)启动即 fail-loud 附升级/回退指引。⚠ 本次升级需宿主 ≥ 0.1.2-rc.1。

0.1.2-rc.28(2026-08-29):回应 #55 的 vim 优化——光标形态分模式(NORMAL 反色块 / insert 竖线)、历史搜索两阶段输入(编辑段可输 n/N,Enter 后跳转、搜索对象显式标注)、搜索命中子串高亮(含 /scroll);另投递失败自动回填输入行 + README 键位表一致性守卫。

0.1.2-rc.27(2026-08-29):回流 Tianshu 两项——错误时刻可行动(错误落底 + 指引之外,最近一条已投递消息自动回填输入行,↩ 告知「可能未被完整处理」,改一下即可重发;成功回合清底料、有草稿不抢写);plan-review 决策卡视觉分层(dim 决策区分隔线 + approve ❯/success 主操作高亮,主题不传时渲染不变)。

0.1.2-rc.26(2026-08-28):P1 交互打磨六连——Esc 分层收尾(打断 grace 期 + 布防提示行)、glance 拟人动词池、footer 显式分级降级、错误恢复指引(每个错误附下一步操作)、定高视口强化(chrome 开合输入轨不跳)、fish 式历史建议 ghost(→ 接受);/scroll 上限可配。

0.1.2-rc.25(2026-08-28):P0 交互三连——键位/命令/提示统一 action registry(app.ts 棘轮 4359→4140)、审批卡六档决策梯度(新增 p 命令前缀白名单、f 拒绝附反馈,bash 审批带命令预览与危险标注)、运行中消息排队(↑ 收回、Ctrl+Enter 插队、打断保队列);另含 /scroll 分页查看器、完成响铃、vim remap、主题对比度校验。

0.1.2-rc.23(2026-08-27):LSP 三件套对齐 tianshu-public 0.6.0 官方 seam 线(单 lsp 工具四操作 + 本地 provider 默认 tsserver),诊断源能力门控防 /lsp 面板退化;宿主 peer 对齐 ^0.1.1-rc.2。

0.1.2-rc.22(2026-08-27):LSP 模型工具面随包内置首版(伴生插件自动挂载,装 TUI 一个包即得展示桥 + 模型工具面;旧社区版请先移除)。

0.1.2-rc.21(2026-08-27):社区反馈三连修——输入框光标反色化(#50)、preset 缺省 standard(#48)、malformed SSE payload 根因定位并上报官方(#49)。

完整版本历史见 CHANGELOG.md;TUI 内 /changelog 查看(/changelog all 全部)。

亮点

与 harness 协同演化的能力(2026-08-09 基线以来)

终端 UI 从 天枢 Tianshu-Tui 演进而来(Apache-2.0;逐文件来源见 SOURCE-MAP.md)。本 bundle 随后在 DeepSeek Harness 基线快照 snapshots/20260809T140917Z 之上与 harness 侧工作同步开发——2026-08-10 至 2026-08-13 共 250+ 提交。下列能力位于宿主 harness(独立包,不随本 bundle 分发);TUI 是它们的主要交互面:

功能

会话管理

能力 说明
/session new|list|switch 新建、列出、切换会话;恢复时经同一渲染桥重放完整转录
恢复面板 启动时把可恢复会话列表写入滚动区
/fork [directive] · /branch 分叉当前会话(历史复制到新子会话),可选带起始指令
/rewind 回退到指定消息——会话截断和/或文件回退到边界前快照
/export 把当前会话转录导出为 Markdown 文件
/clear 清空当前会话滚动区视图

输入面

dsh-tianshu-tui (huiliyi37/dsh-tianshu-tui)

Searching Database…

What is this?dsh-tianshu-tui is an interactive terminal UI (TUI) plugin for the official DeepSeek Harness CLI (@deepseek-ai/dsh). It uses a self-built minimal ANSI rendering engine to show streaming Markdown and tool cards, 16+ themes, slash commands, memory, and LSP diagnostics inside your terminal.
Is this a standalone app or a plugin I add to something else?It's a plugin, not a standalone program — you need the official DeepSeek Harness CLI (@deepseek-ai/dsh) already installed, then mount this plugin into its tui profile.
How do I install and start it?Use the repo's cross-platform one-click script, or run 'pnpm dlx @deepseek-ai/dsh plugin --profile tui add @huiliyi37/dsh-tianshu-tui' to add it to the official CLI's tui profile, then launch with dsh (or the pnpm dlx form if the CLI isn't global).
What do I need before installing this?Node.js ^22.19 or >=24, and pnpm (enable it via corepack if missing); the official DeepSeek Harness CLI @deepseek-ai/dsh (>= 0.1.2-rc.1) is a required peer dependency the plugin mounts onto.
Any install pitfalls I should know about?Installing the official CLI with npm 11 (bundled with Node 24) can hang and run out of heap memory because of its large dependency tree, so pnpm is required instead. A stale old 'dsh' binary on PATH can also trigger ERRFSEISDIR errors, so always use the pnpm dlx command shown in the docs.
Is this the same thing as oh-my-tianshu?No — this plugin only works inside the official DeepSeek Harness ecosystem (@deepseek-ai/), while oh-my-tianshu (@huiliyi37/dsh-tianshu) is a separate standalone distribution with its own CLI and its own data directory (~/.dsh-tianshu); mixing the two creates fragile cross-ecosystem coupling.
Can I use vim-style keybindings for editing input?Yes, Vim keybindings modeled on Claude Code are built in (motions, text objects, dd/cc/yy, visual mode) and can be toggled at runtime with /vim or set as the default.
What happens if the active model can't see images?A vision bridge automatically routes image attachments to a separate vision-capable model to generate a description, which gets injected as a message so a text-only model can still 'see' the image content.
What memory and session-recovery features does it have?/memory and /remember give cross-session recall via a Markdown-backed memory service, while /fork, /rewind, and /export let you branch sessions, roll back to a prior message with optional file rollback, or export the transcript to Markdown.
How many themes does it ship with?16+ built-in themes are included, selectable and customizable from within the TUI.
Creator
huiliyi37
Size
5.8 MB
Stars
287
Age
2mo
Commits · 90 Days