Skip to main content

CLI Consumption

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.

Synthetic CLI Consumption dashboard

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.

Installation

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, and exports. Install only the optional runtime capabilities you use:

  • cli-consumption[sync] for the sync client;
  • cli-consumption[server] for the collector service;
  • cli-consumption[postgres] for PostgreSQL;
  • cli-consumption[snapshots] for signed, compressed offline snapshot files.

Extras can be combined, for example cli-consumption[server,postgres] on a central collector.

Quick start

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.

To collect one provider or select another database:

uv run cli-consumption collect --provider codex --database usage.sqlite

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.

Supported CLIs

The current registry supports Aider, Amazon Q Developer CLI, Amp, 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.
  • 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.

Commands

Command Purpose
collect Collect local or copied provider data into SQL.
snapshot Create or ingest signed, compressed offline snapshot files.
sync Collect and send metadata-only snapshots to a central API.
serve Run the central collection API.
export Write the HTML dashboard and optional CSV tables.
providers List provider names and compatibility status.
retention Preview or apply deletion outside a retention window.

Run uv run cli-consumption COMMAND --help for every option. The usage guide contains copy-ready examples.

Documentation

Development

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

Development uses short-lived branches and squash-merged pull requests into protected main. Read CONTRIBUTING.md and AGENTS.md before changing the project.

License

Licensed under the Apache License 2.0.

Metadata

Release files for cli-consumption 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cli-consumption 0.3.3
File Size Uploaded
cli_consumption-0.3.3.tar.gz 119.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cli-consumption 0.3.3
File Interpreter ABI Platform
cli_consumption-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 283.1 kB

Release files / cli_consumption-0.3.3.tar.gz

Download URL cli_consumption-0.3.3.tar.gz
Size 119.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e7f8f6e57bf1afb91aaba313a831f97f2bb6701f36a2dfe9beac3de9ac013a03
BLAKE2b-256 checksum
How to use checksums
63c671540ebcf02cb816684874b0c6e91bceffb9bdf131e9ce24e1ddf529e22b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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 Aug 31, 2026.

Transparency log

Release files / cli_consumption-0.3.3-py3-none-any.whl

Download URL cli_consumption-0.3.3-py3-none-any.whl
Size 163.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad291863de928dd8eeea2116e1ca024dd0334a2e5f4043a32282f3dc96fb2691
BLAKE2b-256 checksum
How to use checksums
a0543ed0d6afa1b95e7597fa231b404a6db847b018427fa1ec40703ad6d153de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

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 Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page