DeepSeek Harness plugin

dsh-deepseek-balance

DeepSeek Harness 插件:在侧边栏实时展示 DeepSeek API 余额

Jump to install

Source facts

Repository
kyya/dsh-deepseek-balance
Latest update
Aug 14, 2026
Category
Usage & Billing
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/kyya/dsh-deepseek-balance
Plugin: dsh-deepseek-balance
Author: kyya

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 Harness(dsh)插件:在 Web 侧边栏底部(设置按钮上方)实时展示 DeepSeek API 账户余额。余额数据由 Node 侧定时拉取,浏览器侧每 30s 轮询一次, 点击指示器可立即强制刷新。

  • 状态点颜色:绿 = 可用;黄 = 账户不可用;红 = 拉取失败;蓝 = 加载中。
  • 悬停显示完整明细(总额 / 赠送 / 充值 / 更新时间)。
  • API key 每次拉取时经 credentials 服务解析,永远不会下发给浏览器

安装

# 把插件装进 web profile(本地目录方式)
dsh plugin --profile web add /绝对路径/dsh-deepseek-balance

# 或从 git 安装
dsh plugin --profile web add github:kyya/dsh-deepseek-balance

然后重启 dsh webdsh plugin 只会装依赖,插件集变更要重启才生效):

dsh web

打开 http://127.0.0.1:3080,侧边栏左下角即可看到余额指示器。

配置

默认读取凭据 DEEPSEEK_API_KEY(即 ~/.dsh/.credentials.yaml 里、或 DEEPSEEK_API_KEY=… 环境变量、或「设置 → 模型」里保存的那个 key)。 在 ~/.dsh/profiles/web/cordis.patch.yml 里覆盖(覆盖整行 config,需写全字段):

- id: deepseek-balance
  config:
    refreshMs: 60000                 # 后台刷新间隔(毫秒)
    apiKeyEnv: DEEPSEEK_API_KEY      # 凭据引用名
    baseUrl: https://api.deepseek.com
    endpoint: /user/balance

工作原理

半边文件职责
host(Node)index.js定时 GET <baseUrl><endpoint>(Bearer 鉴权),缓存快照;用 webServer.register 暴露 /deepseek-balance
browserclient.jssidebar.footer.action 插槽注册 React 指示器;轮询 /deepseek-balance,点击带 ?refresh=1 强制刷新。

余额接口返回形如:

{ "is_available": true, "balance_infos": [{ "currency": "CNY", "total_balance": "123.45", "granted_balance": "0.00", "topped_up_balance": "123.45" }] }

卸载

dsh plugin --profile web remove dsh-deepseek-balance