jiangli07/dsh-deepseek-quota-bar
用于DSH Web GUI的DeepSeek API配额血条组件:显示剩余余额与月初对比、今日/本月花费、会话成本。可拖拽且可折叠。
Project Overview项目介绍
dsh-deepseek-quota-bar is a native plugin built exclusively for the DeepSeek Harness (DSH) web GUI. It adds a draggable floating widget to the bottom-right corner of the DSH web interface that visualizes your remaining DeepSeek API quota as a color-coded "blood bar". The bar changes color based on your remaining percentage: green for 50% or more remaining, orange for 20% to 50%, and red for less than 20% remaining. It also supports adjustable background transparency, one-click folding to a mini version, automatic refresh every 60 seconds, and automatically matches DSH’s light or dark theme.
This plugin is built for DSH users who use DeepSeek API and want to keep track of their quota and spending without leaving the DSH web interface. After installation, the widget loads automatically every time you open the DSH web GUI, and updates in real time as you make API calls through DSH. It displays today’s and this month’s total spending, and if you add an optional DeepSeek platform token to your DSH credentials, it pulls official exact usage data directly from DeepSeek’s platform. Without the token, it automatically falls back to estimating usage via balance differences.
To install the plugin, you run a single command via the DSH CLI: dsh plugin --profile web add dsh-deepseek-quota-bar, then restart the DSH web server and hard refresh the browser page to load the widget. It reuses the DeepSeek API key you already configured in DSH, so no extra configuration is required for basic usage. Any changes to your credentials are read hot, so you do not need to restart DSH after adding the optional platform token. The plugin is released under the open source MIT license, and builds on work from other open source MIT licensed DSH quota projects.
这是一个专为 DeepSeek Harness (DSH) 网页端开发的原生插件,会在网页右下角添加一个悬浮卡片组件,以「血条」形式直观展示 DeepSeek API 的剩余额度占本月初始额度的比例。血条会根据剩余比例变色:剩余≥50%为绿色,≥20%为橙色,低于20%为红色。它还支持调节透明度、拖动位置、折叠收起,会跟随网页浅色/深色主题,余额每60秒自动刷新,也支持手动刷新。
插件除了显示余额比例,还会展示今日和本月的累计使用量,如果配置了 DeepSeek 平台令牌,会拉取官方精确数据;如果没有配置,则自动通过余额差值估算使用量。它还会实时计算当前对话的费用,按照 DeepSeek 官方峰谷定价表计算,包含安装前的历史对话记录,同时会提示当前是否处于高峰时段,显示当前模型单价和距下一时段切换的倒计时。
安装通过 DSH CLI 完成,执行 dsh plugin --profile web add dsh-deepseek-quota-bar 即可,安装后重启 DSH 网页端并强刷页面就能看到插件。配置只需要和 DSH 共用已填写的 DeepSeek API 密钥,平台令牌为可选项,凭证支持热读取,配置后无需重启即可生效。插件基于 MIT 许可开源,分叉自另一个 MIT 许可的 DSH 配额项目,定价逻辑参考了开源的计费项目。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-deepseek-quota-bar(jiangli07/dsh-deepseek-quota-bar)
仓库:https://github.com/jiangli07/dsh-deepseek-quota-bar
本站详情页:https://www.yhbd.top/plugins/jiangli07-dsh-deepseek-quota-bar/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 4 · 最近提交 2026-09-18 · 主语言 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 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
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-deepseek-quota-bar
把 jiangli07/dsh-deepseek-quota-bar 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-deepseek-quota-bar
DeepSeek API 额度血条插件 for DeepSeek Harness (dsh) web GUI: 右下角悬浮卡片,血条直观显示「余额 / 本月额度」,并展示今日与本月使用量(官方数据优先)。
A floating bottom-right widget for the dsh web GUI: a blood-bar of your remaining DeepSeek API balance vs the month-opening balance, plus today's and this month's spend (official platform data when configured).

功能 Features
- 🩸 血条:剩余比例 = 当前余额 / 月初余额快照(≥50% 绿 / ≥20% 橙 / <20% 红)
- 📅 今日/本月使用量:配置
DEEPSEEK_PLATFORM_TOKEN后为官方精确数据;未配置时自动降级为余额差值估算 - 💬 当前对话费用:按官方价格表对会话日志逐条计价(每条消息按当时的政策与峰谷状态),含安装前历史
- 🕐 峰谷时段提醒:时段徽标(工作日 09:00-12:00 / 14:00-18:00 为高峰,周末全天低谷)+ 距下次切换倒计时 + 当前模型单价(Flash/Pro 点击切换)
- 📈 官方政策自动跟随:单价由宿主按官方政策时间表(含 2026-08-17 峰谷、08-23 周末低谷、09-10 flash 降价)实时计算,价格调整无需更新插件
- ⚙️ 可调透明度:设置按钮 + 滑块(0-100%),背景不透明度可调并持久化
- 🖱️ 可拖动:按住卡片任意位置拖动,位置持久化(localStorage)
- 📉 可折叠:一键折叠为只显示血条的迷你卡,再点展开
- 🌗 跟随浅色/深色主题
- ⏱️ 余额每 60s 自动刷新,支持手动刷新
安装 Install
dsh plugin --profile web add dsh-deepseek-quota-bar
# 或从 GitHub 安装:
dsh plugin --profile web add github:jiangli07/dsh-deepseek-quota-bar
安装后重启 dsh web,打开页面强刷(Ctrl+Shift+R),右下角出现卡片。
配置 Configuration
| 凭证 | 必需 | 说明 |
|---|---|---|
DEEPSEEK_API_KEY |
✅ | 与 harness 同一个 Key(设置 → 模型 页面填写) |
DEEPSEEK_PLATFORM_TOKEN |
可选 | platform.deepseek.com 的 userToken:F12 → Console → 执行 JSON.parse(localStorage.getItem('userToken')).value,把值写入 ~/.dsh/.credentials.yaml |
凭证是热读取的:配置后无需重启,下一次刷新即生效。
工作原理 How it works
- 余额:
GET https://api.deepseek.com/user/balance - 今日/本月(官方):
GET https://platform.deepseek.com/api/v0/usage/cost?month=&year=(与平台控制台同源) - 今日/本月(估算兜底):月初/当日期初余额快照差值,状态持久化于
~/.dsh/storages/deepseek-quota-bar.json - 血条分母:本月 1 号首次观测到的余额快照;月中新装时用「当前余额 + 本月官方消耗」反推
- 对话费用:订阅
session/event实时计价 + 持久化日志全量回放(含重启前历史)
开发 Development
git clone https://github.com/jiangli07/dsh-deepseek-quota-bar.git
cd dsh-deepseek-quota-bar
dsh plugin --profile web add .
注意:修改 lib/client.js 后需重启 dsh web(bundle 引导哈希重新生成)再强刷页面。
许可 License
MIT。Fork 自 yingjunnan/dsh-deepseek-quota(MIT); 定价引擎参考 dsh-web-billing(MIT)。
lssyd20070106/dsh-ui-preset-enhance
Jolly-J/dsh-deepseek-billing
jLeon-account/dsh-client-usage
boNeXY226/dsh-cost-chip
MeteorNOX/DeepSeek-Balance-Whale-Widget