-
Notifications
You must be signed in to change notification settings - Fork 0
Home
eddy.wijaya edited this page Apr 3, 2026
·
4 revisions
OpenCode plugin that displays your ChatGPT Plus/Pro Codex subscription quota directly in the terminal β no browser needed.
| Feature | Description |
|---|---|
| π― Single Command |
/codex_quota β a convenient wrapper that asks OpenCode to call the quota tool |
| π Rich Markdown | Themed headers, progress bars, tables rendered by OpenCode TUI |
| β±οΈ 5h + Weekly Windows | Primary 5-hour and secondary weekly usage with local reset clocks |
| π Code Review Quota | Shown when applicable to your plan |
| π° Credits & Spend | Balance, approximate message counts, spending status |
| Advisory at 50%+, warnings at 80%+, critical at 100% | |
| π Two Display Modes | Full for /codex_quota, compact for agent/tool usage |
| π Auth from OpenCode | Reads existing opencode auth login credentials, no extra setup |

Example full-mode output rendered in the OpenCode TUI.
// Add to ~/.config/opencode/config.json or project opencode.json
{
"plugin": ["opencode-codex-quota"]
}Then run:
/codex_quota
See Installation for detailed setup instructions.
- OpenCode installed and configured
- ChatGPT Plus or Pro subscription with Codex access
- OAuth credentials via
opencode auth login(select ChatGPT Plus/Pro)
Changed
- Upgrade
@biomejs/biomefrom 1.9.4 to 2.4.10 - Upgrade
typescriptfrom 5.9.3 to 6.0.2 - Upgrade
vitestfrom 3.2.4 to 4.1.2 - Upgrade
@vitest/coverage-v8from 3.2.4 to 4.1.2 - Upgrade
@types/nodefrom 22.19.15 to 25.5.2 - Bump minimum Node.js version from 18 to 20
Added
- Initial plugin implementation
-
/codex_quotaslash command wrapper with full and compact display modes - Auth reading from OpenCode
auth.jsonwith JWT parsing - API client for
chatgpt.com/backend-api/wham/usageendpoint - Markdown formatter with progress bars, time formatting, conditional sections
- Error handling for E1βE9 scenarios
- Full Vitest test suite (124 tests, 99%+ coverage)
- CI workflow for test + typecheck + build + SonarCloud analysis
- Publish-to-npm workflow triggered on GitHub Release with provenance
Changed
- Reset columns now use local clock-style
Resets Attimestamps instead of relative countdown text -
/codex_quotanow routes slash-command arguments into the wrapper instruction socompactmode works from the command entrypoint
Fixed
- Mark the injected
/codex_quotawrapper instruction text as synthetic for OpenCode TUI prompt reconstruction actions - SonarCloud maintainability: extract helper functions to reduce cognitive complexity
| Resource | Link |
|---|---|
| π¦ npm | opencode-codex-quota |
| π GitHub | guyinwonder168/opencode-codex-quota |
| π Issues | GitHub Issues |
| π License | MIT |
- slkiser/opencode-quota β source of the API endpoint and auth flow discovery
- OpenCode β the AI coding assistant this plugin extends