- Home
- Plugins
- Usage & Billing
- dsh-opencode-go
dsh-opencode-go
andrewich/dsh-opencode-go
OpenCode Go usage panel for the DeepSeek Harness Web UI — allowance meters and subscription renewal date.
Install
dsh plugin --profile web add github:andrewich/dsh-opencode-goREADME
dsh-opencode-go
OpenCode Go subscription panel for the DeepSeek Harness Web UI: a sidebar entry (below Plugins and Automation tasks) and a screen with usage statistics for your OpenCode Go plan.
What it shows
- Monthly allowance — the main card: percent used, percent left, the subscription renewal date, and a countdown.
- 5-hour window — the rolling five-hour window (capped at 20% of the monthly allowance).
- Weekly limit — 50% of the monthly allowance, resetting on Monday 00:00 UTC.
- Monthly allowance card — resets when a new paid period starts.
- Bar colour: green below 70%, amber from 70% to 89%, red from 90%.
- A Refresh button, automatic refresh every minute and on tab focus, and an "Open console" link.
Data comes from GET https://opencode.ai/inference/go/v1/usage with the
OPENCODE_GO_API_KEY credential — the same key the opencode-go provider uses.
Why there are no token counts
The subscription API reports only status, percent and resetsAt for the
three windows. It exposes no token counts, no dollar amounts and no per-model
breakdown. The screen therefore shows percentages and dates, and the footer
says so explicitly. A local DSH token counter could be added separately, but
that measures session history, not the subscription.
Requirements
- DeepSeek Harness
0.2.2-rc.1(the manifest declaresengines.dsh). - An OpenCode Go subscription and an API key stored as
OPENCODE_GO_API_KEY.
Install
dsh plugin --profile web add /path/to/dsh-opencode-go
The bundle is appended to dsh.profile.bundles and linked into the profile's
node_modules. Refresh the page afterwards: HMR recomposes the profile and the
client bundle is served from /plugins/??dsh-opencode-go/client.js. If the
entry does not appear, restart dsh web.
From GitHub (the package ships plain JavaScript, so there is no build step and
pnpm needs no allowBuilds approval):
dsh plugin --profile web add github:Andrewich/dsh-opencode-go
Configuration
The row accepts this configuration, in the bundle layer or the profile's
cordis.patch.yml:
| Field | Default | Meaning |
|---|---|---|
apiKeyEnv | OPENCODE_GO_API_KEY | credential reference name |
endpoint | https://opencode.ai/inference/go/v1/usage | subscription endpoint |
refreshSeconds | 45 | Host cache lifetime (the browser polls once a minute) |
timeoutMs | 10000 | timeout for one upstream request |
Override example:
- id: opencode-go
config:
refreshSeconds: 120
Security
- The key is read only on the Host through
ctx.credentials.resolve(); it never reaches the browser. The page receives percentages and dates only. GET /api/opencode-go/usageis registered on the connection carrier, answers only an authenticated owner (signed cookie), setscache-control: no-store, and never logs the key or theAuthorizationheader.- The plugin runs in-process with the Host's privileges. Install only code you trust.
Development
Without installing into a profile, on a separate port:
dsh web --patch ./dev.patch.yml --port 3081 --no-open
The relative path in dev.patch.yml resolves against the patch file, so the
checkout works from any directory. The loader finds the client half from the
nearest package.json that declares dsh.client. Do not use the overlay while
the bundle is installed in a profile: the opencode-go row would be declared
twice.
Tests:
npm test
# or
node --test test/*.test.mjs
Uninstall
dsh plugin --profile web remove dsh-opencode-go
Troubleshooting
- Entry visible, screen empty — check
Settings → ProvidersthatOPENCODE_GO_API_KEYis set; the panel shows "API key required" otherwise. - Key rejected — an
unauthorizedbanner; rotate the key in the OpenCode Console and in DSH. - No network — the last known values stay on screen with an
unreachablebanner. - No entry in the sidebar — the profile recomposition did not happen;
restart
dsh web.
Layout
| Path | Purpose |
|---|---|
lib/index.js | Host half: usage route, credential, upstream call, cache |
lib/client.js | Browser half: sidebar row and the screen |
cordis.patch.yml | Bundle layer used when installed into a profile |
dev.patch.yml | Overlay for running from a checkout |
test/ | Host route and client bundle tests |
License
GPL-3.0-only. See LICENSE.
Related plugins
DeepSeek-Balance-Whale-Widget
meteornox/deepseek-balance-whale-widget
dsh-context
bowenliang123/dsh-context
dsh-cost-meter
han-1413141/dsh-cost-meter
dsh-damage-pulse
wssfk12138/dsh-damage-pulse