lanlandeli/dsh-usage-stats 预览 preview

lanlandeli/dsh-usage-stats

DeepSeek Harness 使用统计插件|Token 总量与构成、7/30 天趋势、年度活跃热力图、模型占比、工作区/任务筛选、CSV/JSON 导出

Project Overview项目介绍

This is a lightweight native usage statistics plugin built specifically for the DeepSeek Harness (DSH) Web UI. It tracks and visualizes your token usage across all your DeepSeek Harness sessions, with features that show total token count, daily usage trends, active dates, and distribution across different models. You can install it directly via the DSH CLI with the command dsh plugin --profile web add dsh-usage-stats, and it integrates via DSH’s official extension API without modifying core DSH files or official npm packages. All usage data is stored locally on your machine, so you don’t have to worry about data being sent to external third-party servers.

After installing the plugin and restarting your DSH Web Profile, a new "Usage Stats" entry will appear above the Settings option in your DSH sidebar. The plugin includes multiple useful modules: an overview dashboard, daily trend charts, an activity heatmap for the past year, a detailed call log with filtering, and data export tools. You can filter your statistics by workspace, main task, or sub-task to narrow down your usage, and export data as CSV or JSON for offline archiving or custom analysis. This plugin is ideal for DSH users who want to track their token consumption and manage usage costs effectively.

The plugin requires Node.js version 22.19 or newer, and has been tested to work with DSH version 0.1.0-rc.6 for both the web UI and desktop builds that ship with the web UI. It automatically adapts to your DSH theme (light or dark) and language setting (Chinese or English), so it fits seamlessly into your existing DSH workflow and setup. It is released under the open source MIT license, and does not store any sensitive user data like prompt text, API keys, or response content, keeping your usage data private and secure.

dsh-usage-stats 是专为 DeepSeek Harness Web UI 开发的原生轻量使用统计插件,核心功能是集中展示用户的令牌使用总量、每日使用趋势、活跃日期分布和不同模型的使用占比。它通过 Harness 官方扩展接口集成,不会修改官方 Web UI 或 npm 包,所有统计数据都保存在用户本地。

安装完成后重启 Web 配置文件,就能在侧边栏「设置」选项上方找到「使用统计」入口。用户可以通过工作区、主任务或子任务筛选统计范围,也支持将统计数据导出为 CSV 或 JSON 文件,方便归档和进一步分析。适合需要跟踪令牌使用情况、管控使用成本的 DeepSeek Harness 用户使用。

该插件要求 Node.js 版本不低于 22.19,已经在 DeepSeek Harness 0.1.0-rc.6 版本完成测试,支持浅色和深色主题,自动适配 Harness 的语言设置。它采用 MIT 许可证开源,不存储用户提示词、API 密钥等敏感信息,保障用户隐私安全。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 note1 项提示
  • 11 stars - an early-stage project星标 11,属于早期项目
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

把 lanlandeli/dsh-usage-stats 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

📊 dsh-usage-stats

English

DeepSeek Harness Token 使用情况,一目了然。

npm version npm downloads CI Node License

dsh-usage-stats 是面向 DeepSeek Harness Web UI 的轻量使用统计插件,用于集中展示 Token 总量、每日趋势、活跃日期及模型分布。

插件通过 Harness 提供的扩展接口集成,不修改 Web UI 或官方 npm 包。统计数据保存在本机。

dsh plugin --profile web add dsh-usage-stats

重启 Web Profile 后,侧边栏「设置」上方会出现 使用统计。

更新或卸载:

dsh plugin --profile web update dsh-usage-stats
dsh plugin --profile web remove dsh-usage-stats

🎬 效果演示

使用效果演示

🖼️ 界面截图

查看浅色主题

浅色主题

查看深色主题

深色主题

✨ 功能概览

模块 说明
📈 使用概览 展示 Token、会话、消息、活跃天数、连续使用天数及最常用模型的历史累计值
📊 每日趋势 展示最近 7 天或 30 天的 Token 变化,悬停可查看指定日期的模型用量
🔥 活跃热力图 以颜色深度表示一年内各日期的 Token 用量,悬停可查看 Token 数量及调用轮次
🎯 范围筛选 支持按工作区、主任务或子任务限定统计范围
📋 调用明细 查看单次调用的耗时、Token、缓存率、模型与思考程度,支持筛选与分页
💾 数据导出 支持导出 CSV 或 JSON,用于归档或进一步分析
🌐 中英文界面 自动跟随 Harness 的语言设置切换中文或英文
🎨 主题适配 自动跟随 Harness 的浅色或深色主题
⚡ 轻量运行 无第三方图表库、无后台轮询,减少额外的网络请求与运行开销

✅ 已修复

官方模块重复安装风险

0.1.16 将插件使用的 DeepSeek Harness 官方模块统一声明为对等依赖,避免 Profile 内出现插件私有副本及模块身份分裂。发布检查会阻止官方模块再次进入普通依赖。

子任务继承上下文重复计入

0.1.13 修复了 fork 子任务将父会话继承上下文重复计入自身用量的问题。子任务现在只统计自身产生的调用;升级后,旧版统计缓存会自动失效并按新口径重建。

⚙️ 配置

config:
  indexConcurrency: 2
  cacheWriteDelayMs: 1000
  apiPath: /usage-stats/v1

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-cline-free-provider 下一个 Next zen-useragent →