Local AI usage observability CLI for Codex sessions.
Project description
codex-stats
Local AI usage observability CLI for Codex sessions.
What it does
codex-stats reads local Codex state from ~/.codex and shows:
- session totals from
state_5.sqlite - request counts from rollout JSONL files
- model and project breakdown from local session metadata
- estimated cost from a local pricing table
Install
pip install .
After publish:
pipx install codex-stats
For local development:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools
python -m pip install -e .
Usage
codex-stats
codex-stats today
codex-stats session
codex-stats session --id <session_id>
codex-stats --json
From the repo without installing:
PYTHONPATH=src python3 -m codex_stats
Notes
- This tool does not intercept Codex API traffic.
- Costs are estimates, not authoritative billing values.
- The current MVP relies on local file formats that may evolve with Codex CLI versions.
Release
Recommended publish flow:
- Create the GitHub repository
vivek378521/codex-stats. - Create a PyPI project named
codex-stats. - Configure PyPI Trusted Publishing for the GitHub repository.
- Push a version tag and publish a GitHub release.
- The release workflow will build and upload the package to PyPI.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codex_stats-0.1.0.tar.gz.
File metadata
- Download URL: codex_stats-0.1.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a1aae2d2d4c6343147d1406dda034ca6afbc014caa2d43e6aef047298226afb
|
|
| MD5 |
404063b396d5bcb31499ea54d59ea073
|
|
| BLAKE2b-256 |
36c1d0eefd08d06586ea415e9a41a185db9e1094b2644bab47063f8429a41d26
|
Provenance
The following attestation bundles were made for codex_stats-0.1.0.tar.gz:
Publisher:
publish.yml on vivek378521/codex-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_stats-0.1.0.tar.gz -
Subject digest:
6a1aae2d2d4c6343147d1406dda034ca6afbc014caa2d43e6aef047298226afb - Sigstore transparency entry: 1226564148
- Sigstore integration time:
-
Permalink:
vivek378521/codex-stats@f65b951107629839033bf6cd95278342d3c01e91 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vivek378521
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f65b951107629839033bf6cd95278342d3c01e91 -
Trigger Event:
release
-
Statement type:
File details
Details for the file codex_stats-0.1.0-py3-none-any.whl.
File metadata
- Download URL: codex_stats-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2383e67efe70922a77f3b5f56fb56ec3dcc470a475d012d9281e7a01100c414f
|
|
| MD5 |
f39695952bfa98f31baff481c3a49c8c
|
|
| BLAKE2b-256 |
0023633fa772076895758f65f6dca34e2b3f5527e2321b0e705de328d090880c
|
Provenance
The following attestation bundles were made for codex_stats-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on vivek378521/codex-stats
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codex_stats-0.1.0-py3-none-any.whl -
Subject digest:
2383e67efe70922a77f3b5f56fb56ec3dcc470a475d012d9281e7a01100c414f - Sigstore transparency entry: 1226564189
- Sigstore integration time:
-
Permalink:
vivek378521/codex-stats@f65b951107629839033bf6cd95278342d3c01e91 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/vivek378521
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f65b951107629839033bf6cd95278342d3c01e91 -
Trigger Event:
release
-
Statement type: