Multi-provider usage sidebar for opencode. Tracks Claude, Codex/ChatGPT, and OpenCode Go usage with severity-colored meter bars, pacing warnings, and live reset countdowns.
Claude · Pro — 5-hour / Weekly Codex · Plus — Weekly OpenCode Go — Rolling / Weekly / Monthly
- Claude — reuses the quota JSON written by
@cortexkit/opencode-anthropic-auth(keep it enabled server-side only). No duplicate auth. - Codex / ChatGPT — reads opencode's own OAuth token and calls
chatgpt.com/backend-api/wham/usage(read-only; never refreshes the token). - OpenCode Go — reads your Safari session cookies directly from the binary cookie store, then scrapes the authenticated Go dashboard for exact Rolling / Weekly / Monthly percentages. Zero setup.
-
Point the TUI at this plugin in
~/.config/opencode/tui.json:{ "plugin": ["/path/to/OpenGauge/src/tui.tsx"] } -
Keep
@cortexkit/opencode-anthropic-authinopencode.jsoncfor Claude auth, but remove it fromtui.jsonso only OpenGauge renders in the sidebar. -
Restart opencode.
- Click a
%reading to toggle used ↔ left. - Click a reset time to toggle countdown ↔ exact.
- Meter colors: theme-driven (green/success normal, amber ≥45%, red ≥75%).
- A red pacing line (
runs out in 2h) appears only when a window is projected to exceed its limit.
Fully automatic — no configuration, no pasting, no Keychain.
The plugin reads your session cookies from Safari's binary cookie store
(~/Library/Containers/com.apple.Safari/.../Cookies.binarycookies). Keep
Safari installed and signed in to opencode.ai once — the plugin does the rest.
If the session expires, sign in to opencode.ai in Safari again and the plugin picks up the new cookies automatically on the next poll.
The OpenCode Go auth cookie is read directly from Safari's encrypted cookie
store — it is never written to disk, exposed in logs, or stored outside Safari.
node src/lib.test.ts # pure-logic self-tests (no framework)All pure logic lives in src/lib.ts (testable with Node, no JSX, no deps).
UI rendering is in src/tui.tsx (Solid/OpenTUI, loaded by opencode).