Metadata-Version: 2.4
Name: ukaf-cli
Version: 0.1.0
Summary: Story-style cost and delivery dashboard for AI coding-agent usage
Author: Uri Berman
License-Expression: MIT
Project-URL: Homepage, https://github.com/UriBer/ukaf-cli
Project-URL: Sponsorship, https://github.com/sponsors/UriBer
Project-URL: Source, https://github.com/UriBer/ukaf-cli
Project-URL: Changelog, https://github.com/UriBer/ukaf-cli/releases
Project-URL: Issues, https://github.com/UriBer/ukaf-cli/issues
Keywords: cursor,dora,cost-analysis,cli,coding-agents,lead-time,mcp
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
Provides-Extra: dev
Requires-Dist: ukaf-cli[mcp]; extra == "dev"
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

# ukaf

<!-- mcp-name: io.github.UriBer/ukaf-cli -->

[![Sponsor](https://img.shields.io/badge/sponsor-ukaf-ea4aaa?logo=github-sponsors)](https://github.com/sponsors/UriBer)
[![CI](https://github.com/UriBer/ukaf-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/UriBer/ukaf-cli/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

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:

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

## Quickstart

```bash
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](examples/report.html) 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](https://uriber.github.io/ukaf-cli/) rather than in this repository. The same kind of walkthrough can also live on [di2ops.com](https://di2ops.com).

![ukaf report, English](https://uriber.github.io/ukaf-cli/after-en.png)

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

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

![ukaf report, Hebrew RTL](https://uriber.github.io/ukaf-cli/after-he.png)

`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

```bash
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](https://cursor.com/docs/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](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=ukaf&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJ1a2FmLWNsaVttY3BdIiwidWthZiIsIm1jcCJdfQ%3D%3D)

[Add to Cursor](https://cursor.com/en/install-mcp?name=ukaf&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJ1a2FmLWNsaVttY3BdIiwidWthZiIsIm1jcCJdfQ%3D%3D) or add this to `.cursor/mcp.json`.

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

### Claude Code

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

### Codex

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

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

Or run:

```bash
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](skills/ukaf-cli) 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](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](https://github.com/sponsors/UriBer) (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](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). CI runs ruff and pytest.

```bash
ukaf --version
```
