Skip to main content Switch to mobile version cli-consumption 0.6.2 Analyze and consolidate AI coding CLI consumption across machines.
pip install cli-consumption==0.6.2 Copy PIP instructions
CLI Consumption turns local AI coding CLI metadata into one private, self-contained view of models, tokens, tools, conversations, turns, context pressure, and workflow health. It can consolidate trusted offline copies from several machines or send metadata-only snapshots to a central collector.
It never stores prompts, responses, tool arguments, credentials, or raw provider events. Local token counters are usage metadata, not billing records. Read the privacy boundary before sharing a database or report.
The preview and self-contained demo dashboard contain only deterministic synthetic records. Rebuild the HTML with:
uv run python docs/demo/generate.py The generator never reads provider directories and creates its temporary SQLite database outside the repository. The demo HTML, image, documentation, tests, and other repository assets are excluded from Python distribution artifacts.
CLI Consumption requires Python 3.11 or newer. Run it directly from PyPI with uv:
uv tool run cli-consumption providers The default package covers local collection, SQLite storage, exports, and the local HTTP server. Install only the optional runtime capabilities you use:
cli-consumption[sync] for the sync client;
cli-consumption[postgres] for PostgreSQL;
cli-consumption[snapshots] for signed, compressed offline snapshot files;
cli-consumption[mcp] for read-only local usage tools over MCP stdio.
cli-consumption[otlp] for OTLP/HTTP metrics.
Extras can be combined, for example cli-consumption[postgres] on a central collector.
See your local usage in the terminal with one command. quick detects supported CLIs, collects their metadata into cli-consumption.sqlite in the current directory (or --database), and prints the daily report:
uv tool run cli-consumption quick Running cli-consumption without a command still prints help; quick is the explicit first-run command. It collects like collect --provider all: a large Claude Code, Codex, or other supported store that exceeds an aggregate collection limit switches automatically to bounded batches. A provider that still fails is reported without stopping the others. Rerunning it is safe: collection is idempotent and refreshes the same database. Afterwards, report reads that database without collecting:
uv tool run cli-consumption report daily uv tool run cli-consumption report monthly --by model --since 2026-09-01 uv tool run cli-consumption report session --provider claude --json uv tool run cli-consumption report blocks --timezone Europe/Paris uv tool run cli-consumption report insights uv tool run cli-consumption report git --project service Tables show input, cache-read, cache-write, output, reasoning, and total tokens, the cache rate, and conversation, turn, and call counts. Token values that a provider does not record display as n/a, never as zero, and conversation-aggregate or context-snapshot counters are flagged. An estimated cost at public API list prices, from a versioned price table bundled with the package, prices each call of providers with additive token counters; it is an estimate, not an invoice, and unknown models display as n/a. --pricing PATH merges a local price override. Token counters are local usage metadata, not billing data. See terminal reports for every option and the JSON contract.
From a checkout, detect supported local CLIs, collect their metadata, and create an offline dashboard:
uv sync --all-extras uv run cli-consumption collect --provider all uv run cli-consumption export --output reports Open reports/dashboard.html locally. It makes no network requests. Detailed CSV tables are generated only when --csv is passed.
Dashboard development lives in the locked npm workspace under packages/. It builds provider-neutral ESM analytics, shared React presentation primitives, and deterministic React/Tailwind browser assets that Python embeds in the wheel. The React runtime is the only offline renderer; collection and offline reporting do not require Node.js.
The authenticated persistent dashboard lives in apps/web/. It reads the same minimized reporting contract through a server-side Next.js BFF: the browser never receives a collector credential or a database connection string. Its Export offline action downloads the exact visible selection as a self-contained detailed or share-safe HTML file. For a production setup, required environment variables, reverse-proxy constraints, and startup commands are documented in the deployment guide.
To collect one provider or select another database:
uv run cli-consumption collect --provider codex --database usage.sqlite When a Claude Code, Codex, Copilot, Amp, Continue, Gemini, Pi, or Qwen store exceeds aggregate collection limits, the command automatically writes bounded, restart-safe batches to the same database; sync and snapshot create batch the same way. Individual file and line safety limits remain enforced: in batches, only the conversation holding an oversized file is skipped and counted. Pass --no-incremental to fail instead, or --incremental to force batches.
When collecting into a local SQLite file, unchanged eligible transcripts reuse normalized metadata from the file cache. Use collect --full to force parsing.
Local collection honors supported provider directory overrides, such as CODEX_HOME and CLAUDE_CONFIG_DIR. Use --source [LABEL=]PATH for trusted offline copies and repeated --project NAME=PATH_PREFIX mappings for stable project labels. See the usage and operations guide for signed offline transfers, multi-machine collection, reporting, PostgreSQL, retention, synchronization, readiness, and automation.
The current registry supports Aider, Amazon Q Developer CLI, Amp, Antigravity, Claude Code, Cline, Codex, Continue, Crush, Cursor CLI, Gemini CLI, GitHub Copilot CLI, Goose, Grok Build, Kilo Code, Kimi Code CLI, Mistral Vibe CLI, OpenCode, OpenHands CLI, Pi, Plandex, and Qwen Code.
Provider formats are internal and can change without notice. Exact source locations, token semantics, extraction limits, synthetic qualification fixtures, provenance, and known gaps live in the provider support ledger. Inspect the local registry without exposing paths or content:
uv run cli-consumption providers --json Essential limits
Provider files are untrusted. Collection enforces discovery, file, line, SQLite row, structured-field, and total normalized-record limits; direct provider-file symlinks are refused. Incremental collection resets only aggregate per-batch limits and keeps a separate hard batch-count ceiling.
collect --strict and sync --strict refuse a batch when any provider skipped malformed records. Collection distinguishes provider_limit_exceeded, provider_format_incompatible, invalid_snapshot, and the unexpected-failure fallback provider_collection_failed; machine-readable results use these fixed codes without paths, payloads, response bodies, tokens, or exception text.
Dashboards are self-contained and network-free. Share-safe mode pseudonymizes labels, groups tools, rounds timestamps, and hides small cohorts, but still exposes aggregate work patterns.
CSV and normalized databases remain detailed private operational data. Never treat a technically completed turn as a measure of quality or productivity.
Central collection requires TLS, token rotation, backups, limits, monitoring, and a reverse proxy. The application does not replace those operator controls.
See Privacy for the exact data boundary and Architecture for ingestion, idempotency, migrations, report limits, and collector behavior.
Run uv run cli-consumption COMMAND --help for every option. The usage guide contains copy-ready examples.
To run the API and bundled persistent dashboard together, install Node.js 20.9 or newer and use uv tool run cli-consumption serve --front. The command asks for a dashboard password when CLI_CONSUMPTION_DASHBOARD_PASSWORD is not set; it does not require a repository checkout or npm install.
Usage and operations
Production deployment
Provider support and qualification
uv sync --all-extras --all-groups uv run pre-commit install uv run pre-commit run --all-files uv run ruff format --check . uv run ruff check . uv run ty check uv run pytest --cov --cov-report=term-missing uv build npm ci npm run verify npm audit --audit-level=high npm run build:web npm run test:e2e npm run screenshots renders both dashboards from the synthetic demo in light and dark themes, at desktop and phone widths (390 and 320 px), into .agent-tmp/screens/latest (override with SCREENSHOT_DIR) for design review, and records any sideways page scroll in overflow.tsv. It never reads a local database. npm run check:contrast prints the WCAG contrast of every colour pair the dashboards paint, in both themes, and fails below 4.5:1 for text or 3:1 for control borders and data marks.
Development uses short-lived branches and squash-merged pull requests into protected main. Read CONTRIBUTING.md and AGENTS.md before changing the project.
Licensed under the Apache License 2.0.
Released: Dec 5, 2026
Author: Guillaume Lombardo
Both files in this release have provenance metadata.
View provenance details
Apache-2.0 View SPDX License List
mcp otlp postgres server snapshots sync
ai cli codex observability tokens usage
Development Status 3 - Alpha
License OSI Approved :: Apache Software License
Programming Language Python :: 3
Topic Software Development :: Quality Assurance
Release files for cli-consumption 0.6.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
Built distribution (wheel)
Total release size: 7.5 MB
Release files / cli_consumption-0.6.2.tar.gz
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 5, 2026.
Release files / cli_consumption-0.6.2-py3-none-any.whl
Security for cli-consumption 0.6.2
Both files in this release have been uploaded with provenance metadata.
With provenance cli_consumption-0.6.2.tar.gz Dec 5, 2026
With provenance cli_consumption-0.6.2-py3-none-any.whl Dec 5, 2026
Attestation for cli_consumption-0.6.2.tar.gz
Attestation for cli_consumption-0.6.2-py3-none-any.whl
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Release history Release notifications | RSS feed
Dec 5, 2026 2 release files Full provenance
Dec 3, 2026 2 release files Full provenance
Sep 11, 2026 2 release files Full provenance
Sep 8, 2026 2 release files Full provenance
Sep 5, 2026 2 release files Full provenance
Sep 1, 2026 2 release files Full provenance
Aug 31, 2026 2 release files Full provenance
Aug 29, 2026 2 release files Full provenance
Aug 27, 2026 2 release files Full provenance
Aug 26, 2026 2 release files Full provenance
"PyPI", "Python Package Index", and the blocks logos are registered trademarks of the Python Software Foundation.
© 2026 Python Software Foundation
Deployed from 4d99e05











