Skip to content
eddy.wijaya edited this page Apr 3, 2026 · 4 revisions

🏠 opencode-codex-quota

OpenCode plugin that displays your ChatGPT Plus/Pro Codex subscription quota directly in the terminal β€” no browser needed.


✨ Features

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
⚠️ Warning Banners 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

πŸ“Έ Screenshot

OpenCode TUI screenshot showing the Codex quota report

Example full-mode output rendered in the OpenCode TUI.


⚑ Quick Start

// Add to ~/.config/opencode/config.json or project opencode.json
{
  "plugin": ["opencode-codex-quota"]
}

Then run:

/codex_quota

See Installation for detailed setup instructions.


πŸ“‹ Requirements

  • OpenCode installed and configured
  • ChatGPT Plus or Pro subscription with Codex access
  • OAuth credentials via opencode auth login (select ChatGPT Plus/Pro)

πŸ“¦ Changelog

Unreleased

Changed

  • Upgrade @biomejs/biome from 1.9.4 to 2.4.10
  • Upgrade typescript from 5.9.3 to 6.0.2
  • Upgrade vitest from 3.2.4 to 4.1.2
  • Upgrade @vitest/coverage-v8 from 3.2.4 to 4.1.2
  • Upgrade @types/node from 22.19.15 to 25.5.2
  • Bump minimum Node.js version from 18 to 20

v1.0.0 β€” 2026-04-04

Added

  • Initial plugin implementation
  • /codex_quota slash command wrapper with full and compact display modes
  • Auth reading from OpenCode auth.json with JWT parsing
  • API client for chatgpt.com/backend-api/wham/usage endpoint
  • 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 At timestamps instead of relative countdown text
  • /codex_quota now routes slash-command arguments into the wrapper instruction so compact mode works from the command entrypoint

Fixed

  • Mark the injected /codex_quota wrapper instruction text as synthetic for OpenCode TUI prompt reconstruction actions
  • SonarCloud maintainability: extract helper functions to reduce cognitive complexity

πŸ”— Links

Resource Link
πŸ“¦ npm opencode-codex-quota
πŸ™ GitHub guyinwonder168/opencode-codex-quota
πŸ› Issues GitHub Issues
πŸ“„ License MIT

πŸ™ Acknowledgments

πŸ“š opencode-codex-quota

Getting Started

Reference

Development


GitHub Repository Β· npm Β· Issues

Clone this wiki locally