Repository avatar
Monitoring
v0.1.0
active

ukaf-cli

io.github.UriBer/ukaf-cli

Analyze Cursor and coding-agent spend per feature, DORA metrics, and lead time.

Documentation

ukaf

Sponsor CI License: MIT

What the agents spent, and what actually shipped.

ukaf reads a Cursor usage CSV and the pull requests that went with it, then tells the month as one story. Every feature is five stages in a row. The stages add up to the feature. The features plus an explicit overhead bucket add up to the export. List price (the rate card, before the included pool) and billed cost (what the CSV charged) are both in the story, and a reconciliation check fails the run if a part does not meet the whole.

There is no second clock. Lead time is testing plus deploy. Time to restore is the fixes stage. You will not see "launch → merge" sitting next to "PR open → merge".

Install

Use Python 3.11 or later.

MethodCommand
pipxpipx install ukaf-cli
uvxuvx --from ukaf-cli ukaf --version
pippython -m pip install ukaf-cli
Homebrewbrew install UriBer/tap/ukaf-cli

To install from source:

git clone https://github.com/UriBer/ukaf-cli.git
cd ukaf-cli
python3 -m venv .venv
. .venv/bin/activate
python -m pip install .

Quickstart

ukaf report \
  --usage examples/usage.csv \
  --github-fixture examples/github.json \
  --out ./out \
  --lang en

That writes report.html, report.json, and report.md. The sample HTML report shows list and billed totals, how stages and overhead add up, cost by tier, the priciest usage day, and ranked recommendations. It opens offline.

Screenshots of that sample, in English and Hebrew, are on the GitHub Pages showcase rather than in this repository. The same kind of walkthrough can also live on di2ops.com.

ukaf report, English

Generate the same report with Hebrew labels and a right-to-left layout:

ukaf report --usage examples/usage.csv --github-fixture examples/github.json --out /tmp/ukaf-he --lang he

ukaf report, Hebrew RTL

examples/usage.csv is synthetic. It has the same columns as a Cursor usage export and none of anyone's real rows. Do not commit a real export.

Live GitHub data

export GITHUB_TOKEN=...   # or GH_TOKEN
ukaf report \
  --usage ~/Downloads/usage.csv \
  --repo owner/name \
  --repo owner/other \
  --out ./out

Put the cloud agent id in the pull request body (Agent: bc-...) so the run attaches to that feature. An agent id with no pull request, and every row with no agent id, stays in overhead. ukaf will not guess editor traffic onto whichever PR happens to be open.

The additive story

StageClock
Planning / specIssue opened → agent launch
DevelopmentAgent launch → first push
Testing / CIFirst push → first green check (or the last check, if it never went green)
Deploy + acceptanceThat check → production deploy (or the merge, if there is no deploy)
FixesAcceptance → restore, revert, or a later commit

A milestone that arrives out of order becomes a zero-length stage. It does not start a second, overlapping interval. Rework before the first green check stays inside testing. The fixes stage is only what happens after acceptance.

List price comes from src/ukaf/data/cursor.toml (USD per million tokens, taken from the Cursor models and pricing page on 2026-12-03). Included and Free bill as zero and still have a list price, so you can see what the pool absorbed. Each event is rounded half-even to a micro-dollar and then summed. The published total is that sum.

Complexity

Hand-written SLOC is additions plus deletions, excluding lockfiles and generated paths (package-lock.json, *.pb.go, dist/, and the rest listed in src/ukaf/delivery.py). The tier is the higher of the two gates:

TierHand-written SLOCCounted files
Sunder 503 or fewer
M50–2994–10
L300–99911–30
XL1000 or more31 or more

Cost by tier is a partition of feature spend. Overhead is a separate row. Those rows add up to the export. They are not an extra tax on top of the feature story.

Recommendations

Rules only. Each one names the action, the evidence from this window, and a monthly estimate in dollars or minutes. They are ranked by billed saving, then list-price saving, then minutes. Nothing in the report says "consider optimizing your workflow."

MCP server

The stdio server uses the optional MCP extra. Run it with uvx --from "ukaf-cli[mcp]" ukaf mcp or install the extra with pip install "ukaf-cli[mcp]" and run ukaf mcp. Supply paths readable by the local server. Absolute paths work regardless of the client's working directory.

Cursor

Add to Cursor

Add to Cursor or add this to .cursor/mcp.json.

{
  "mcpServers": {
    "ukaf": {
      "command": "uvx",
      "args": ["--from", "ukaf-cli[mcp]", "ukaf", "mcp"]
    }
  }
}

Claude Code

claude mcp add ukaf -- uvx --from "ukaf-cli[mcp]" ukaf mcp

Codex

Add this to ~/.codex/config.toml.

[mcp_servers.ukaf]
command = "uvx"
args = ["--from", "ukaf-cli[mcp]", "ukaf", "mcp"]

Or run:

codex mcp add ukaf -- uvx --from "ukaf-cli[mcp]" ukaf mcp

Tools

ToolInputsResult
build_reportusage_csv, out_dir; optional github_fixture, lang (en or he), pricingHTML, JSON, and Markdown paths, plus headline totals. Omitting the fixture puts usage in overhead.
cost_per_featureusage_csv, github_fixturePer-feature list and billed costs, stage breakdown, and tier.
recommendationsusage_csv, github_fixtureRanked actions with evidence and estimated impact.
dora_summaryusage_csv, github_fixtureDeployment frequency, median lead time, failure rate, and restore time.

Agent skill

Copy the skills/ukaf-cli directory from this repo to ~/.cursor/skills/ or your project's .claude/skills/. You can also use npx skills add UriBer/ukaf-cli.

Sponsorship

The tool is MIT. Funding is for maintenance, not a paid tier.

Projects that are serious about this (the ones GitHub's own docs are written around, and the ones that keep a public sponsor button) do four small things and then stop:

  1. .github/FUNDING.yml, which is what turns on the Sponsor button. github: UriBer is set. open_collective, ko_fi, buy_me_a_coffee, polar, and thanks_dev are comments, because those accounts are the maintainer's to open.
  2. A sponsor badge and a short section in this README.
  3. A SUPPORTERS.md that separates sponsors and backers, and says when the list is empty.
  4. One line in ukaf --version and in the report footer. No nag on every log line.

ukaf 0.1.0 · sponsor the work: https://github.com/sponsors/UriBer

Owner step: GitHub Sponsors has to be enabled on the UriBer profile (the Stripe tax interview). Until that is approved, the button and the badge point at a page that cannot accept money. ukaf does not create a Polar, Open Collective, Ko-fi, or Buy Me a Coffee account.

Development

See CONTRIBUTING.md and CODE_OF_CONDUCT.md. CI runs ruff and pytest.

ukaf --version
PYPI
ukaf-cli
Install Command
pip install ukaf-cli
Runtime: uvx