In DeepSeek Harness, checking the account balance typically requires opening a browser panel or navigating to a settings page, which interrupts the current session’s workflow. The dsh-balance plugin registers the /balance command to read and display DeepSeek account balance information directly within the session, eliminating the need to leave the current terminal or chat window.
Plugin Positioning¶
dsh-balance is a client-side plugin maintained by DWJZ. It integrates DeepSeek’s account balance inquiry functionality into the session interaction, supporting the viewing of available balances, top-up amounts, and bonus amounts.
Core Functions¶
- Command Registration: Registers the
/balancecommand. The output is treated as the command’s own text and rendered directly in the originating session, rather than being sent to the model. - Balance Reading: Reads the account balance via
GET {baseUrl}/user/balance, reporting the breakdown of funds between top-ups and bonuses. - Cache Control: Supports the
/balance refreshcommand to bypass the cache and force a re-read. - Key Resolution: Supports specifying
apiKeydirectly via the config file or usingapiKeyRef(defaulting toDEEPSEEK_API_KEY) to reference credentials or environment variables, facilitating key rotation. - Error Handling: Upon a read failure, displays the last successfully read balance and indicates the status, rather than hiding known balance information.
Installation¶
Use the official installation command to add the plugin:
dsh plugin --profile web add github:DWJZ/dsh-balance
Configuration and Usage¶
This plugin requires configuration in cordis.patch.yml to function correctly. The configuration file path is typically $DSH_HOME/profiles/<profile>/cordis.patch.yml.
Sample configuration:
- id: dsh-balance
config:
apiKey: '' # Explicit key; uses apiKeyRef if left empty
apiKeyRef: DEEPSEEK_API_KEY # Credential reference or environment variable name
baseUrl: https://api.deepseek.com
timeoutMs: 10000
cacheMs: 30000 # Cache validity duration in milliseconds
Usage Examples:
-
View current balance:
/balance
(Sample output: DeepSeek account balance (available), CNY total balance ¥293.58 · Top-up ¥293.58 · Bonus ¥0.00, read at 2026/9/18 13:20:41) -
Refresh balance (bypass cache):
/balance refresh
Notes¶
- Dependencies: This plugin depends on
@deepseek-ai/cordis. - Configuration Requirements: Key information in
cordis.patch.ymlmust be configured correctly to enable reading. - Caching Mechanism: The cache validity is 30000 milliseconds; the refresh command overrides this limit.
- License: MIT License.
- Ecosystem Background: The DeepSeek Harness philosophy is “Everything is a plugin.” This is a community-maintained project and is not officially affiliated with DeepSeek or High-Flyer.
Summary¶
dsh-balance simplifies the balance management process through a simple command-line interface. For developers who need to frequently monitor their account financial status, this is a highly integrated and practical tool. For more details, please refer to the GitHub repository.