You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CodexBar CLI for fetching usage from the command line.
read_when
You want to call CodexBar data from scripts or a terminal.
Adding or modifying Commander-based CLI commands.
Aligning menubar and CLI output/behavior.
CodexBar CLI
A lightweight Commander-based CLI that mirrors the menubar app’s data paths (Codex web/RPC → PTY fallback; Claude web by default with CLI fallback and OAuth debug).
Use it when you need usage numbers in scripts, CI, or dashboards without UI.
Install
In the app: Preferences → Advanced → Install CLI. This symlinks CodexBarCLI to /usr/local/bin/codexbar and /opt/homebrew/bin/codexbar.
From the repo: ./bin/install-codexbar-cli.sh (same symlink targets).
--web-debug-dump-html (writes HTML snapshots to /tmp when data is missing)
Claude web: claude.ai API (session + weekly usage, plus account metadata when available).
Linux: web/auto are not supported; CLI prints an error and exits non-zero.
Global flags: -h/--help, -V/--version, -v/--verbose, --no-color, --log-level <trace|verbose|debug|info|warning|error|critical>, --json-output.
Example usage
codexbar # text, respects app toggles
codexbar --provider claude # force Claude
codexbar --provider all # query all providers (honors your logins/toggles)
codexbar --format json --pretty # machine output
codexbar --format json --provider both
COPILOT_API_TOKEN=... codexbar --provider copilot --format json --pretty
codexbar --status # include status page indicator/description
codexbar --provider codex --source web --format json --pretty
Sample output (text)
Codex 0.6.0 (codex-cli)
Session: 72% left
Resets today at 2:15 PM
Weekly: 41% left
Resets Fri at 9:00 AM
Credits: 112.4 left
Claude Code 2.0.58 (web)
Session: 88% left
Resets tomorrow at 1:00 AM
Weekly: 63% left
Resets Sat at 6:00 AM
Sonnet: 95% left
Account: user@example.com
Plan: Pro
Prefer Codex RPC first, then PTY fallback; Claude defaults to web with CLI fallback when cookies are missing.
OpenAI web requires a signed-in chatgpt.com session in Safari, Chrome, or Firefox. No passwords are stored; CodexBar reuses cookies.
Safari cookie import may require granting CodexBar Full Disk Access (System Settings → Privacy & Security → Full Disk Access).
The openaiDashboard JSON field is normally sourced from the app’s cached dashboard snapshot; --source auto|web refreshes it live via WebKit using a per-account cookie store.
Future: optional --from-cache flag to read the menubar app’s persisted snapshot (if/when that file lands).