CLI tool to track and display Oh My Pi (omp) token usage statistics. Reads directly from Oh My Pi local session logs and SQLite database — no API keys or external services needed.
- Daily breakdown — token usage, costs, and sparkline trends per day.
- Group by dimension —
model,agent,provider,session, orday. - Period comparisons (
--compare) — compare with prior period with percentage deltas. - JSON export (
--json) — structured export for automations, CI, and dashboards. - Zero OMP interference — read-only sync and query without modifying any OMP files.
pip install omp-usagepipx install omp-usage
# or
uv tool install omp-usagegit clone https://github.com/Baylar55/omp-usage.git
cd omp-usage
pip install -e .Run directly with omp-usage:
# Show help
omp-usage run --help
# Default: daily breakdown for the last 7 days
omp-usage run
# Group by model over the last 30 days, top 5 rows
omp-usage run --since 30d --by model --limit 5
# Compare last 7 days with previous 7 days
omp-usage run --days 7 --compare
# Group by session title
omp-usage run --since 4w --by session --limit 10
# Export structured JSON
omp-usage run --since 7d --by model --jsonusage: omp-usage run [-h] [--days N] [--since SPEC]
[--by {model,agent,provider,session,day}] [--limit N]
[--json] [--compare]
options:
-h, --help show this help message and exit
--days N Show last N days (default: 7)
--since SPEC Time filter: '7d', '2w', '30d', '3h', or ISO date
--by {model,agent,provider,session,day}
Group results by dimension
--limit N Max rows to display
--json Output as JSON
--compare Compare with previous period of same length
MIT License. See LICENSE for details.