Make0209/dsh-usage-stats
DeepSeek Harness 插件:GitHub 风格用量热力图 + Token / 缓存命中 / 账户余额看板 + 工作区别名管理。
Project Overview项目介绍
This is a native plugin built exclusively for DeepSeek Harness (DSH), adding comprehensive usage tracking and analytics functionality to the DSH web client. The plugin supports two installation methods: the recommended approach is using the official DSH plugin command dsh plugin --profile web add dsh-usage-stats, which handles installation automatically. For users who want to run a local development version, they can manually register the plugin by creating a junction link in the DSH node modules directory and adding an entry to the cordis patch configuration. After either installation method, users only need to refresh the DSH web page to start using the plugin, no additional configuration or DSH restart is required.
Once activated, the plugin automatically pulls historical usage data from DSH's persistent session logs, so no manual data import is needed on the first run. It adds a dedicated analytics page to DSH's settings panel, where users can view the contribution-style heatmap, check aggregated statistics, and manage custom aliases for their workspaces. The heatmap works like GitHub's contribution graph, tracking usage over 53 weeks and updating after each completed conversation turn. Users can hover over any date to see a breakdown of usage by workspace, including total tokens and session counts for that day.
The plugin has no external third-party dependencies, which keeps its installation size small and avoids unnecessary dependency conflicts with other DSH components. The host side only uses built-in Cordis services from DSH, and the client side only uses the React framework that is already provided by DSH's internal module system. All usage data is sourced from DSH's local session logs, so existing usage data remains intact even if the plugin is restarted or uninstalled. It is released under the permissive MIT open source license for free use and modification.
这是一个专为 DeepSeek Harness 开发的原生插件,为 DSH 提供用量统计相关功能。它包含 GitHub 风格的 53 周用量热力图,每完成一次对话回合就会点亮对应日期,支持悬停查看按工作区分的次数明细和当日 Token 消耗。此外还提供多维度统计看板,涵盖 Token 消耗、缓存命中率、DeepSeek 账户余额等指标,同时支持工作区别名管理功能。
该插件可以通过 DSH 官方插件命令一键安装,也支持手动本地注册安装,安装后仅需刷新页面即可使用,无需手动修改配置或重启 DSH 程序。它会自动读取 DSH 持久化存储的历史会话日志,自动回填所有历史用量数据,适合需要统计自身 DeepSeek 用量、跟踪 Token 消耗和账户余额的 DSH 用户使用。
该插件没有额外第三方依赖,宿主端仅依赖 DSH 的 Cordis 服务,前端客户端仅依赖 DSH 内置提供的 React 模块。所有数据都存储在 DSH 的本地持久化会话中,卸载插件不会丢失原有数据,仅统计归属到已注册工作区的会话,采用 MIT 许可证开源,可免费使用和修改。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-usage-stats(Make0209/dsh-usage-stats)
仓库:https://github.com/Make0209/dsh-usage-stats
本站详情页:https://www.yhbd.top/plugins/make0209-dsh-usage-stats/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 26 · 最近提交 2026-08-14 · 主语言 JavaScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【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 更稳。
- 26 stars - an early-stage project星标 26,属于早期项目
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 dsh-usage-stats
把 Make0209/dsh-usage-stats 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-usage-stats
DeepSeek Harness 插件:GitHub 风格用量热力图 + Token / 缓存命中 / 账户余额看板 + 工作区别名管理。
- 热力图:53 周 GitHub 绿,每完成一个回合点亮;悬停按工作区显示次数明细与当日 Token
- 统计卡片:总花费 Token(分项)、缓存命中率、账户余额(DeepSeek 官方接口)、总使用次数、连续使用、各工作区 Token 进度条
- 工作区别名:头部「✎ 工作区别名」管理,持久化保存(
$DSH_HOME/storages的 KV 单元usage-stats-aliases) - 时间范围切换(近 30 天 / 近 90 天 / 全部)、动画、亮暗主题自适应
效果截图


安装
本插件是标准的 DSH 社区插件包(声明 dsh.bundle manifest + web client 半),数据全部来自持久化会话日志,安装后自动回填历史。
方式一:官方插件命令(推荐)
dsh plugin --profile web add dsh-usage-stats
安装后刷新页面即可,无需手动改配置、无需重启。
方式二:手动注册(本地包)
- 把本目录放入任意位置,并在
$DSH_HOME/profiles/node_modules/下创建指向本目录的符号链接(Windows 用 junction):New-Item -ItemType Junction -Path "$env:DSH_HOME\profiles\node_modules\dsh-usage-stats" -Target "<本目录绝对路径>" - 在
$DSH_HOME/profiles/web/cordis.patch.yml添加一行:
用户 patch 层会被热重载:保存后刷新页面即可。- insert: - id: usage-stats name: dsh-usage-stats
架构
- Host 半(
lib/index.js):扫描持久化会话日志聚合用量(turn/end+assistant/message.usage),监听session/event实时折叠;通过webServer服务注册数据路由:GET /api/usage-stats— 统计快照GET /api/usage-stats/balance?force=1— 账户余额(复用llm-deepseek的 API Key 配置)POST /api/usage-stats/alias— 设置工作区别名
- Client 半(
lib/client.js):window.__ModuleLoader__工厂格式的浏览器 bundle,注册设置面板「用量统计」页(settings.section槽位)。
数据说明
- 使用次数与 Token 全部来自 DSH 持久化会话日志,插件激活时会自动回填全部历史,插件卸载/重启后数据不丢
- 余额查询走 DeepSeek 官方
/user/balance接口;未配置 API Key 时卡片显示引导文案 - 仅统计能归属到已注册工作区(按会话 cwd 匹配)的会话
开发
- 修改
lib/index.js/lib/client.js后刷新页面即生效(client bundle 随页面加载);host 半改动通过重启 DSH 生效 - 插件包无第三方依赖:host 半只使用 Cordis 服务,client 半只使用 react(模块表提供)
License
MIT
Hou-DL/dsh-token-pulse
banlanzs/dsh-web-enhanced
edison7009/EchoBird
edonadei/caliper
zhu168/dsh-save-money
HaoyueQin/dsh-usage-statistics-panel
133563825as-ai/dsh-api-dashboard