usage command fetches current usage data from configured providers. This is the default command when running codexbar without arguments.
Usage
Options
Provider Selection
Provider identifier to query. Options:
- Specific provider ID (e.g.,
codex,claude,cursor,gemini, etc.) both- Query both Codex and Claudeall- Query all enabled providers
Account Selection
Account selection flags require a single provider (
--provider claude, etc.).Select a specific account by label/email (matches the label in config file)
Select account by index (1-based)
Fetch all accounts for the provider
Data Source
Data source strategy:
auto(macOS only) - Uses browser cookies for Codex + Claude, with CLI fallback only when cookies are missingweb(macOS only) - Web-only; no CLI fallbackcli- CLI-only (Codex RPC → PTY fallback; Claude PTY)oauth- Claude OAuth only (debug); no fallback. Not supported for Codexapi- API key flow when the provider supports it (z.ai, Gemini, Copilot, Kilo, Kimi K2, MiniMax, Warp, OpenRouter, Synthetic)
Output Format
Output format:
text or jsonPretty-print JSON output (only applies when
--format json)Additional Options
Hide Codex credits in text output
Fetch provider status pages and include them in output
Web scraping timeout in seconds (for Codex web source)
Write HTML snapshots to
/tmp when data is missing (debug)Print Antigravity planInfo fields to stderr (debug)
Examples
Basic Usage
JSON Output
Source Selection
Account Management
Status Information
With API Tokens
Text Output Example
JSON Output Example
Token Accounts
The CLI reads multi-account tokens from~/.codexbar/config.json (same file as the app).
- Select a specific account:
--account <label>(matches the label/email in the file) - Select by index (1-based):
--account-index <n> - Fetch all accounts for the provider:
--all-accounts
sessionKey cookies or OAuth access tokens (sk-ant-oat...). OAuth usage requires the user:profile scope; inference-only tokens will return an error.
Provider-Specific Notes
Codex (OpenAI)
- Output
sourcereflects the strategy actually used (openai-web,web,oauth,api,local, or provider CLI label) - Codex web: OpenAI web dashboard (usage limits, credits remaining, code review remaining, usage breakdown)
- OpenAI web requires a signed-in
chatgpt.comsession in Safari, Chrome, or Firefox - The
openaiDashboardJSON field is normally sourced from the app’s cached dashboard snapshot --source auto|webrefreshes it live via WebKit using a per-account cookie store
Claude
- Claude web: claude.ai API (session + weekly usage, plus account metadata when available)
- Claude CLI status line is custom + user-configurable; never rely on it for usage parsing
Kilo
- Kilo auto: app.kilo.ai API first, then CLI auth fallback (
~/.local/share/kilo/auth.json) on missing/unauthorized API credentials - Kilo text output splits identity into
Plan:andActivity:lines - In
--source auto, resolved CLI fetches addNote: Using CLI fallback - Kilo auto-mode failures include a fallback-attempt summary line in text mode (API attempt then CLI attempt)
Notes
- The
usagecommand is the default - runningcodexbarwithout a command is equivalent tocodexbar usage - Cookie imports default Chrome-only when possible to avoid other browser prompts; override via browser list when needed
