English | 中文
A DeepSeek Harness web-GUI plugin that adds an OpenCode Go entry to the Settings sidebar. Click it to see your OpenCode Go subscription's three usage windows — 5-hour rolling / weekly / monthly — with percent used, spend limit, and reset time.
- Settings sidebar section "OpenCode Go" (a
settings.sectioncontribution) - Host-side Typert Remote
opencodeUsage/usagereads the API key and calls the official endpoint - Client usage page: per-window percent, progress bar, limit, and reset time
- Precondition check: if opencode-go is missing from Settings → Models, or no API key is found, it shows guidance instead of an error
- API key resolved from the DSH credentials seam (
OPENCODE_GO_API_KEY) with a fallback to OpenCode'sauth.json
dsh plugin --profile web add github:xiaoqi20/dsh-opencode-go-usageAdd the plugin row to your profile's patch layer ($DSH_HOME/profiles/web/cordis.patch.yml):
- insert:
- id: opencode-go-usage
name: 'dsh-opencode-go-usage'Restart dsh web so the host half and the served client bundle pick up the plugin. The plugin needs the standard web bundle composition (the api-gateway client Remote and the settings.section slot) — the default dsh web profile has both.
Host-side tunables live on the plugin row in cordis.yml:
- id: opencode-go-usage
name: dsh-opencode-go-usage
config:
baseUrl: https://opencode.ai/zen/go/v1/usage # default
timeoutMs: 15000 # default| Key | Default | Meaning |
|---|---|---|
baseUrl |
https://opencode.ai/zen/go/v1/usage |
The usage endpoint. |
timeoutMs |
15000 |
Fetch timeout in milliseconds. |
GET https://opencode.ai/zen/go/v1/usage
Authorization: Bearer <API_KEY><API_KEY> is the Anthropic-compatible OpenCode Go key (sk-opencode-…). The endpoint returns:
{
"usage": {
"rolling": { "status": "ok", "percent": 9, "resetsAt": "2026-08-14T07:20:04.810Z" },
"weekly": { "status": "ok", "percent": 12, "resetsAt": "2026-08-17T00:00:00.810Z" },
"monthly": { "status": "ok", "percent": 6, "resetsAt": "2026-09-09T00:41:03.810Z" }
}
}percent is 0–100; resetsAt is ISO-8601. The endpoint is not yet in OpenCode's public docs.
- DSH credentials seam / environment
OPENCODE_GO_API_KEY($DSH_HOME/.credentials.yaml) - OpenCode
~/.local/share/opencode/auth.json→ theopencode-goentry (fallbackopencode) withtype: "api"
Works on macOS, Linux, and Windows. The plugin is plain ESM with no native binaries or build step, and both halves (Host and Client) are platform-independent.
| Platform | API key resolution |
|---|---|
| macOS / Linux | ✅ ~/.local/share/opencode/auth.json is exactly where the OpenCode CLI stores it — works out of the box |
| Windows | Use OPENCODE_GO_API_KEY (credentials seam or environment) for best results; an auth.json in the same relative location is also read |
Requirements on any platform: Node.js + DeepSeek Harness, the opencode-go model configured in Settings → Models, and an OpenCode Go API key.
A dual-face (Host + Client) plugin. The Host publishes the opencodeUsage Typert Remote service; the Client mounts it, registers the settings.section, and renders the page. Communication rides the harness /api RPC carrier.
| File | Role |
|---|---|
index.js |
Host half — OpencodeUsageGateway (TypertRemoteService, service key opencodeUsage) |
typert.host.js |
Hand-written Typert host manifest, registered via exports["./typert"] |
client.js |
Browser bundle in window.__ModuleLoader__.load format — mounts the Remote, registers the section, renders the page |
package.json |
Dual-face declaration: main + exports["./client"] + exports["./typert"] + dsh.client |
The plugin is plain ESM and needs no build step. Host files import @deepseek-ai/* peers; the client bundle is hand-written in the lazy-CJS format the harness client loader serves under /plugins.
- The usage endpoint is undocumented and may change; parsing is defensive, and non-200 responses surface as a friendly status rather than a crash.
- Quota limits ($12 / $30 / $60) are shown for context only and are not part of the response; they follow the OpenCode Go plan and can drift.
MIT
