opencode-go-usage-plugin
v0.5.3
Published
OpenCode 2 - /go-usage shows Go usage
Maintainers
Readme
opencode-go-usage-plugin
/go-usage for OpenCode 2 (opencode2) — shows current OpenCode Go usage via GET https://opencode.ai/zen/go/v1/usage. No LLM calls.
- TUI:
/go-usageopens a dialog with usage bars (5h / 7d / 30d) - Sidebar: live usage panel while an OpenCode Go model is active (toggle via
ctrl+p)
Install
Paste this into an agent session:
Install the npm package "opencode-go-usage-plugin" and add it to the "plugin"
array in my global opencode config (~/.config/opencode/opencode.json), then
restart the opencode2 service.Or manually:
npm i opencode-go-usage-pluginopencode.jsonc:
{ "$schema": "https://opencode.ai/config.json", "plugins": ["opencode-go-usage-plugin"] }Restart:
opencode2 service restartUsage
/go-usageShows 5h / 7d / 30d windows ($12/$30/$60). Needs Go connected.
Not connected? /connect -> OpenCode Go -> paste key from https://opencode.ai/go, or set OPENCODE_API_KEY.
How it works
- Endpoint:
GET https://opencode.ai/zen/go/v1/usagewithBearer <key>->{ usage: { rolling: { percent, resetsAt }, weekly, monthly } } - Auth:
integration:opencode-go/opencode->env:OPENCODE_API_KEY->auth.json - TUI plugin shape:
{ id, setup }withkeymap.layerregistered from aui.slotrender (opencode2 beta Solid context requirement)
Dev
npm i
npm run check # typecheck + lint + format
npm run build # -> dist/Requires Node >=24, TypeScript 7.
License
MIT
