CLI tool for managing multiple Codex OAuth accounts and checking their rate limits / usage.
npm install -g @kodo/agent-meterOr run directly with npx:
npx -y @kodo/agent-meter@latest listIf you do not install globally, replace agent-meter in the examples below with npx -y @kodo/agent-meter@latest.
# Add a new account (opens browser for OAuth login, then auto-checks usage)
agent-meter add
# List all accounts with real-time usage check
agent-meter list
# Show the default account and the shell's effective auth state
agent-meter current
# Switch the default Codex account for the current shell
eval "$(agent-meter use <email-or-id>)"
# Launch Codex directly with a selected account
agent-meter codex <email-or-id>
# Diagnose why switching is not taking effect
agent-meter doctor [email-or-id]
# Remove an account by email
agent-meter delete <email>addcreates an isolatedCODEX_HOMEdirectory, runscodex login, then immediately checks usagelistconcurrently checks all accounts via the OAuth usage API and displays a table with progress barscurrentshows the default account, the shell's effective auth source, and whether environment variables are overridingCODEX_HOMEusechanges the default account and prints shell code that unsets conflicting OpenAI env vars and exportsCODEX_HOME=...; to affect the current shell, wrap it witheval "$( ... )"codexlaunches a new Codex CLI process with the selected account, so you can switch accounts without shellevaldoctordiagnoses why switching may not be taking effect and prints copy-paste fixesuseonly affects new Codex CLI processes; restart any runningcodexsession after switchingdeleteremoves the account and itsCODEX_HOMEdirectory- If a token expires during
list, you'll be prompted to re-login on the spot
# Diagnose the current shell
agent-meter doctor
# Diagnose a specific target account
agent-meter doctor huangzheyu@bytedance.com- Codex CLI installed and available on PATH
| Flag | Description |
|---|---|
--json |
Output raw JSON |
--verbose |
Enable verbose logging |
--data-dir <path> |
Override the default ~/.agent-meter directory |
MIT
