把每台机器的 token 用量上报给你自己托管的团队服务器:一次性绑定码、离线落盘队列、幂等重放,管理员在一处看到全员用量与成本。
安装
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:CHENKEYI-MAKER/dsh-team-reporter
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
A DeepSeek Harness (dsh) plugin that reports
this machine's real token usage to a team dashboard you run yourself, so a team can see its own
usage and cost in one place.
What it does
- Collects one record per model call, from the host's
session/eventstream —input_tokens,cache_read_tokens,output_tokens, the model name, and the project directory. Reasoning tokens are already included inoutput_tokensand are not counted separately. - Queues records on disk, so usage survives a restart or a network outage and is replayed later. Records are idempotent, so a replay cannot double-count.
- Sends only token counts and cost. It never sends prompts, replies, file contents, or credentials.
- Syncs the skills your team publishes: the server is the authority, the plugin pulls the whole library every 30 minutes and swaps it in atomically. A failed sync never removes what is already on the machine. You can also write your own skill and submit it for review from the panel.
Install
Download the tarball and point the plugin page at the local file — this is the only route that works without npm, without GitHub, and without a terminal:
- Get
dsh-team-reporter-0.2.0.tgzfrom your team's download page (or from the Releases tab here). - DSH → sidebar 插件 → 添加插件 → paste the file's absolute path → Install.
- Restart DSH.
# CLI equivalent (the path must be absolute; a relative path is rejected by pnpm)
dsh plugin --profile desktop add "C:\Users\you\Downloads\dsh-team-reporter-0.2.0.tgz"
Neither of these works, and both were tested:
| Command | What happens |
|---|---|
add dsh-team-reporter |
Not published to npm → ERR_PNPM_FETCH_404 |
add github:CHENKEYI-MAKER/dsh-team-reporter |
pnpm rewrites it to git+ssh:// → Permission denied (publickey) unless you have GitHub SSH keys |
add https://<your-server>/dl/….tgz |
pnpm 11 only skips the integrity check for file: and a few git hosts → ERR_PNPM_MISSING_TARBALL_INTEGRITY |
add https://github.com/CHENKEYI-MAKER/dsh-team-reporter.git does work, but it needs GitHub access.
Restart DSH. A grey dot appears in the bottom-right corner — open it, enter your team server URL and the enrollment code your administrator gave you, and click 绑定 (Bind). The dot turns green and reporting starts.
A code is single-use and belongs to one person. Reinstalling or moving to a new machine needs a new code from your administrator.
Skills
The plugin keeps two directories strictly apart:
| Directory | Owner |
|---|---|
~/.dsh/skills/dsh-team/ |
the server — replaced wholesale on every sync |
~/.dsh/skills/my-skills/ |
you — the sync logic never touches it |
Put your own skills in my-skills/, then submit them for review from the team panel
(团队版 → 我写的技能 → 提交审核). Anything that looks like a credential, a public IP, or a
local absolute path is rejected at submission time and cannot be approved by an administrator either.
Configuration
The plugin learns everything else from the server's /api/v1/config endpoint — the price table used
for local cost estimates and the flush interval. Nothing needs to be configured locally.
Requirements
- Node.js >= 22.5.0
- A team server you or your administrator run (this plugin only talks to the URL you enter)
Privacy
Token counts and a hash of the session id are the only things that leave the machine. The workspace field is the project directory's name, not its full path.
链接
同类插件
bowenliang123/dsh-context★ 2207
DSH 上下文洞察面板:Context 仪表盘 + /context命令 + Context 浏览器,查看 Context的分类组成、内容详情、演进趋势、压缩/注入事件、统计等一站式 Context 全生命周期管理。
Han-1413141/dsh-cost-meter★ 435
会话与当日 API 费用统计、预算图框(已用%)、官方余额、历史看板,支持峰谷计价与官方价格一键同步。
wssfk12138/dsh-damage-pulse★ 265
在 DSH Web 界面追踪 DeepSeek Token 用量、单次与会话费用及账户余额,并显示缓存感知的扣费动画。
zh667/TokenLedger★ 202
侧边栏用量面板:把 Token 归属到实际服务该请求的中转站,站点从已有的 provider 配置中读出,无需额外配置;含今日/本月/累计三窗口、按站点与模型下钻、一年活跃度热力图,以及 New API / Sub2API / DeepSeek 余额。
Ychris12138/dsh-usage-stats★ 175
多供应商用量看板:按供应商/模型统计 Token 与日期下钻,统一展示账户余额,并追踪 OpenCode Go / Z.ai 订阅额度。
PolinniZhong/dsh-personal-center★ 118
DeepSeek Harness 个人中心:跨会话用量统计、按模型成本估算、全局自定义指令、外观全局字号、数据驱动的桌面宠物(位图/矢量皮肤)与会话状态概览,纯本地离线运行。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。