Skip to main content

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:

  1. Create the GitHub repository vivek378521/codex-stats.
  2. Create a PyPI project named codex-stats.
  3. Configure PyPI Trusted Publishing for the GitHub repository.
  4. Push a version tag and publish a GitHub release.
  5. The release workflow will build and upload the package to PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_stats-0.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_stats-0.1.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

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

Hashes for codex_stats-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6a1aae2d2d4c6343147d1406dda034ca6afbc014caa2d43e6aef047298226afb
MD5 404063b396d5bcb31499ea54d59ea073
BLAKE2b-256 36c1d0eefd08d06586ea415e9a41a185db9e1094b2644bab47063f8429a41d26

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_stats-0.1.0.tar.gz:

Publisher: publish.yml on vivek378521/codex-stats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for codex_stats-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2383e67efe70922a77f3b5f56fb56ec3dcc470a475d012d9281e7a01100c414f
MD5 f39695952bfa98f31baff481c3a49c8c
BLAKE2b-256 0023633fa772076895758f65f6dca34e2b3f5527e2321b0e705de328d090880c

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_stats-0.1.0-py3-none-any.whl:

Publisher: publish.yml on vivek378521/codex-stats

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page