dsh-plugin-usage-dashboard
by hnmrxz
在 DeepSeek Harness (dsh) 底部状态栏显示 DeepSeek 用量与估算花费:按会话聚合 token 成本、余额预算告警。
DeepSeek usage & cost dashboard for the DSH bottom status bar: per-session token/cost aggregation with low-bal
安装
dsh plugin --profile web add github:hnmrxz/dsh-plugin-usage-dashboardGitHub 源码安装:首次需按提示配置 allowBuilds 构建授权后重试
安装与环境配置指引、插件开发教程见 DSH 中文社区文档 ↗
安装即在你的机器上以你的权限运行第三方代码——它可读写文件、使用凭据、访问网络,DSH 的工具审批不会为插件代码加沙箱。「检测到 manifest」仅代表发现 dsh.bundle / dsh.plugin 清单,不构成兼容性或安全审查;安装前请审阅源码,不熟悉的插件先在不含密钥的环境试用。
README
目录
在 DeepSeek Harness (dsh) 底部状态栏显示 DeepSeek 用量与估算花费:按会话聚合 token 成本、余额预算告警。
Estimated token cost & usage dashboard for DSH: per-session token/cost aggregation with a low-balance budget alert, right in the bottom status bar.

Features
- 状态栏 chip:
DS ¥12.34 · 估算花费,余额低于阈值时变橙色⚠ 余额偏低 - 悬停查看明细:总花费 / 会话数 / token 数 + 按会话 Top 8 的成本排行
- 每 30 秒自动刷新,点击立即刷新
- 数据完全来自 dsh 自己的投影缓存(
tokenUsage/sessionStats),零核心改动、零运行时依赖 - 余额告警复用
DEEPSEEK_API_KEY凭据(与余额插件同一条链路),无需再配置 - 中英文自动跟随 DSH 界面语言
Install
需要 DSH 0.1.0-rc.x(Web profile)。
1. 安装到 profile
cd ~/.dsh/profiles/web
npm install dsh-plugin-usage-dashboard
# 本地开发:npm install /path/to/dsh-plugin-usage-dashboard
2. 加入 composition
编辑 ~/.dsh/profiles/web/cordis.patch.yml:
- insert:
- id: usage-dashboard
name: dsh-plugin-usage-dashboard
3. 重启 dsh
dsh --profile web
Configuration
无配置项。Key 复用 DEEPSEEK_API_KEY(Models 设置页或环境变量)。
成本为估算值:按 DeepSeek 公开定价(CNY/1M tokens)折算——缓存命中输入 ¥0.5、未命中输入 ¥2、输出 ¥8。如需调整,编辑 lib/index.js 顶部的 PRICE 常量;余额告警阈值 BALANCE_ALERT_THRESHOLD(默认 10 CNY)同理。
How it works
Browser client.js dsh Host process
┌──────────────┐ GET ┌───────────────────────────┐
│ composer.dock│ ───────► │ /dsh-usage │
│ chip │ ◄─────── │ ├─ sessionQuery │
└──────────────┘ JSON │ │ .listSessions() │
│ ├─ sessionProjections │
│ │ .snapshot() │
│ │ (tokenUsage, │
│ │ sessionStats, │
│ │ title) │
│ ├─ credentials.resolve() │
│ └─ fetch /user/balance │
└───────────────────────────┘
Development
lib/index.js # Host half:聚合用量 + 余额告警,注册 /dsh-usage 路由
lib/client.js # Client half:状态栏 chip(__ModuleLoader__ bundle)
License
原始 README: https://github.com/hnmrxz/dsh-plugin-usage-dashboard/blob/master/README.md ↗
同类插件
查看全部 →
dsh-usage-plugin
DeepSeek Harness 用量与消耗插件(dsh-usage)—— 每次调用的 token 用量/缓存命中统计、峰谷计费、余额查询、CSV/JSON/PNG 导出,可经桌面端一键安装或命令行 dsh plugin add 安装。

dsh-whale-report
🐋 鲸鱼记事本 — 你的 Agent 年度报告:从会话事件日志生成日报/周报/月报/年报,任意区间、只读不改写

dsh-balance-meter
输入框 dock 显示 DeepSeek 账户余额与会话花费,自动拉取官方定价,支持高峰/低谷计价。

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

dsh-balance
DeepSeek 余额实时显示插件: 在 dsh Web UI 输入框 下方、命中率/输入输出 token 统计条所在的同一行 , 实时显示:

dsh-balance-monitor
DeepSeek 账户余额、剩余比例条与今日花费,显示在 dsh 侧边栏底部 · DeepSeek balance, remaining-ratio bar and today's spend in the dsh si