jiamuAi/dsh-token-usage
DSH Token用量统计面板(Codex风格):全实例Token消耗汇总+活动热力图。
Project Overview项目介绍
This plugin is built specifically for DeepSeek Harness (DSH), adding a dedicated Token usage statistics panel to DSH's native web interface. It tracks total Token consumption across all sessions for a running DSH instance, displaying multiple key metrics and visualizations to help users clearly see how their Tokens are being used. To install, users can simply send a single command to their DSH Agent, which will automatically read the repository description, clone the code, and set up the plugin. Users can also choose to manually install it by cloning the repository directly to DSH's local extensions folder, then add the plugin to DSH's bundle list and restart the DSH web service.
After installation completes, users will find a new "Token Stats" entry added to the bottom of DSH's native left sidebar. When opening any existing conversation session, a small real-time usage capsule button will appear right next to the conversation title. Clicking either entry opens the main interactive statistics panel, which supports toggling between light and dark themes matching DSH's native system style. Data for the panel refreshes automatically every five seconds, and all historical usage data is preserved across DSH restarts so users never lose their long-term usage tracking. The interface mimics the familiar usage page style from Codex, so Codex users will have no extra learning curve to use this plugin.
This plugin is released under the permissive MIT open source license, and its usage counting aligns exactly with DSH's built-in token-meter tool. For regular end users, pre-built compiled assets are already included in the lib directory, so no extra build steps are required after installation, and the plugin works out of the box right after DSH restarts. If you want to modify the source code or add new features, you will need to use DSH's native compilation tools to build the updated assets, then commit the new build output back to your working repository. The counting method includes all Token usage from input, output, cache reads, and cache writes, matching DSH's internal calculation standards.
这是专为DeepSeek Harness(DSH)开发的原生插件,提供仿Codex风格的Token用量统计面板,为DSH的Web界面新增专用入口,统计当前DSH实例下全部会话的Token总消耗量,清晰展示五大核心指标、活动热力图以及高频插件排行。支持通过给DSH Agent发送指令一键安装,也可手动克隆代码仓库到扩展目录完成安装。
安装完成后,用户可在DSH左侧边栏底部找到「Token统计」入口,任意打开会话后,标题旁还会显示实时用量胶囊按钮,点击任意入口即可打开统计面板,面板支持深色/浅色双主题切换,数据每5秒自动刷新,重启后历史数据不会丢失。对熟悉Codex的用户来说,界面风格符合原有使用习惯,几乎没有额外学习成本,能快速上手查看用量。
插件遵循MIT开源协议,数据统计口径与DSH内置的token-meter保持一致,累计Token包含输入、输出、缓存读写的用量总和,一般用户不需要额外构建,预编译产物已经放在lib目录,开箱可用。开发修改代码需要依赖DSH内置的编译工具,完成后同步产物到仓库即可。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-token-usage(jiamuAi/dsh-token-usage)
仓库:https://github.com/jiamuAi/dsh-token-usage
本站详情页:https://www.yhbd.top/plugins/jiamuai-dsh-token-usage/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 3 · 最近提交 2026-08-15 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add github:jiamuAi/dsh-token-usage
把 jiamuAi/dsh-token-usage 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-token-usage
中文 · English
DSH 的 Token 用量统计面板 —— 仿 Codex 个人用量页风格,把整个 DSH 实例的 Token 消耗一目了然地展示出来:累计 / 单会话峰值、活动热力图、插件 Top5。
这是什么
DSH 刚发布,大家最关心的就是:我的 Token 到底花哪去了?
这个插件在 DSH Web 界面里加一个 Token 用量统计面板,把当前运行实例全部会话的 token 消耗汇总,点击入口即弹出居中面板(深色 / 浅色主题):

特性
- 5 大指标:累计 / 单会话峰值 Token、最长聊天时长、当前 / 最长连续天数
- Token 活动热力图:每日(GitHub 贡献图)/ 每周(柱状)/ 累计(折线)三视图,悬浮看数值
- 活动洞察(含最常用模型)+ 插件 / Skill Top5:谁在消耗最多,一目了然
- 两个原生入口,与 DSH UI 融为一体:
- 侧边栏底部「Token 统计」按钮(应用级常驻)
- 会话头部实时用量胶囊:
⚡ 2.61亿(每 5 秒自动刷新)
- 深空紫双主题,跟随系统 / 手动切换

为什么值得装
- 一眼看清 Token 去向:累计、单会话峰值、每日热力图,不用再猜
- Codex 用户零学习成本:熟悉的用量页风格,界面一看就懂
- 天然的传播素材:大家都喜欢晒"我今天用了多少 token",截一张图发出去,就是最好的宣传
安装
插件依赖 DSH 内置包(@deepseek-ai/*),放进 DSH 仓库即可自动解析,无需额外安装。
方式一:让 Agent 一句话装好(推荐)
把下面这句话发给你的 DSH Agent,它会自己读这个仓库的说明并完成安装:
你看一下这个仓库:https://github.com/jiamuAi/dsh-token-usage ,然后帮我把 dsh-token-usage 安装到我的 DSH 上。
方式二:手动装
git clone https://github.com/jiamuAi/dsh-token-usage.git
cp -R dsh-token-usage <你的deepseek-harness路径>/packages/extensions/
cd <你的deepseek-harness路径> && pnpm install && pnpm run build:lib
<你的deepseek-harness路径>= DSH 源码在你机器上的位置。不知道在哪?终端执行readlink -f $(which dsh)能看到 dsh 的真实路径,往上找deepseek-harness目录就是。
然后编辑 ~/.dsh/profiles/web/package.json,在 dsh.profile.bundles 里加上:
"dsh-token-usage"
最后重启 dsh web,刷新页面即可看到入口。
使用
- 重启后,左侧栏底部出现「Token 统计」入口
- 打开任意会话,标题旁出现实时用量胶囊
⚡ 2.61亿 - 点击任一入口打开面板;右上角可切主题、关闭
- 热力图支持三视图切换 + 悬浮看单日 / 单周 / 累计数值
数据每 5 秒刷新;历史会话自动回填,重启不丢。
数据口径
与 DSH 内置 token-meter 一致:
- 每 step 一条 usage 记录:
assistant/chunk {type:'usage'}为持久记录;assistant/message.usage覆盖同一步的 chunk 记录(不重复计数) - 累计 Token = input + output + cacheRead + cacheWrite
- thinking 等级由
reasoningTokens近似;Skill 统计从skill工具调用参数解析
架构
┌─ Host(DSH 进程内)──────────────────────────────┐
│ TokenUsageService (TypertRemoteService) │
│ ├─ 启动时回填全部历史 session │
│ ├─ session/event 实时折叠 │
│ └─ @Remote('getStats') → /api/tokenUsage/getStats│
└──────────────┬───────────────────────────────────┘
│ connection.rpc(通用通道,无需改 DSH)
┌─ Browser ────▼───────────────────────────────────┐
│ ├─ sidebar.footer.action 侧栏入口 │
│ ├─ conversation.session.header.actions ⚡ 胶囊 │
│ └─ shell.overlay 面板模态框 │
└──────────────────────────────────────────────────┘
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
wssfk12138/dsh-damage-pulse
Ychris12138/dsh-usage-stats
JingbiaoMei/Tokdash
yxxbc/dsh-balance-plugin
feiyang-dev/dsh-usage-plugin
LaoYueHanNi/dsh-token-usage
lanlandeli/dsh-usage-stats
Shiye-10Pages/dsh-whale-meter