hnmrxz/dsh-plugin-deepseek-balance
在 DeepSeek Harness (dsh) 底部状态栏实时显示 DeepSeek 账户余额。
项目介绍Project Overview
dsh-plugin-deepseek-balance 是一款 DSH 插件,在会话输入框下方的状态栏实时展示 DeepSeek 账户余额。核心能力:自动按 30 秒轮询获取总余额、赠送与充值三项,悬停可看明细,遵循 llm-deepseek 适配器的 baseURL 与凭据设置。适用场景:希望随时掌握 DeepSeek 额度消耗的 Web profile 用户。注意事项:需 DSH 0.1.0-rc.x 的 Web profile 才能加载;Key 须通过 DSH 凭据服务或环境变量提供,否则余额项会显示异常。
dsh-plugin-deepseek-balance is a DSH plugin that displays your DeepSeek account balance in the bottom status bar under the composer. Core capability: polls every 30 seconds to show total balance, gifted credits, and top-ups, with a hover tooltip for detail, and reuses the existing llm-deepseek adapter's baseURL and credentials. Use it when you run DSH on the Web profile and want constant visibility of DeepSeek usage. Caveat: requires DSH 0.1.0-rc.x on the Web profile, and an API key must be configured via DSH's credentials service or the DEEPSEEK_API_KEY environment variable, otherwise the balance slot will not render.
请帮我了解并安装插件:【dsh-plugin-deepseek-balance】【https://github.com/hnmrxz/dsh-plugin-deepseek-balance】
把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.
或使用命令行安装(适合开发者)Or use CLI install (for developers)
命令行安装CLI Install
dsh plugin --profile web add github:hnmrxz/dsh-plugin-deepseek-balance
把 hnmrxz/dsh-plugin-deepseek-balance 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-plugin-deepseek-balance
在 DeepSeek Harness (dsh) 底部状态栏实时显示 DeepSeek 账户余额。
Real-time DeepSeek account balance in the DSH bottom status bar (the band under the composer, next to the shipped stats line).
Features
- 实时余额:总余额 / 赠送 / 充值一目了然,悬停查看明细
- 每 30 秒自动刷新,点击立即刷新
- 复用 DSH 的
DEEPSEEK_API_KEY凭据(与自带llm-deepseek适配器同一引用),无需再填 Key - 尊重
llm-deepseek设置里的baseURL(自定义网关也能用) - API Key 只停留在 Host 进程,浏览器端永远拿不到
- 中英文自动跟随 DSH 界面语言
Screenshots

Install
需要 DSH 0.1.0-rc.x(Web profile)。
1. 安装到 profile
在 DSH 的 web profile 目录(通常 ~/.dsh/profiles/web)里把本包加为依赖:
cd ~/.dsh/profiles/web
npm install dsh-plugin-deepseek-balance
# 或 pnpm add dsh-plugin-deepseek-balance
# 本地开发:npm install /path/to/dsh-plugin-deepseek-balance 或 pnpm add ../dsh-plugin-deepseek-balance
2. 加入 composition
编辑同一个 profile 下的 cordis.patch.yml(没有就新建),插入一行:
- insert:
- id: deepseek-balance
name: dsh-plugin-deepseek-balance
3. 重启 dsh
dsh --profile web
打开 Web UI,composer 下方的状态带上就会出现 DeepSeek ¥xxx · 可用。
Configuration
无需配置。Key 来源(按顺序):
- DSH 设置页 Models 里配置的
DEEPSEEK_API_KEY(推荐,通过 credentials 服务写入) - 启动环境里的
DEEPSEEK_API_KEY环境变量
How it works
┌─────────────┐ ┌──────────────────────┐
│ Browser │ │ dsh Host process │
│ client.js │ GET │ webServer route │
│ (composer │ ─────► │ /dsh-deepseek- │
│ .dock slot) │ ◄───── │ balance │
└─────────────┘ JSON │ │ │
│ ├─ credentials │
│ │ .resolve( │
│ │ DEEPSEEK_ │
│ │ API_KEY) │
│ ▼ │
│ fetch │
│ {baseURL}/user/ │
│ balance │
└──────────────────────┘
- Host half (
lib/index.js):注册同源 HTTP 路由/dsh-deepseek-balance,通过credentialsseam 解析 API Key(按请求实时读取,改了 Key 无需重启),调用 DeepSeekGET /user/balance,10 秒内缓存结果。 - Client half (
lib/client.js):注册进conversation.composer.dock槽位,用 timer service 每 30 秒轮询路由,点击立即刷新。 - 两端通过同源路由通信(
dsh.client声明让 web 端自动加载 client bundle),不需要 Remote/typert 代码生成。
Development
# 仓库结构
lib/index.js # Host half(Cordis plugin,纯 Node ESM)
lib/client.js # Client half(web bundle,__ModuleLoader__ 格式)
改动后重新安装到 profile(或 npm link)并重启 dsh 即可。
Publish
推送到 GitHub 后,发布到 npm 供用户直接安装:
# 推送前先改包名(GitHub 同名仓库惯例)
# package.json 里把 "name" 改为 "@<你的GitHub用户名>/dsh-plugin-deepseek-balance"
git remote add origin git@github.com:<你的GitHub用户名>/dsh-plugin-deepseek-balance.git
git push -u origin main
npm login
npm publish
ruvnet/ruflo
amruthpillai/reactive-resume
volcengine/OpenViking
Molunerfinn/PicGo
titanwings/colleague-skill
nocobase/nocobase
Tencent/WeKnora