Codex_Usage_Profil / README.md
smlflg's picture
Initial public upload from Projekte/Codex_Usage_Profil
10b5888 verified
|
Raw History Blame Contribute Delete
1.08 kB
# Codex Usage Profiler
Local CLI for summarizing Codex usage from `~/.codex/state_5.sqlite` and rollout
JSONL files.
It reports:
- daily and ISO-week token totals
- tokens by cwd, model, role, and main vs subagent
- top sessions
- optional rollout token breakdowns for input, cached input, output, and
reasoning tokens when those events exist
- Markdown and static HTML output
## Usage
```bash
python3 -m codex_usage_profiler
```
Default output is written to:
- `reports/codex-usage.md`
- `reports/codex-usage.html`
Useful options:
```bash
python3 -m codex_usage_profiler \
--state ~/.codex/state_5.sqlite \
--sessions-dir ~/.codex/sessions \
--out reports \
--format both \
--tz Europe/Berlin \
--days 30 \
--top 25
```
`--days N` includes the last `N` local calendar days including today. Week
buckets use ISO weeks, starting on Monday.
The report never includes raw prompts, messages, command output, or model
responses. It only uses metadata and token counters.
## Development
Run tests with:
```bash
python3 -m unittest discover -s tests
```