@qy2025/dsh-opencode-go-usage
v1.0.3
Published
OpenCode Go usage dashboard for the DeepSeek Harness Web GUI: rolling 5-hour, weekly and monthly quota windows with reset countdowns.
Maintainers
Readme
@qy2025/dsh-opencode-go-usage
OpenCode Go usage dashboard for DeepSeek Harness (DSH).
Adds a Go usage panel icon to the DSH Web sidebar. Clicking it opens a central dashboard with the three official OpenCode Go quota windows — rolling 5 hours, weekly, and monthly — showing used/remaining percentages, progress bars, reset countdowns, and a manual refresh. Data refreshes automatically every 60 seconds.
Features
- Three quota windows: rolling 5 hours / this week / this month, with reset countdowns.
- Sidebar entry: a gauge icon in the bottom panel strip, next to the shipped panels.
- Safe by design: the API key is read on the host through DSH's credential service and
never reaches the browser. The plugin exposes only quota percentages behind
GET /api/opencode-go/usage(30-second cache,?refresh=1bypasses it). - Theme-aware: all colors come from DSH
--dsw-alias-*theme tokens, so light/dark themes and skins apply automatically. - Bilingual: Chinese and English UI, following the active DSH locale.
- Graceful errors: missing key, expired key, upstream failure and malformed payloads each show a readable message instead of an empty panel.
Requirements
- DSH
>=0.2.0-rc.2 <0.3.0(the bundle declaresengines.dsh) - An OpenCode Go subscription and its API key, stored as the DSH credential
OPENCODE_GO_API_KEY(the same key theopencode-gomodel route uses) - Node.js
>=20(DSH's own requirement)
Install
dsh plugin --profile web add @qy2025/dsh-opencode-go-usageRestart dsh web, then reload the page. If the GUI is a Desktop build that manages
its profile itself, install it through the Plugins page instead, or add it to the
profile with the same spec.
Store the key in DSH's credential store (for example through the Models settings page) or export it in the launching environment:
OPENCODE_GO_API_KEY=oc_sk_...Usage
- Read the sidebar: the Go usage icon sits in the bottom panel strip.
- Click it: the central panel shows the three quota cards and the last update time.
- Use Refresh to bypass the 30-second cache; the panel also polls every 60 seconds.
How it works
| Half | File | Responsibility |
| --- | --- | --- |
| Host | index.js | Resolves OPENCODE_GO_API_KEY via ctx.credentials, proxies https://opencode.ai/zen/go/v1/usage, serves GET /api/opencode-go/usage, caches for 30 s. |
| Client | client.js | Registers sidebar.panellist (id opencode-go-usage) and the matching main panel; renders the dashboard from the same-origin route. |
The bundle ships a cordis.patch.yml that inserts one row, so enabling the bundle
is enough — no hand-edited profile patch is required.
Development
index.js(host) changes need a DSH restart.client.jschanges need a page reload.- The
icon.svgandlocale/*.jsonprovide the Plugin Manager's display metadata.
Plugin market index
This package ships a format-1 DSH plugin market index at market/index.json.
It is served straight from the npm tarball by jsDelivr:
https://cdn.jsdelivr.net/npm/@qy2025/dsh-opencode-go-usage@1/market/index.jsonEnable the experimental custom plugin market bundle, open Discover, choose Add index source, and paste that URL to browse and install this plugin from the market.
License
MIT
