
ukaf-cli
io.github.UriBer/ukaf-cli
Analyze Cursor and coding-agent spend per feature, DORA metrics, and lead time.
Documentation
ukaf
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.
| Method | Command |
|---|---|
| pipx | pipx install ukaf-cli |
| uvx | uvx --from ukaf-cli ukaf --version |
| pip | python -m pip install ukaf-cli |
| Homebrew | brew 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.

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

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
| Stage | Clock |
|---|---|
| Planning / spec | Issue opened → agent launch |
| Development | Agent launch → first push |
| Testing / CI | First push → first green check (or the last check, if it never went green) |
| Deploy + acceptance | That check → production deploy (or the merge, if there is no deploy) |
| Fixes | Acceptance → 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:
| Tier | Hand-written SLOC | Counted files |
|---|---|---|
| S | under 50 | 3 or fewer |
| M | 50–299 | 4–10 |
| L | 300–999 | 11–30 |
| XL | 1000 or more | 31 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 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
| Tool | Inputs | Result |
|---|---|---|
build_report | usage_csv, out_dir; optional github_fixture, lang (en or he), pricing | HTML, JSON, and Markdown paths, plus headline totals. Omitting the fixture puts usage in overhead. |
cost_per_feature | usage_csv, github_fixture | Per-feature list and billed costs, stage breakdown, and tier. |
recommendations | usage_csv, github_fixture | Ranked actions with evidence and estimated impact. |
dora_summary | usage_csv, github_fixture | Deployment 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:
.github/FUNDING.yml, which is what turns on the Sponsor button.github: UriBeris set.open_collective,ko_fi,buy_me_a_coffee,polar, andthanks_devare comments, because those accounts are the maintainer's to open.- A sponsor badge and a short section in this README.
- A SUPPORTERS.md that separates sponsors and backers, and says when the list is empty.
- One line in
ukaf --versionand 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
ukaf-clipip install ukaf-cli