DeepSeek Harness plugin

dsh-deepseek-balance-lincheng

DSH 右下角悬浮余额监视器:实时查看 DeepSeek API 余额与用量费用图表(7天/30天)

Jump to install

Source facts

Repository
lin-cheng-lab/dsh-deepseek-balance
Latest update
Aug 14, 2026
Category
Tools & Capabilities
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/lin-cheng-lab/dsh-deepseek-balance
Plugin: dsh-deepseek-balance-lincheng
Author: lin-cheng-lab

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer3 files
README.mdSource · read only

dsh-deepseek-balance

右下角悬浮的 DeepSeek API 余额监视器 —— 为 DeepSeek Harness (DSH) 实时显示账户余额与用量费用。

!badge

功能

  • 🟢 右下角常驻悬浮徽章:状态色圆点 + 实时余额,任何页面/会话下都可见
  • 📊 用量费用图表:7 天 / 30 天柱状图,悬停查看每日金额
  • 🔄 每 60 秒自动刷新,也可手动刷新
  • 🎨 自动适配深浅色主题(使用 DSH 主题变量)
  • 🔑 自动读取已配置的 DEEPSEEK_API_KEY 凭证,无需手动填写
  • 🔒 Key 安全:通过环境变量传给 curl,命令行/日志不出现明文

余额数据来自官方接口 GET https://api.deepseek.com/user/balance; 用量数据来自本机 DSH 会话日志的真实 token 统计(按官方价格换算费用), 更早的历史因本地无账单记录以灰色示意柱展示。

安装

dsh plugin --profile web add "github:<你的用户名>/dsh-deepseek-balance#main"

然后重启 dsh --profile web,右下角即可看到余额徽章。

凭证配置

~/.dsh/.credentials.yaml 中配置:

DEEPSEEK_API_KEY: sk-xxxxxxxxxxxxxxxxxxxxxxxx

开发

pnpm install
pnpm build    # tsc 编译 Host + tsdown 打包 Client

产物结构:

  • lib/index.js — Host 半(RPC handler:余额/用量查询)
  • lib/client.js — Client 半(悬浮徽章 UI,__ModuleLoader__ bundle)

工作原理

┌──────────────┐   connection.rpc.call   ┌──────────────────────────┐
│  Browser UI  │ ──────────────────────▶ │  Host (Node)             │
│  shell.overlay│  /deepseek-balance      │  ├─ credentials.resolve  │
│  悬浮徽章+图表 │ ◀────────────────────── │  ├─ shell curl 余额 API  │
└──────────────┘   RpcResult             │  └─ sessionQuery 用量统计 │
                                         └──────────────────────────┘

License

MIT