⛽ Fuelcheck CLI
Fuelcheck CLI is a Rust command-line tool that fetches usage and cost data from multiple AI providers. It emits text or JSON output compatible with CodexBar-style dashboards and scripts. (heavily inspired by CodexBar)
Features
- Multi-provider usage checks with optional status badges.
- JSON and JSON-only output for automation.
- Local cost scan for supported providers.
- Live TUI watch mode for continuous refresh.
- Configurable sources per provider (oauth, web, api, cli, local).
Install Build from source:
The binary will be at target/release/fuelcheck-cli.
Install locally:
Run directly during development:
Quick Start Create a config by detecting local credentials:
Fetch usage (defaults to enabled providers in the config):
Fetch usage for a specific provider in JSON:
Compute local cost totals (from local logs when available):
Run the live watch TUI:
Validate or inspect config:
Configuration
The default config path is ~/.codexbar/config.json. Override it with --config on any command.
Minimal example:
Provider fields supported by the CLI:
id: provider id (see list below).enabled: true/false to include by default.source: one ofauto,oauth,web,api,cli,local.cookie_header: rawCookie:header for web-based providers.api_key: API token for API-based providers.region: provider-specific region hint (used by z.ai and MiniMax).workspace_id: OpenCode workspace override.token_accounts: optional multi-account list for Codex, Claude, and Cursor.
Example with token accounts:
Provider IDs
- codex
- claude
- gemini
- cursor
- factory
- zai
- minimax
- kimi
- kimik2
- copilot
- kiro
- vertexai
- jetbrains
- amp
- warp
- opencode
Use --provider multiple times or --provider all to query more than one.
Output Notes
- Use
--format jsonor--jsonfor JSON output. - Use
--json-onlyto suppress all non-JSON output. - Use
--json-outputto emit JSONL logs on stderr. --watchrequires text output.
Provider Setup (from CodexBar docs)
Fuelcheck CLI uses the same credentials and tokens described in CodexBar provider docs. For cookie-based providers, you must supply a raw Cookie: header. A quick way to capture it is:
- Open the provider site in your browser.
- Open DevTools → Network and reload.
- Select a request to the provider domain and copy the
Cookierequest header. - Paste the header into
cookie_headeror set the matching env var.
Setup shortcuts:
fuelcheck-cli setupwill detect Codex, Claude, and Gemini CLI credentials when present.fuelcheck-cli setup --claude-cookie,--cursor-cookie,--factory-cookiecan prefill cookie headers.
Below is a per-provider setup summary based on CodexBar behavior and the CLI implementation.
Codex
- Auth: run
codexto create~/.codex/auth.json(or setCODEX_HOME). - Source: OAuth only in this CLI build (
--source oauthorauto). - Multi-account: use
token_accountswith Codex OAuth access tokens.
Claude
- OAuth: run
claudeso~/.claude/.credentials.jsonexists (or Keychain on macOS). - Web: set
cookie_headerorCLAUDE_COOKIEwith asessionKeycookie fromclaude.ai. - Source: OAuth or Web (
--source oauth|web). - Multi-account: use
token_accountswith OAuth access tokens.
Gemini
- Auth: run
geminito create~/.gemini/oauth_creds.jsonand~/.gemini/settings.json. - Source: API only (
--source apiorauto).
Cursor
- Web cookies: set
cookie_headerorCURSOR_COOKIEfrom acursor.comrequest. - Source: Web only (
--source weborauto). - Multi-account: use
token_accountswith per-account cookie headers.
Factory (Droid)
- Web cookies: set
cookie_headerorFACTORY_COOKIE/DROID_COOKIEfromapp.factory.ai. - Optional bearer token: set
api_keyorFACTORY_BEARER_TOKEN. - Source: Web only (
--source weborauto).
z.ai
- API token: set
api_keyorZ_AI_API_KEY. - Optional host overrides:
Z_AI_API_HOSTorZ_AI_QUOTA_URL. - Source: API only (
--source apiorauto).
MiniMax
- Preferred: set
api_keyorMINIMAX_API_KEY. - Cookie fallback: set
cookie_headerorMINIMAX_COOKIE. - Optional overrides:
MINIMAX_HOST,MINIMAX_REMAINS_URL, orregionin config.
Kimi
- Token: set
api_keyorKIMI_AUTH_TOKENfrom thekimi-authcookie. - Source: API only (
--source apiorauto).
Kimi K2
- API key: set
api_keyorKIMI_K2_API_KEY(also acceptsKIMI_API_KEYorKIMI_KEY). - Source: API only (
--source apiorauto).
Copilot
- API token: set
api_keyorCOPILOT_API_TOKEN(also acceptsGITHUB_TOKEN). - Token should have access to Copilot usage for your account.
- Source: API only (
--source apiorauto).
Kiro
- Install and log in to
kiro-cliusing AWS Builder ID. - The CLI runs
kiro-cli chat --no-interactive "/usage". - Source: CLI only (
--source cliorauto).
Vertex AI
- Run
gcloud auth application-default loginand set a project withgcloud config set project. - Requires Cloud Monitoring quota access in the selected project.
- Source: OAuth only (
--source oauthorauto).
JetBrains AI
- Use a JetBrains IDE with AI Assistant enabled.
- The CLI reads
AIAssistantQuotaManager2.xmlfrom the IDE config directory. - Source: Local only (
--source localorauto).
Amp
- Cookie header from
https://ampcode.com/settings. - Set
cookie_headerorAMP_COOKIE/AMP_COOKIE_HEADER. - Source: Web only (
--source weborauto).
Warp
- API key from
https://app.warp.dev/settings/account. - Set
api_keyorWARP_API_KEY/WARP_TOKEN. - Source: API only (
--source apiorauto).
OpenCode
- Cookie header from
https://opencode.ai. - Set
cookie_headerorOPENCODE_COOKIE/OPENCODE_COOKIE_HEADER. - Optional workspace override:
workspace_idorCODEXBAR_OPENCODE_WORKSPACE_ID. - Source: Web only (
--source weborauto).
Contributing
See CONTRIBUTING.md for development workflow and style guidance.