← 返回列表
⚠ 装前注意
在 DeepSeek Harness dsh 底部状态栏实时显示 DeepSeek 账户余额。
基本兼容但装前注意:未发布到 npm registry,仅可从源码安装 · 最近上游提交 2026/8/15 · 已提供中文文档
在 DeepSeek Harness (dsh) 底部状态栏实时显示 DeepSeek 账户余额。
综合分
32.7
GitHub 分
32.7
用户评分
—
★ Stars
4
周下载量
—
安装插件(需先安装 dsh CLI 引擎:npm install -g @deepseek-ai/dsh)
dsh plugin --profile web add hnmrxz/dsh-plugin-deepseek-balance未发布到 npm registry,仅可从源码安装,改用 GitHub 源安装
数据截至 2026/9/19(元数据每日更新 · 实装验证按队列轮转,单条结论的验证时间见上方)
安装兼容性检查⚠ 装前注意
以下结论由程序自动检查 npm 包、engines 声明与入口文件得出,未做人工实机验证——能装不等于用着没问题。
✗npm 包dsh-plugin-deepseek-balance(未发布到 npm,仅可源码安装)
✓Node 引擎未声明 engines.node
✓dsh CLI 依赖未声明 dsh 版本约束
✓入口文件main/exports/bin 已声明
未发布到 npm registry,仅可从源码安装
验证方式:npm registry 存在性 + package.json 静态校验 · 最后验证 2026/9/20 02:16:48
依赖的 DSH / Cordis 模块
@deepseek-ai/cordis@deepseek-ai/dsh-client-runtime@deepseek-ai/dsh-client-locale@deepseek-ai/dsh-cordis-client-runner@deepseek-ai/dsh-client-ui-conversation用户评分
还没有人投票,来当第一个
订阅周报,不错过优质插件更新
每周一封 · 高评分插件 + 新用户活动
README
dsh-plugin-deepseek-balance
在 DeepSeek Harness (dsh) 底部状态栏实时显示 DeepSeek 账户余额。
在 DSH 底部状态栏(composer 下方的条带,紧挨着内置的统计行)实时显示 DeepSeek 账户余额。
功能特性
- 实时余额:总余额 / 赠送 / 充值一目了然,悬停查看明细
- 每 30 秒自动刷新,点击立即刷新
- 复用 DSH 的 DEEPSEEK_API_KEY 凭据(与自带 llm-deepseek 适配器同一引用),无需再填 Key
- 尊重 llm-deepseek 设置里的 baseURL(自定义网关也能用)
- API Key 只停留在 Host 进程,浏览器端永远拿不到
- 中英文自动跟随 DSH 界面语言
截图
底部状态栏余额显示
安装
需要 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 · 可用。
配置
无需配置。Key 来源(按顺序):
1. DSH 设置页 Models 里配置的 DEEPSEEK_API_KEY(推荐,通过 credentials 服务写入)
2. 启动环境里的 DEEPSEEK_API_KEY 环境变量
工作原理
┌─────────────┐ ┌──────────────────────┐
│ 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,通过 credentials seam 解析 API Key(按请求实时读取,改了 Key 无需重启),调用 DeepSeek GET /user/balance,10 秒内缓存结果。
- Client half (lib/client.js):注册进 conversation.composer.dock 槽位,用 timer service 每 30 秒轮询路由,点击立即刷新。
- 两端通过同源路由通信(dsh.client 声明让 web 端自动加载 client bundle),不需要 Remote/typert 代码生成。
开发
仓库结构
lib/index.js # Host half(Cordis plugin,纯 Node ESM)
lib/client.js # Client half(web bundle,__ModuleLoader__ 格式)
改动后重新安装到 profile(或 npm link)并重启 dsh 即可。
发布
推送到 GitHub 后,发布到 npm 供用户直接安装:
推送前先改包名(GitHub 同名仓库惯例)
package.json 里把 "name" 改为 "@/dsh-plugin-deepseek-balance"
git remote add origin git@github.com:/dsh-plugin-deepseek-balance.git
git push -u origin main
npm login
npm publish
许可证
MIT同作者(hnmrxz)的其他插件
扫码进群