DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-minimal-balance

c

dsh-minimal-balance

Discovered

Minimal DeepSeek balance badge for the DSH Web sidebar, with peak/off-peak pricing indicator. Community plugin.

dsh-minimal-balance

在 DeepSeek Harness(DSH)的 Web 侧边栏底部、「设置」按钮正上方显示 DeepSeek 账户余额。极简、只读、无遥测,API key 永远不下发浏览器。

社区插件,不是 DeepSeek 官方产品。

功能

  • 侧边栏底部一行「余额 ¥xx.xx」,侧栏收起时也能在 56px 窄栏里显示
  • 峰谷指示线(金额下方 2px 短线):
    • 蓝色 = 谷价,棕色 = 峰价,红色 = 欠费/不可用
    • 规则按北京时间:工作日 09:00–12:00、14:00–18:00 为峰时;周末、中国法定节假日全天谷价(2026 年节假日表内置,需每年更新)
  • 余额低于阈值(CNY 2 / USD 1)时金额变暖色警示
  • 刷新节奏:挂载时、每 60 秒、标签页重新可见时各一次;点击徽章可立即刷新
  • 客户端只拿到一个金额;API key 只存在 Host 进程,永不下发浏览器
  • 无第三方请求、无遥测

安装

# 插件管理器(推荐,npm 发布后)
plugin_manager install_bundle dsh-minimal-balance

# 直接从 GitHub(无需 npm)
plugin_manager install_bundle github:camik86/dsh-minimal-balance

# 或 CLI
dsh plugin --profile web add dsh-minimal-balance

安装后在 dsh web 侧边栏底部即可看到;改配置可能需要重启一次 dsh web。

配置 API key

插件通过 DSH 凭据服务解析 DEEPSEEK_API_KEY,逐次解析,改 key 不用重启。任选一种:

  1. DSH 设置里把 DEEPSEEK_API_KEY 存进凭据(推荐)
  2. 进程环境变量 DEEPSEEK_API_KEY=sk-...
  3. $DSH_HOME/.credentials.yaml 里写 DEEPSEEK_API_KEY: sk-...

没有 key 时徽章显示 --。

配置项

在 profile 的 cordis.patch.yml 里覆盖 dsh-minimal-balance 这一行:

- id: dsh-minimal-balance
  name: dsh-minimal-balance
  config:
    enabled: true                  # 总开关
    baseURL: https://api.deepseek.com
    apiKeyEnv: DEEPSEEK_API_KEY    # 凭据名 / 环境变量名
    cacheSeconds: 30               # 上游结果缓存秒数
    timeoutMs: 10000
    allowPublicClients: false      # 仅当 DSH 前有可信认证代理时才设为 true

安全模型

  • 浏览器端只调用同源路由 /dsh-minimal-balance,拿到的是金额,不是 key
  • 默认只允许私有网段客户端读取(loopback、10/8、172.16/12、192.168/16、link-local、IPv6 ULA、CGNAT/Tailscale 100.64/10);公网地址返回 403
  • 认证由 DSH 自身的连接校验 + 启动 token 负责,本插件不新增鉴权层
  • 若通过受信反向代理对外暴露 DSH,再考虑 allowPublicClients: true

可选:局域网桥

如果上游路由只接受 loopback、而你在手机上看徽章,可加装 lan/。主插件客户端会先试原生路径,失败自动回退到桥;装/卸桥都不需要改客户端。

目录

路径作用
index.jsHost 半:/dsh-minimal-balance 路由、凭据解析、上游请求与缓存
client.jsClient 半:侧边栏 sidebar.footer.action 徽章、峰谷/低余额状态
cordis.patch.yml插件行与默认配置
locale/*.json插件显示名/描述
lan/可选局域网桥(独立包 dsh-minimal-balance-lan)

License

MIT。


English

A minimal community plugin for DeepSeek Harness: shows the DeepSeek account balance in the Web sidebar footer, right above Settings, with a colored peak/off-peak pricing indicator and a low-balance warning.

  • The API key never leaves the host: the browser only receives the balance amount.
  • Read access is limited to private-network clients by default (loopback, RFC1918, link-local, IPv6 ULA, Tailscale/CGNAT). Public clients get 403 unless allowPublicClients: true (only behind your own authenticated proxy).
  • Peak pricing follows Beijing time: workdays 09:00–12:00 and 14:00–18:00 are peak; weekends and Chinese public holidays are off-peak (2026 holiday table bundled, update yearly).
  • Install: plugin_manager install_bundle dsh-minimal-balance; configure DEEPSEEK_API_KEY through DSH credentials, the environment, or $DSH_HOME/.credentials.yaml.
  • No telemetry, no third-party requests. MIT licensed.

Comments

Loading…

Similar plugins

dsh-peak-price-panel

by LucienLL

DeepSeek Harness plugin: peak/off-peak price watch, live account balance with tiered low-balance alerts, and a top-up button for the main web UI

Models & ProvidersManifest valid

★ 0

MIT

JavaScript

Aug 26, 2026

dsh plugin --profile web add dsh-peak-price-panel

by QWHYQ114514-cell

DeepSeek Harness plugin: minimal two-line balance, today's spend and peak/off-peak readout at the sidebar foot.

Manifest valid

★ 0

MIT

JavaScript

Oct 9, 2026

dsh plugin --profile web add dsh-balance-peek

by lxy7747-hash

A DeepSeek Harness plugin that pins the signed-in DeepSeek account balance (recharge + bonus) to the Web sidebar foot.

Manifest valid

★ 0

MIT

JavaScript

Oct 20, 2026

dsh plugin --profile web add dsh-balance-badge

by MarJose123

DeepSeek Harness plugin: your DeepSeek API balance and the current peak/off-peak billing window, below the message input.

Manifest valid

★ 0

MIT

JavaScript

Oct 18, 2026

dsh plugin --profile web add dsh-simple-usage-info

by qschen86

DSH web plugin: DeepSeek API balance & today usage badge in the sidebar rail

Manifest valid

★ 0

MIT

JavaScript

Aug 19, 2026

dsh plugin --profile web add dsh-deepseek-balance

by btbxbob

DeepSeek Harness side-bar balance badge: show DeepSeek account balance and estimated depletion time (dual-half cordis plugin)

Manifest valid

★ 0

JavaScript

Sep 14, 2026

dsh plugin --profile web add dsh-balance