Choi-Peng/dsh-deepseek-balance ↗★ 0
@choi-peng/dsh-deepseek-balance
DeepSeek account balance in the dsh web sidebar footer, with live config hot reload and an editable Settings → Plugins card.
安装
此插件尚未提供可验证的 bundle,或兼容性检查未通过。请先阅读仓库说明。 阅读完整 README ↗
说明文档
阅读完整 README ↗dsh-deepseek-balance
A persistent DeepSeek Harness Cordis plugin that shows your DeepSeek account balance in the sidebar footer, right above the Settings button.
Features
- 💰 Displays your current DeepSeek account balance as
账户余额: 122.77 CNYin the left sidebar footer, above Settings. - 🔄 Auto-refreshes every 60 seconds.
- ⚡ Config hot reload — edit
cordis.patch.ymlor use Settings → Plugins → Balance Monitor; both apply without restartingdsh web. - 📱 Hides automatically when the sidebar is collapsed (rail mode).
- 🔑 Reads the API key from
~/.api_keys(export DEEPSEEK_API_KEY="sk-...") or theDEEPSEEK_API_KEYenvironment variable. - 🎨 Two-decimal formatting, 6px uniform padding.
Architecture
This is a dual-face Cordis plugin:
| Half | File | Role |
|---|---|---|
| Host | lib/index.js | Registers /deepseek-balance (proxies the DeepSeek Get User Balance API) and /deepseek-balance/settings (GET effective config; POST saves/resets UI overrides to $DSH_HOME/deepseek-balance.json) |
| Client | lib/client.js | Registers the balance readout in the sidebar.footer.action slot (60 s poll) and an editable Balance Monitor card in Settings → Plugins |
Browser (Client half) --fetch /deepseek-balance--> Host HTTP route --> api.deepseek.com/user/balance
Installation
The plugin is a pure Cordis plugin (no dsh.bundle): dsh plugin add
installs the package into the profile, and a one-row insert in the profile's
cordis.patch.yml mounts it. That mount row lives in the HMR-watched layer,
so config changes, enable/disable, and adding/removing the row all apply live
— no restart.
For other people, install from the git repository (no npm publish needed):
# 1. Install the package into the web profile:
dsh plugin --profile web add git+https://github.com/Choi-Peng/dsh-deepseek-balance.git
# or a pinned version: .../dsh-deepseek-balance.git#v0.3.0