iamfromchangsha/dsh-go-balance
OpenCode Go balance pill at the right end of the composer tool row: rolling/weekly/monthly quota remaining straight from the Zen usage endpoint, with hover detail and warn/danger coloring.
dsh-go-balance shows the live OpenCode Go subscription balance in the DeepSeek Harness Web UI. A compact pill at the right end of the composer tool row displays the rolling / weekly / monthly quota remaining (e.g. Go 96% · 94% · 97%), read straight from the same OpenCode Zen usage endpoint the Go dashboard uses -- real numbers, not estimates. It warns with yellow below 30% remaining and red below 15%, keeps the last known snapshot dimmed and marked stale when a refresh fails, and hides entirely while nothing is known. The API key is resolved at runtime from DSH's credential service and never leaves the host process. The node half polls on a timer (plus lazily when the cache is older than 30s), validates response shape, and serves the snapshot at GET /go-usage; the browser half re-reads every 60 seconds and when the tab becomes visible again.
Install
dsh plugin --profile web add dsh-go-balanceThe plugin appends itself to the profile bundle layer automatically; restart DSH (dsh web) afterwards. npm package dsh-go-balance 0.1.2 (registry re-verified 2026-09-30; repository field back-links to github.com/iamfromchangsha/dsh-go-balance, MIT). The README also documents a GitHub form (dsh plugin --profile web add github:iamfromchangsha/dsh-go-balance) and a local checkout form (dsh plugin --profile web add file:./). No key is stored in the repository or shipped to the browser.
Compatibility
DeepSeek Harness Web UI. Requires an active OpenCode Go subscription and the OPENCODE_ZERO_API_KEY credential (in $DSH_HOME/.credentials.yaml or the process environment) resolved at runtime inside the host process. Web surface only. The README notes the snapshot is a user-facing reference for the current account quota, not a billing record.
Details
- Repo: iamfromchangsha/dsh-go-balance
- Category: Usage & Billing
- Stars: 0
- Version: npm dsh-go-balance 0.1.2 (registry re-verified 2026-09-30); MIT
- Last push: 2026-08-20
- First seen: 2026-08-15
Recent updates
The README documents the required OPENCODE_ZERO_API_KEY credential, the optional intervalMs config key (default 60000, overridable in the profile patch layer), and the security/robustness design: concurrency-deduped refresh, error hygiene with [REDACTED] key scrubbing in logs, route hardening (/go-usage rejects non-loopback Origin with 403 and applies a 120 req/min per-address rate limit), and [0, 100] range validation that drops malformed snapshots.
FAQ
- How do I install dsh-go-balance?
- Run dsh plugin --profile web add dsh-go-balance (or the GitHub / local-file forms), then restart DSH (dsh web). It appends itself to the profile bundle layer automatically.
- What credential does it need?
- Per the README it reads the OpenCode Go API key from DSH's credential service under OPENCODE_ZERO_API_KEY; it is resolved per refresh inside the host process only and never stored in the repository or shipped to the browser.
- Is the balance an estimate?
- No -- the README states it polls the OpenCode Zen usage endpoint with your Go key and renders the exact same rolling / weekly / monthly remaining numbers as the Go dashboard; the snapshot is a reference, not a billing record.
Alternatives
beizi6/dsh-opencodego-usage · AmaTsumeAkira/opencode-usage · Sev7een/ds-api-usage