| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Small OpenCode plugin for Codex quota visibility.
Instead of checking the web dashboard, you get quota toasts directly in OpenCode.
Prerequisite: connect OpenCode to your ChatGPT Plus/Pro plan using OpenCode's native provider setup:
/connect
Choose the OpenAI/ChatGPT plan option, then install this quota plugin.
npm install -g opencode-codex-usage
opencode-codex-usage --installThen restart OpenCode.
npx opencode-codex-usage --installThen restart OpenCode.
npm install
npm run buildnpm link
opencode-codex-usage --installManual plugin path (if you prefer editing config directly):
"<repo>"Add that path to both OpenCode's server plugin config and TUI plugin config.
Version 1.0.0 changes the OpenCode integration from a server-only plugin to paired server and TUI plugins. This is a breaking setup change if you installed an older version manually or have an old plugin path in config.
Old manual plugin paths are obsolete:
"<repo>/dist/index.js"Use the package root instead:
"<repo>"Recommended upgrade:
npm install -g opencode-codex-usage@latest
opencode-codex-usage --installThen restart OpenCode.
The installer updates both OpenCode's server plugin config and TUI plugin config. The /codex-usage command is now registered by the TUI plugin, while background quota checks remain in the server plugin.
The TUI plugin registers a /codex-usage slash command. This means quota checks run locally and the command shows a toast without an assistant turn.
You can still run opencode-codex-usage directly when you want an immediate quota refresh from a shell.
After install verify end-to-end:
OPENCODE_CODEX_QUOTA_TOAST_THRESHOLD=always opencode
/codex-usageUse /codex-usage or opencode-codex-usage to verify the end-to-end toast flow immediately (no agent invocation).
Flags for opencode-codex-usage:
Remove global install:
npm uninstall -g opencode-codex-usageRemove local link:
npm unlink -g opencode-codex-usageAuthentication is handled by OpenCode. Use /connect in OpenCode to connect a ChatGPT Plus/Pro plan before running quota checks.
If the probe reports provided authorization token is expired, run /connect and reconnect your ChatGPT account.
Set polling interval (milliseconds):
OPENCODE_CODEX_QUOTA_POLL_MS=120000Default is 600000 (10 minutes). Invalid or non-positive values fall back to default.
Set transient retry count for probe failures:
OPENCODE_CODEX_QUOTA_RETRY_COUNT=1Allowed values: 0, 1 (default), 2. Values above 2 clamp to 2; invalid values fall back to default.
Set probe model (advanced; optional):
OPENCODE_CODEX_QUOTA_MODEL=gpt-5.5By default, the probe queries the authenticated Codex model list and uses the first supported model returned for the account.
Advanced: override the internal refresh path (optional):
OPENCODE_CODEX_USAGE_SIGNAL_PATH=/tmp/opencode-codex-usage.refreshSet background toast threshold:
OPENCODE_CODEX_QUOTA_TOAST_THRESHOLD=criticalAllowed values: warn (default), critical, error, always, never.
Set toast duration (milliseconds):
OPENCODE_CODEX_QUOTA_TOAST_DURATION_MS=5000Default is 5000. Invalid or non-positive values fall back to default.
The probe prints one JSON object (ProbeSnapshot) per run.
Common keys:
Error statusCode values:
Example:
{
"status": "warn",
"statusCode": 200,
"plan": "plus",
"profile": "default",
"used": { "primary": 81, "secondary": 9 },
"reset": { "primary": "1h0m", "secondary": "7d0h" },
"windowMinutes": { "primary": 300, "secondary": 10080 },
"probeTokens": 10
}npm test
npm run lint
npm run build
npm run format:checkAuto-configure OpenCode with local plugin path:
opencode-codex-usage --install| Back | FazBrowse Home | New Git URL |