Skip to content

iSolitudinis/oc-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oc-stats

CLI tool to analyze OpenCode usage statistics — requests, tokens, cost, broken down by time period or model.

Screenshots

Default — Today's summary:

Today

Daily breakdown:

Daily

Model breakdown:

Models

Install

npx oc-stats

Or install globally:

npm install -g oc-stats

Usage

# Today's summary (default)
oc-stats

# Time period breakdown
oc-stats daily
oc-stats weekly
oc-stats monthly
oc-stats yearly

# Model breakdown
oc-stats models

Filters

All commands support the following flags, and they can be combined freely:

Flag Description Example
-m, --model <model> Filter by model -m anthropic/claude-opus-4-6
--from <date> Start date (YYYY-MM-DD) --from 2026-02-01
--to <date> End date (YYYY-MM-DD) --to 2026-02-08
# Daily stats for a specific model
oc-stats daily -m anthropic/claude-opus-4-6

# Model breakdown for a date range
oc-stats models --from 2026-02-03 --to 2026-02-08

# Combined
oc-stats weekly -m openai/gpt-5.3-codex --from 2026-01-01 --to 2026-02-01

Data Source

Reads OpenCode's local storage at ~/.local/share/opencode/storage/message/.

Development

pnpm dev              # Run with tsx (no build needed)
pnpm build            # Build with tsup
pnpm test             # Run tests

License

MIT

About

CLI tool to analyze OpenCode usage statistics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors