Skip to content

notzenco/aimon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aimon

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

Features

  • 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 status reuses 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 history and 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 prices and matched model metrics show local per-model API pricing notes

Install

cargo install aimon-cli aimon-tui

Or build from source:

git clone https://github.com/notzenco/aimon
cd aimon
cargo install --path crates/aimon-cli
cargo install --path crates/aimon-tui

Usage

# 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

Providers

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

Cache Behavior

  • aimon status returns cached snapshots immediately when they are still fresh.
  • If a live refresh fails transiently, aimon shows the last known good snapshot as stale instead of dropping usage data.
  • aimon refresh always forces a live fetch.

History Analytics

  • aimon appends metric samples whenever a live provider refresh succeeds.
  • aimon history now defaults to all recorded local history; use --days for a shorter window.
  • The TUI includes a History tab 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.

API Price References

  • aimon prices shows 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 price and combined total are separate: rate cards come from the local pricing catalog, while totals come from tracked local usage history where available.

Configuration

Config lives at ~/.config/aimon/config.toml:

[general]
refresh_interval_secs = 60
timeout_ms = 15000

[providers.claude]
enabled = true

[providers.openrouter]
enabled = true

Provider 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.

Adding a Provider

See CONTRIBUTING.md for a guide on adding new providers.

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages