爱意满满的作品展示区。
tomowang

[分享] 做了个开源终端 TUI 工具: dsh-tui (DeepSeek Harness)

  •  
  •   tomowang · 6 days ago · 1260 views

    最近在尝试 DeepSeek 官方的 agent harness ( dsh ),官方自带的是 web-app 和 headless 两种前端,平时用终端用的比较多,正好学习写了个 TUI —— dsh-tui 。

    快速安装:

    dsh plugin --profile tui add @tomowang/dsh-tui
    
    dsh --profile tui
    dsh --profile tui --resume <sessionId>           # reopen a persisted session
    dsh --profile tui --agent-preset <presetId>      # start a fresh session on a given preset
    dsh --profile tui --dump-config                  # inspect the composed plugin tree
    

    是什么

    dsh-tui 是一个 out-of-tree 的 dsh bundle ,同时也是一个 Cordis 插件。原理上和官方 dsh-web-app / dsh-headless 一样,都是叠在 @deepseek-ai/dsh-base 之上,模型适配、工具调用、会话持久化、沙箱和审批策略这些全部留在 dsh-base 里没动,dsh-tui 只负责终端侧的输入和渲染,算是给 dsh 换了个「壳」。

    功能

    • 状态栏:session id 、当前模型/provider 、agent 预设、运行状态(带 spinner )、排队消息数
    • 统计行:turn/step 数、LLM/工具耗时、TTFT 、解码速度、cache 命中率、计费 token 、context 占用
    • /model:终端里直接切模型,或增删改自定义 LLM provider (不用去改配置文件)
    • /presets:浏览/切换 agent 预设,配合启动参数 --agent-preset
    • /trajectory/context/plugins:分别是事件台账、context 占用可视化、插件树状态,排查问题挺好用
    • Shift+Tab 循环切换权限预设(只读/工作区可写/完全放开/自定义)
    • --resume <sessionId> 精确还原历史:因为渲染只读持久化的事件日志,不维护额外的内存状态,回放和实时走的是同一套逻辑
    • readline 风格的行编辑、跨进程持久化的输入历史(上下箭头翻)

    技术栈

    TypeScript + Ink ( React 渲染终端 UI )+ Cordis ( dsh 底层的插件框架),MIT 协议。

    预览

    dsh-tui session in a terminal, showing the startup banner, injected context, and tool calls

    1 replies    2026-08-17 10:07:46 +08:00
    iwolfor
        1
    iwolfor  
       4 days ago
    不错,就是状态栏有点单调
    <!-- Uploading "Snap43.jpg"... -->
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1093 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 23:29 · PVG 07:29 · LAX 16:29 · JFK 19:29
    ♥ Do have faith in what you're doing.