The Web profile of DeepSeek Harness (DSH) provides modular extension capabilities. During use, developers frequently need to check the balance of their DeepSeek official account and the remaining status of their OpenCode Go plan. The dsh-sidebar-balance plugin embeds these two core metrics directly at the bottom of the sidebar, on the same row as “Settings”, without changing the original layout and providing only a minimal numeric display.

Installation

Run the following command in the terminal to install the plugin. The plugin can be installed via GitHub, a local path, or npm, and does not require additional build authorization.

dsh plugin --profile web add github:zhouchengke2046/dsh-sidebar-balance

After installation, ensure that a DSH client supporting the Web profile has been installed and started.

Core Features

The plugin mainly provides the following capabilities:

  • Minimal single-line display: Integrated into the bottom of the sidebar as plain text, aligned with the Settings button, without adding new entry points or changing the page layout.
  • Dual balance integration: Persistently displays the DeepSeek official balance, with a ring indicator on the right showing OpenCode Go plan consumption progress.
  • Native adaptation: Fully consumes DSH design tokens and automatically adapts to light and dark themes.
  • Secure design: The API key is parsed only within the host process. The browser receives only numeric results, helping avoid key leakage.
  • Automatic refresh: The balance and ring refresh automatically every 60 seconds. Clicking the amount triggers an immediate refresh. On failure, the previous value is retained and the UI degrades gracefully.

Usage

  • Persistent row interaction: In the persistent row at the bottom of the sidebar, the left side is the Settings button, which opens the settings panel when clicked. The right side shows the balance amount and the Go consumption ring. Clicking the amount only refreshes data and does not accidentally open the settings panel.
  • Floating card: When the mouse hovers over the amount, a frosted-glass style floating card appears, showing DeepSeek balance details, such as total amount, top-up, and bonus, as well as the remaining amount and progress for OpenCode Go’s three windows: rolling 5 hours, weekly, and monthly.
  • Collapsed adaptation: When the sidebar is collapsed, the persistent row retains only the Settings icon, and the floating card feature remains available.

Configuration and Dependencies

Using this plugin requires the following environment:

  • DeepSeek Harness version 0.1.0-rc.6+ (Web profile)
  • Node.js ≥ 18

The plugin depends on two environment variables in the host environment to retrieve data:

  • DEEPSEEK_API_KEY: Used to query the DeepSeek official account balance.
  • OPENCODE_GO_API_KEY: Used to query OpenCode Go plan usage.

Principles and Notes

  • Zero build: The plugin is a hand-written pure JavaScript bundle and does not require Node.js build steps.
  • Restart function: The refresh button in the sidebar only refreshes balance data and does not include restart functionality. Restart functionality is provided by the separate dsh-restart plugin.
  • Loading mechanism: On the browser side, it is self-hosted through Host routing and loaded using tapIndex injection. It is not loaded via the client-modules scan path, ensuring it works at any installation location.

Sources

  • Plugin directory: https://www.skillhub.cn/plugins/zhouchengke2046/dsh-sidebar-balance
  • Source repository: https://github.com/zhouchengke2046/dsh-sidebar-balance