The design philosophy of DeepSeek Harness (DSH) is “everything is a plugin,” which allows developers to extend and enhance client functionality through extensions. For developers, keeping track of the DeepSeek account API balance in real time is a basic requirement. outprinthelloli/dsh-piggy-bank aims to solve this problem. It is a DSH Web plugin that mounts a draggable floating component on the page to retrieve and display the balance in real time from the official API.
The plugin is named outprinthelloli/dsh-piggy-bank, maintained by outprintHelloLi, under the MIT license.
Core Features¶
-
Floating Piggy Bank
- The component can be dragged to any position on the page.
- Four built-in transparent PNG styles are provided: cartoon pig, blue whale, black gold dragon pattern, and ceramic.
- Supports importing external.svgfiles as custom styles. -
Balance Display
- The balance value is displayed directly above the piggy bank.
- The text has a dark background to ensure readability. -
Automatic Refresh
- Query immediately when the page is opened.
- Refresh immediately when a task starts or ends.
- During a conversation run, query automatically at the configured interval (default 30 seconds), polling only when the page is visible. -
Balance Animation
- The piggy bank wiggles when a query is made.
- When the balance decreases, the piggy bank shakes and displays-¥xx.xx(fade in/out for 5 seconds).
- When the balance increases, it displays+¥xx.xxin gold. -
Settings Interface
- In the DSH settings sidebar, the “query interval” can be adjusted (range 5–600 seconds).
- The piggy bank style can be switched.
- Custom SVGs can be added.
Installation and Enablement¶
This plugin is implemented in pure Node.js and provides a one-click installation script.
Install using the script (recommended):
node scripts/install.mjs
The script automatically completes the following steps:
1. Finds the DSH profile (default is web).
2. Copies the plugin files.
3. Registers the dependency and bundle in the profile’s package.json.
4. Runs pnpm install.
Optional arguments:
# 安装到其它 profile(例如 headless)
node scripts/install.mjs --profile headless
# 只复制/登记,不执行 pnpm install
node scripts/install.mjs --no-install
Install using the DSH command:
dsh plugin --profile web add dsh-piggy-bank
After installation, the dsh web process needs to be restarted, and the page must be hard-refreshed in the browser (Windows: Ctrl+Shift+R; macOS: Cmd+Shift+R) to load the new component.
Typical Usage¶
After installing and enabling the plugin, a piggy bank icon appears in the top-right corner of the DSH client page. Dragging the icon changes its position. Clicking the icon or checking the value above it shows the current DeepSeek account balance.
In the DSH settings sidebar, the automatic query frequency can be configured. If more real-time monitoring is needed, the interval can be set to a smaller value (e.g. 5 seconds); to reduce API requests, it can be set to a larger value (e.g. 600 seconds). At the same time, the piggy bank style can be changed in the settings.
Notes¶
-
Prerequisites
-DEEPSEEK_API_KEYmust be configured in~/.dsh/.credentials.yaml.
- Node.js ≥ 20 and pnpm must be installed.
- Ensure the DSH web profile has been initialized (default is~/.dsh/profiles/web). -
Data Source and Limitations
- The data source is the DeepSeek official APIGET https://api.deepseek.com/user/balance.
- The DeepSeek Open Platform does not provide token usage, cost, or billing APIs, so this plugin only displays the balance and does not perform local usage accounting or cost estimation. -
Security
- The plugin runs with the permissions of the DSH process. It is recommended to review the source code and license (MIT) before installation.
Short Closing¶
outprinthelloli/dsh-piggy-bank provides the ability to monitor the balance directly within the DSH interface. Through visual animation feedback on balance changes, it reduces the frequency with which developers need to manually query the API. See the links below for the related directory and source code.