Introduction¶
DeepSeek Harness (DSH) is designed to extend its capabilities through a plugin-based architecture. OpenCode Go provides rolling, weekly, and monthly subscription quotas, but its official APIs usually do not provide an intuitive Web frontend for displaying them. This plugin registers a standalone floating entry in the lower-left corner of the conversation window in the DSH Web sidebar, allowing users to view the usage percentage and reset time for these subscriptions.
Core Features¶
- Standalone Entry: The floating button is located in the lower-left corner of the conversation window. It does not occupy a sidebar entry or input box, avoiding conflicts with other plugins.
- Usage Display: Clicking the button opens a panel that displays three usage windows: rolling usage, weekly usage, and monthly usage.
- Data Details: Each card shows the used percentage, remaining percentage, and reset time.
- Panel Positioning: The panel uses the button as its anchor, with its left edge aligned to the button and its bottom positioned 12 pixels above the button. It adjusts automatically when the conversation window or sidebar changes.
- Auto Refresh and Close: While open, the panel automatically refreshes every 60 seconds. It can be closed by pressing
Escor clicking outside the panel. - Security Mechanism: The API Key is resolved only within the Harness host process and is never sent to the browser.
Installation and Enablement¶
- Install the plugin using npm:
dsh plugin --profile web add dsh-plugin-opencode-usage
-
Verify the credentials. Confirm that
OPENCODE_GO_API_KEYexists in~/.dsh/.credentials.yaml. -
Optional: Override the
opencode-usageentry in the profile’scordis.patch.ymlto configure the credential reference and API address:
- id: opencode-usage
config:
credentialRef: OPENCODE_GO_API_KEY
apiBaseUrl: https://opencode.ai/zen/go/v1
cacheMs: 30000
- Restart
dsh weband refresh the page. A standalone “OpenCode Go Usage” floating entry will appear in the lower-left corner of the conversation window.
Applicable Scenarios and Limitations¶
- Applicable Scenarios: Developers who use OpenCode Go subscriptions and work in a DSH Web environment.
- Profile Limitations: This feature applies only to the
webprofile and does not register routes underheadlessmode. - Dependency Requirements:
- Node.js: ^22.19.0 || >=24.0.0
- DSH: >=0.1.5-rc.1 <0.2.0-0
- Security Notes: The plugin’s API calls inherit the Webserver’s bound address. By default, the profile binds to
127.0.0.1, making it accessible only from the local machine. If you changewebServer.config.hostto0.0.0.0, clients on the same local area network may read the usage percentage. The API Key itself does not leave the host process.