jelly-000/dsh-balance-monitor
DeepSeek 账户余额、剩余比例条与今日花费,显示在 dsh 侧边栏底部。
Project Overview项目介绍
This is a DSH-native plugin that adds a UI component to DSH’s sidebar footer to display balance, quota, and usage information for multiple AI LLM providers. It automatically pulls already configured providers from DSH’s settings, eliminating the need for duplicate key entry. It can be installed directly with a single DSH CLI command: dsh plugin --profile web add "github:jelly-000/dsh-balance-monitor#main", after which you just need to restart the DSH web UI to activate it. The UI matches DSH’s native design system and automatically switches between Chinese and English to match DSH’s language setting. No third-party build tools are required for installation or modification.
The plugin ships with 14 preconfigured major LLM vendors including DeepSeek, Zhipu, Moonshot Kimi, OpenAI, Anthropic, OpenRouter, and xAI. It supports switching between different billing modes (such as Coding Plan subscriptions vs pay-as-you-go API) for the same vendor via an in-line UI toggle. If a vendor does not expose a public billing or balance API, the plugin falls back to calculating actual usage from DSH’s local session logs. Users can also add custom OpenAI-compatible gateways via an agent tool call or manual configuration. It prioritizes manual overrides followed by DSH-inferred mode based on provider base URL.
All API keys remain on the DSH server side, and only aggregated numeric usage snapshots are sent to the browser UI, matching DSH’s existing security model. The plugin includes a full Token activity dashboard with a 52-week contribution-style heatmap, daily usage trend lines, and per-model usage breakdowns from local session logs. It caches parsed session data to speed up repeated loads, with a cold scan taking about 2 seconds and cached loads taking around 300 milliseconds. The plugin is open source under the MIT license, with no external runtime dependencies or required build tools for modification or development.
dsh-balance-monitor 是专为 DeepSeek Harness (DSH) 开发的原生插件,可在侧边栏底部集中展示多个 AI 平台的账户余额、配额与用量情况,同时提供基于本地会话日志的 Token 热力图活动看板。插件会自动识别 DSH 中已配置接入的模型提供商,支持同一厂商不同计费模式切换,厂商未开放余额接口时会自动退化为本地实测用量统计。
它内置支持 DeepSeek、智谱、月之暗面、OpenAI、Anthropic 等 14 家厂商,允许用户通过 agent 调用或手动配置添加自定义的 OpenAI 兼容网关。所有 API 密钥仅存储在 DSH 服务端,浏览器仅获取用量数据的数字快照,界面会自动跟随 DSH 语言设置切换中英双语。
它提供基于本地会话日志的 52 周 Token 热力图、每日趋势图和模型用量统计,带缓存扫描功能可加速后续加载。插件无外部构建依赖,可直接通过 DSH 插件 CLI 命令安装,以 MIT 开源许可证分发,完全符合 DSH 的设计规范和安全机制。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-balance-monitor(jelly-000/dsh-balance-monitor)
仓库:https://github.com/jelly-000/dsh-balance-monitor
本站详情页:https://www.yhbd.top/plugins/jelly-000-dsh-balance-monitor/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 9 · 最近提交 2026-08-28 · 主语言 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 更稳。
- Only 9 stars - very few users, little community feedback星标只有 9,几乎没人在用,遇到问题缺少社区反馈
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:jelly-000/dsh-balance-monitor
把 jelly-000/dsh-balance-monitor 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
English | 简体中文
dsh-balance-monitor
dsh-balance-monitor 是一个 DeepSeek Harness (dsh) 插件,在侧边栏底部集中展示多个 AI 平台的余额、配额与用量,并提供基于本地会话日志的 Token 热力图看板。
插件按厂商逐行堆叠,每行展示剩余额度、剩余比例条、已用量与当日支出。同一厂商同时提供 Coding Plan(订阅套餐)与 API 按量两种计费方式时,可通过行内的模式圆点在两种口径之间切换;厂商未开放余额或计费接口时,自动退化为 DSH 本地实测用量。界面样式基于官方设计令牌,力求克制内敛。
背景:DeepSeek 调价后,用户可能需要切换至智谱等平台,而原插件仅支持 DeepSeek 单一平台。本插件以平台适配器注册表为骨架,动态对接已配置密钥的厂商,并自动纳入 DSH 已接入的 provider。
功能特性
| 功能 | 说明 |
|---|---|
| 多厂商堆叠 | 单张卡片自上而下逐厂商一行,展示名称、余额、比例条与已用量 |
| Coding Plan / API 切换 | 每行的模式圆点(绿 = Coding Plan,灰 = API 按量)展开浮层菜单,切换即写入配置并即时返回新快照,无需编辑文件 |
| 自动跟随 DSH | 读取 settings.yaml 中的 llm-pi-ai.providers,自动补入 DSH 已接入的 provider,并通过 baseUrl 反查厂商、推断计费模式 |
| 本地实测用量 | 厂商未开放余额接口(智谱 API、b.ai、百炼、方舟、小米等)时,改以 DSH 会话日志中的实测 token / 请求数展示 |
| Token 活动看板 | 统计条(累计、峰值、最长聊天、当前 / 最长连续)+ 52 周 token 热力图(每日 / 每周 / 累计三档)+ 近 7 日 / 近 30 日范围切换下的每日趋势图与模型用量卡(对标 ZCode 使用统计),底部保留厂商明细表 |
| 适配器类型 | balance(真实余额)、quota(滚动窗口配额,多窗口分行展示)、cost(近 30 天费用);另有 local(本地实测) |
| 配额取紧约束 | 多窗口时标题展示最紧张的窗口(如 5 小时已重置而本周已满,显示 0% 并倒计时至本周重置) |
| 当日支出 | 余额型平台按日记录基线(持久化到状态文件),支出 = 基线 − 当前值;充值不会导致负数 |
| 通用自定义 | 通过 agent 调用 balance_monitor 的 addCustom 接入任意 OpenAI 兼容网关,或直接写入 $DSH_HOME/.credentials.yaml |
| 收起态圆点 | 侧边栏收起至 36px 后,每厂商显示一个圆点(绿 / 琥珀 / 红按剩余量着色),悬停 tooltip 列出各厂商、数值及当前模式 |
| 位置 | 注册于官方 sidebar.footer.action 槽位,位于设置上方 |
| 健壮性 | 60 秒轮询,切回标签页立即刷新;上游失败时保留上次数据并标记为 stale,不闪错误 |
| 双语 | 跟随 dsh 界面语言(navigator.language)自动切换中 / 英 |
| 安全 | API Key 仅存于服务端,浏览器只获取数字快照 |
支持的平台
内置 14 家厂商,各家声明所支持的计费模式;同一密钥的两种模式共用,切换仅改变展示口径:
| id | 显示名 | 环境变量 key | 模式 |
|---|---|---|---|
| deepseek | DeepSeek | DEEPSEEK_API_KEY |
API 按量(余额 ¥) |
| zhipu | 智谱 GLM | ZHIPU_API_KEY |
Coding Plan 配额(积分窗口)· API 按量(本地实测) |
| zai | Z.ai(GLM 国际站) | ZAI_API_KEY |
Coding Plan 配额 · API 按量(本地实测) |
| moonshot | Kimi / 月之暗面 | MOONSHOT_API_KEY |
Kimi For Coding 配额(5h + 周)· API 余额 ¥ |
| minimax | MiniMax | MINIMAX_API_KEY |
Coding Plan 配额 · API 按量(本地实测) |
| stepfun | 阶跃星辰 | STEPFUN_API_KEY |
API 余额 ¥ |
| dashscope | 阿里百炼 Qwen | DASHSCOPE_API_KEY |
API 按量(本地实测) |
| volcengine | 火山方舟 Doubao | ARK_API_KEY |
API 按量(本地实测) |
| xiaomi | 小米 MiMo | XIAOMI_API_KEY |
API 按量(本地实测) |
| siliconflow | 硅基流动 | SILICONFLOW_API_KEY |
API 余额 ¥ |
| openrouter | OpenRouter | OPENROUTER_API_KEY |
API credits $ |
| xai | xAI (Grok) | XAI_API_KEY |
API credits $ |
| openai | OpenAI | OPENAI_API_KEY |
API 近 30 天费用 $ |
| anthropic | Anthropic | ANTHROPIC_API_KEY |
API 近 30 天费用 $(需 Admin key) |
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
edison7009/EchoBird
Han-1413141/dsh-cost-meter
Ychris12138/dsh-usage-stats
Aisland-SJL/dsh-usage
wink-run/tokenbank
JingbiaoMei/Tokdash
slywalker2006/dsh-passwords
songoao25/dsh-bottom-info-bar