deepforce/dsh-balance

DSH插件:/balance命令,composer-dock余额显示及充值链接,会话费用估算

Project Overview项目介绍

This is a native DeepSeek Harness (DSH) plugin that adds real-time DeepSeek account balance tracking and usage cost estimation to DSH. It ships with a slash command /balance and a native web GUI component that displays balance right in the composer dock area under the conversation input. To install the plugin, you can run the dsh plugin --profile web add github:deepforce/dsh-balance command after setting up DSH, or add it as a patch overlay via a custom cordis config file. After installation, you need to restart the dsh web service to load the plugin correctly.

Once installed, you can type /balance in the DSH session composer to get a full breakdown of your current DeepSeek account balance, including total, topped-up, and granted balance. In the web GUI, the stats area below the composer displays a compact balance reading that updates automatically, and you can hover over it to see the split between topped-up and granted balance. There is also a manual refresh button and a direct link to the DeepSeek top-up page right in the GUI component. The plugin also estimates your current session spending based on token usage and DeepSeek's pricing tiers.

The plugin follows strict security practices: your DeepSeek API key is never stored in the plugin configuration, hard-coded, or exposed to the browser frontend. It is resolved per request via DSH's credential service or environment variable and never leaves the DSH host process. You can configure multiple settings via the plugin config, including the API key environment variable name, API base URL, request timeout, model for cost estimation, peak/off-peak pricing, and the number of days to show in the daily spending chart. The plugin is released under the permissive MIT license, and has been tested against DSH version 0.1.0-rc.6.

这是一款面向 DeepSeek Harness(DSH)的原生插件,用于查询 DeepSeek 账号的实时余额并估算当前会话和近期的使用成本。它提供了 /balance 斜杠命令和 Web GUI 端的组合dock余额读数模块,调用 DeepSeek 官方接口返回总余额、充值余额和赠金余额。API 密钥通过 DSH 的凭证服务解析,不会写入配置或暴露给前端浏览器。

用户可以在会话输入框输入 /balance 命令获取完整的余额明细,也可以直接在 Web 界面的统计区域查看简洁的余额读数。鼠标悬浮余额读数可以查看充值和赠金的拆分,还提供跳转至 DeepSeek 充值页面的链接和手动刷新按钮。插件同时会估算当前会话的花费,并展示近几日的日花费柱状图,方便用户追踪使用成本。

支持通过 dsh plugin 命令一键安装,也可以使用 patch 叠加方式安装。该插件已经在 DSH 0.1.0-rc.6 版本测试通过,使用 MIT 许可证开源。用户可以通过配置文件调整价格模型、高峰时段倍率、API 端点、超时时间和历史统计天数等参数,适配自己的使用需求。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
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:deepforce/dsh-balance

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

READMEREADME

dsh-balance

English | 中文

A DeepSeek Harness plugin that adds a /balance slash command and a composer-dock balance readout to the web GUI, querying the DeepSeek account balance live.

It calls DeepSeek's official Get User Balance endpoint and returns the total, topped-up, and granted balance per currency. The API key is resolved through the credential seam (ctx.credentials) or the environment on every call — it is never written into configuration, into the returned text, or into the browser.

Features

  • /balance — human slash command that prints the full balance breakdown in the session.
  • Web GUI readout — the conversation stats area (below the cache-hit figure) shows a compact Balance: ¥… line with hover details (topped-up / granted), a Top up link to the DeepSeek platform top-up page, a manual refresh button, and an estimated Session ≈ ¥… spend figure (hover shows the token buckets × unit prices). The readout copy is bilingual and follows the active dsh language (Chinese / English). The browser fetches the host's /dsh-balance route; the API key never leaves the host.
  • Daily-spend chart — hovering Last {days}d ≈ ¥… floats a comic speech bubble upward from the summary: a titled SVG bar chart of the last usageDays days' estimated spend, with a Y axis of ¥ ticks, an X-axis date per bar, and per-bar hover details (date, amount, request count, tokens). Moving away closes it. Data comes from the host's /dsh-usage route, which folds assistant/message usage across persisted sessions, pricing each request at the tier in effect at its own time.

Session-cost estimate

The Session ≈ ¥… figure prices the session's cumulative token usage — the same tokenUsage projection the cache-hit stat reads — at DeepSeek's published per-million-token rates (peak/off-peak, selected by the current Beijing time). It is an estimate, not a billing record: the model used is the configured estimateModel (not per-request model selection), and cache-write tokens are unpriced. Prices can be adjusted through the offpeakPrices / peakMultiplier / peakWindows config fields.

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-tool-hashline 下一个 Next keyringseam →