openusage-cli is a Linux-first backend for AI usage tracking.
It runs provider plugins from OpenUsage, collects usage and quota data, and exposes normalized snapshots through a local REST API and CLI.
The upstream OpenUsage project is a macOS menu-bar app that combines UI and backend logic. openusage-cli focuses on the backend side only, following a Unix-style design: do one thing well.
That one thing is reliable data collection from AI providers, so other tools can build UI and automation on top.
- One local source of truth for usage/quota data across multiple AI providers
- Reuse of the OpenUsage plugin ecosystem instead of custom per-provider integrations
- A headless data source for other tools: dashboards, notifications, alerts, scripts, and machine-to-machine integrations via local REST API
- Best for ad-hoc checks and scripts
- Tries to read data from a running daemon first (fast path)
- If no daemon is available, falls back to direct local plugin execution
- Fallback is slower because plugin runtime initialization and provider polling happen during command execution
- Best for frequent reads and low-latency consumers
- Keeps plugin runtime initialized and refreshes snapshots in the background
- Data is then available immediately through REST API or
openusage-cli query
See docs/daemon-modes.md for mode behavior, tradeoffs, and operational guidance.
- Standalone (
run-daemon): quick to start manually, good for local/dev sessions - User systemd service (
install-systemd-unit): recommended for daily use, process supervision, and persistent lifecycle management
Detailed setup, pros/cons, and configuration are documented in docs/daemon-modes.md.
openusage-cli currently supports Linux only.
Install package:
- Arch Linux (AUR):
yay -S openusage-cli(oropenusage-cli-git) - Debian/Ubuntu: install
.debfrom GitHub Releases viaapt - Fedora/RHEL/openSUSE: install
.rpmfrom GitHub Releases viadnforzypper
Run a one-shot query:
openusage-cli queryOr start daemon mode:
openusage-cli run-daemon --host 127.0.0.1 --port 6738Then call the API, for example:
curl http://127.0.0.1:6738/v1/usagequery(default): one-shot JSON query (usageorplugins)run-daemon: start daemon mode and expose HTTP APIshow-default-config: print defaultconfig.yamltemplateinstall-systemd-unit: install user systemd unitversion,help
GET /healthGET /v1/pluginsGET /v1/usageGET /v1/usage/{provider}POST /v1/probe
- Installation details: docs/installation.md
- CLI and runtime options: docs/usage.md
- Query/daemon behavior and systemd operation: docs/daemon-modes.md
- Configuration and daemon discovery: docs/configuration.md
- Plugin overrides and AST patching: docs/plugin-overrides.md
- Development, testing, packaging, releases: docs/development.md
- Known intentional behavior differences: openusage_differences.md
For upstream project OpenUsage plugin contracts, see vendored upstream docs: