Skip to content
Baylar55Public

About

CLI tool to track and analyze Oh My Pi (omp) token usage, costs, and trends from local session logs

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

omp-usage

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.

Features

  • Daily breakdown — token usage, costs, and sparkline trends per day.
  • Group by dimension — model, agent, provider, session, or day.
  • 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.

Installation

Via pip

pip install omp-usage

Via pipx / uv (Recommended for CLI tools)

pipx install omp-usage
# or
uv tool install omp-usage

From source

git clone https://github.com/Baylar55/omp-usage.git
cd omp-usage
pip install -e .

Usage

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 --json

CLI Reference

usage: 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

License

MIT License. See LICENSE for details.

About

CLI tool to track and analyze Oh My Pi (omp) token usage, costs, and trends from local session logs

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages