Track AI usage across multiple providers from a single CLI/TUI.
$ aimon status
Provider Usage State Details
──────────────────────────────────────────────────────────────────────
● claude [████████░░░░░░░] 52.0% active Session (5h)
● copilot [██░░░░░░░░░░░░░] 12.0% active Suggestions: 150
● cursor [██████████████░] 91.3% active Pro: 91.3%, Flash: 23.0%
● gemini [████░░░░░░░░░░░] 30.0% active gemini-2.5-pro
● openrouter [█░░░░░░░░░░░░░░] $3.50/$10.00 Credits
? codex — setup required codex CLI not found
- 6 providers: Claude Code, Codex CLI, GitHub Copilot, Cursor, OpenRouter, Gemini
- CLI + TUI: Quick status checks or full dashboard
- Extensible: Add a provider by creating one file + one registry line
- Cache-aware:
aimon statusreuses fresh SQLite snapshots and falls back to stale data on transient failures - Secure-by-default-ish: provider secrets live in SQLite instead of
config.toml - Local analytics history:
aimon historyand the TUI archive tab summarize recorded provider metrics over time - Model-aware history: Gemini, Codex, and local Claude/Codex session logs can surface per-model history with combined local totals
- API price reference:
aimon pricesand matched model metrics show local per-model API pricing notes
cargo install aimon-cli aimon-tuiOr build from source:
git clone https://github.com/notzenco/aimon
cd aimon
cargo install --path crates/aimon-cli
cargo install --path crates/aimon-tui# Show all providers
aimon status
# Force a live refresh for every enabled provider
aimon refresh
# Single provider detail
aimon status claude
# Show local history analytics
aimon history
aimon history cursor --days 30
aimon history claude
aimon history codex
# Show local API price references
aimon prices
aimon prices gemini
# JSON output
aimon status --json
aimon history --json
# List/manage providers
aimon providers
aimon providers enable openrouter
aimon providers disable codex
# Set up authentication
aimon auth copilot # OAuth device flow
aimon auth openrouter # API key
# Launch TUI dashboard with observatory, registry, and history tabs
aimon tui
# Show config
aimon config
# Shell completions
aimon completions bash >> ~/.bashrc| Provider | Auth Method | What it Tracks |
|---|---|---|
| Claude Code | CLI probe | Session + weekly rate limits, plus model history from local Claude logs |
| Codex CLI | CLI probe (app-server) | Daily usage quota, plus model history from local Codex sessions |
| GitHub Copilot | OAuth device flow | Suggestions + acceptance rate |
| Cursor | Desktop app sign-in state (Linux only) | Plan usage + spend limits |
| OpenRouter | API key | Credit usage + balance |
| Gemini | External CLI login (gemini) |
Per-model rate limits |
aimon statusreturns cached snapshots immediately when they are still fresh.- If a live refresh fails transiently, aimon shows the last known good snapshot as
staleinstead of dropping usage data. aimon refreshalways forces a live fetch.
aimonappends metric samples whenever a live provider refresh succeeds.aimon historynow defaults to all recorded local history; use--daysfor a shorter window.- The TUI includes a
Historytab with an all-time archive view and window cycling. - Model history is strongest for providers that expose real model data or local session logs today: Gemini, Codex, and local Claude/Codex logs.
- Combined model totals are local best-effort analytics and may still differ from TokScale while parsers are being refined.
- This is the first step toward deeper TokScale-style analytics without adding any hosted service.
aimon pricesshows a local model pricing catalog for common API models.aimon status,aimon history, and the TUI annotate matching model metrics with those price references.- These are local reference prices, not provider-billed invoices.
API priceandcombined totalare separate: rate cards come from the local pricing catalog, while totals come from tracked local usage history where available.
Config lives at ~/.config/aimon/config.toml:
[general]
refresh_interval_secs = 60
timeout_ms = 15000
[providers.claude]
enabled = true
[providers.openrouter]
enabled = trueProvider secrets are stored separately in aimon's SQLite data store. Legacy api_key values in config.toml still work, but new aimon auth ... flows no longer write secrets there.
See CONTRIBUTING.md for a guide on adding new providers.
MIT