When developing or debugging with DeepSeek Harness (DSH), frequently switching pages to check account balances or Kimi Code quotas can interrupt the workflow. The dsh-usage-widget plugin solves this pain point by providing a persistent, compact widget at the bottom of the left sidebar.
dsh-usage-widget is a DSH plugin maintained by AHui-Lab. It integrates usage monitoring directly into the bottom of the left sidebar in the Web/Desktop interface, providing a real-time overview of account status.
Core Features¶
The plugin registers a “Usage” entry at the bottom of the left sidebar with the following characteristics:
- Data Display: Displays DeepSeek account balance and Kimi Code quotas (including the 5-hour window quota and weekly quota).
- Layout and Interaction: Always visible at the bottom of the sidebar. Clicking the entry collapses or expands it, and provides a toggle to switch between DeepSeek and Kimi.
- Automatic Refresh: Automatically refreshes data every 60 seconds.
Installation and Enablement¶
The plugin supports installation via a GitHub repository or an npm package. After installation, restart DSH.
# 通过 GitHub 仓库安装(推荐)
dsh plugin --profile <name> add github:AHui-Lab/dsh-usage-widget
# 通过 npm 包安装
dsh plugin --profile <name> add dsh-usage-widget
After restarting DSH, you can find the “Usage” entry at the bottom of the left sidebar.
Data Flow and Configuration¶
Due to CORS restrictions in the browser, api.kimi.com cannot be called directly. The plugin provides two data acquisition paths and corresponding API key configuration methods.
Data Paths¶
-
Host Routing Mode (preferred):
The plugin registers/usage-monitor/deepseekand/usage-monitor/kimiroutes on the host Web server. These routes fetch data through upstream APIs and prioritize theAuthorizationheader sent by the client; otherwise, they fall back to the DSH credential service or environment variables. -
Direct Browser Fallback (backup):
When host routing is unavailable, the plugin attempts to request the upstream directly from the browser. DeepSeek supports CORS, so this mode works; Kimi cannot be accessed directly in this mode due to CORS restrictions.
API Key Configuration¶
Keys are configured per machine and are not distributed with the plugin.
-
Host Mode:
Set the following environment variables in~/.dsh/.credentials.yaml:DEEPSEEK_API_KEYKIMI_CODING_API_KEY
The host process reads these configurations.
-
Browser Mode:
Open the plugin panel, click the gear icon, and paste the API Key and Token into the panel. These keys are stored only in the browser’slocalStorage(with the prefixusage-monitor.key.*) and are used only for upstream requests.
Development and Notes¶
- No Build Required: The plugin repository already includes the
lib/directory (containingindex.jsandclient.js), so it is ready to use after installation without any build steps. - Applicable Scenarios: Suitable for developers who need to continuously monitor API usage without leaving the DSH interface.
- Community Plugin: This plugin is a community-maintained project, not an official DeepSeek plugin.
- Dependencies: Requires a DSH Web/Desktop configuration profile, and the plugin is designed for the browser client.
Ecosystem and Links¶
DSH’s design philosophy is “everything is a plugin,” and this plugin is part of the community ecosystem. To view the source code or submit issues, visit: