ukaf-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ukaf/__init__.py +8 -0
- ukaf/__main__.py +4 -0
- ukaf/cli.py +88 -0
- ukaf/data/cursor.toml +148 -0
- ukaf/delivery.py +268 -0
- ukaf/dora.py +62 -0
- ukaf/github_api.py +286 -0
- ukaf/i18n.py +119 -0
- ukaf/mcp_server.py +70 -0
- ukaf/money.py +34 -0
- ukaf/pricing.py +172 -0
- ukaf/recommend.py +357 -0
- ukaf/reconcile.py +185 -0
- ukaf/render_html.py +584 -0
- ukaf/reporting.py +50 -0
- ukaf/serialize.py +340 -0
- ukaf/story.py +459 -0
- ukaf/timeutil.py +65 -0
- ukaf/usage.py +150 -0
- ukaf_cli-0.1.0.dist-info/METADATA +213 -0
- ukaf_cli-0.1.0.dist-info/RECORD +25 -0
- ukaf_cli-0.1.0.dist-info/WHEEL +5 -0
- ukaf_cli-0.1.0.dist-info/entry_points.txt +3 -0
- ukaf_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
- ukaf_cli-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ukaf-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Story-style cost and delivery dashboard for AI coding-agent usage
|
|
5
|
+
Author: Uri Berman
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/UriBer/ukaf-cli
|
|
8
|
+
Project-URL: Sponsorship, https://github.com/sponsors/UriBer
|
|
9
|
+
Project-URL: Source, https://github.com/UriBer/ukaf-cli
|
|
10
|
+
Project-URL: Changelog, https://github.com/UriBer/ukaf-cli/releases
|
|
11
|
+
Project-URL: Issues, https://github.com/UriBer/ukaf-cli/issues
|
|
12
|
+
Keywords: cursor,dora,cost-analysis,cli,coding-agents,lead-time,mcp
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Provides-Extra: mcp
|
|
24
|
+
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
|
|
25
|
+
Provides-Extra: dev
|
|
26
|
+
Requires-Dist: ukaf-cli[mcp]; extra == "dev"
|
|
27
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
28
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# ukaf
|
|
32
|
+
|
|
33
|
+
<!-- mcp-name: io.github.UriBer/ukaf-cli -->
|
|
34
|
+
|
|
35
|
+
[](https://github.com/sponsors/UriBer)
|
|
36
|
+
[](https://github.com/UriBer/ukaf-cli/actions/workflows/ci.yml)
|
|
37
|
+
[](LICENSE)
|
|
38
|
+
|
|
39
|
+
What the agents spent, and what actually shipped.
|
|
40
|
+
|
|
41
|
+
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.
|
|
42
|
+
|
|
43
|
+
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".
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
Use Python 3.11 or later.
|
|
48
|
+
|
|
49
|
+
| Method | Command |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| pipx | `pipx install ukaf-cli` |
|
|
52
|
+
| uvx | `uvx --from ukaf-cli ukaf --version` |
|
|
53
|
+
| pip | `python -m pip install ukaf-cli` |
|
|
54
|
+
| Homebrew | `brew install UriBer/tap/ukaf-cli` |
|
|
55
|
+
|
|
56
|
+
To install from source:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/UriBer/ukaf-cli.git
|
|
60
|
+
cd ukaf-cli
|
|
61
|
+
python3 -m venv .venv
|
|
62
|
+
. .venv/bin/activate
|
|
63
|
+
python -m pip install .
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quickstart
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
ukaf report \
|
|
70
|
+
--usage examples/usage.csv \
|
|
71
|
+
--github-fixture examples/github.json \
|
|
72
|
+
--out ./out \
|
|
73
|
+
--lang en
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
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.
|
|
77
|
+
|
|
78
|
+
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).
|
|
79
|
+
|
|
80
|
+

|
|
81
|
+
|
|
82
|
+
Generate the same report with Hebrew labels and a right-to-left layout:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ukaf report --usage examples/usage.csv --github-fixture examples/github.json --out /tmp/ukaf-he --lang he
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+

|
|
89
|
+
|
|
90
|
+
`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.
|
|
91
|
+
|
|
92
|
+
### Live GitHub data
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
export GITHUB_TOKEN=... # or GH_TOKEN
|
|
96
|
+
ukaf report \
|
|
97
|
+
--usage ~/Downloads/usage.csv \
|
|
98
|
+
--repo owner/name \
|
|
99
|
+
--repo owner/other \
|
|
100
|
+
--out ./out
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
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.
|
|
104
|
+
|
|
105
|
+
## The additive story
|
|
106
|
+
|
|
107
|
+
| Stage | Clock |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| Planning / spec | Issue opened → agent launch |
|
|
110
|
+
| Development | Agent launch → first push |
|
|
111
|
+
| Testing / CI | First push → first green check (or the last check, if it never went green) |
|
|
112
|
+
| Deploy + acceptance | That check → production deploy (or the merge, if there is no deploy) |
|
|
113
|
+
| Fixes | Acceptance → restore, revert, or a later commit |
|
|
114
|
+
|
|
115
|
+
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.
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
## Complexity
|
|
120
|
+
|
|
121
|
+
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:
|
|
122
|
+
|
|
123
|
+
| Tier | Hand-written SLOC | Counted files |
|
|
124
|
+
| --- | --- | --- |
|
|
125
|
+
| S | under 50 | 3 or fewer |
|
|
126
|
+
| M | 50–299 | 4–10 |
|
|
127
|
+
| L | 300–999 | 11–30 |
|
|
128
|
+
| XL | 1000 or more | 31 or more |
|
|
129
|
+
|
|
130
|
+
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.
|
|
131
|
+
|
|
132
|
+
## Recommendations
|
|
133
|
+
|
|
134
|
+
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."
|
|
135
|
+
|
|
136
|
+
## MCP server
|
|
137
|
+
|
|
138
|
+
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.
|
|
139
|
+
|
|
140
|
+
### Cursor
|
|
141
|
+
|
|
142
|
+
[](https://cursor.com/en/install-mcp?name=ukaf&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJ1a2FmLWNsaVttY3BdIiwidWthZiIsIm1jcCJdfQ%3D%3D)
|
|
143
|
+
|
|
144
|
+
[Add to Cursor](https://cursor.com/en/install-mcp?name=ukaf&config=eyJjb21tYW5kIjoidXZ4IiwiYXJncyI6WyItLWZyb20iLCJ1a2FmLWNsaVttY3BdIiwidWthZiIsIm1jcCJdfQ%3D%3D) or add this to `.cursor/mcp.json`.
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"mcpServers": {
|
|
149
|
+
"ukaf": {
|
|
150
|
+
"command": "uvx",
|
|
151
|
+
"args": ["--from", "ukaf-cli[mcp]", "ukaf", "mcp"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Claude Code
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
claude mcp add ukaf -- uvx --from "ukaf-cli[mcp]" ukaf mcp
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Codex
|
|
164
|
+
|
|
165
|
+
Add this to `~/.codex/config.toml`.
|
|
166
|
+
|
|
167
|
+
```toml
|
|
168
|
+
[mcp_servers.ukaf]
|
|
169
|
+
command = "uvx"
|
|
170
|
+
args = ["--from", "ukaf-cli[mcp]", "ukaf", "mcp"]
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Or run:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
codex mcp add ukaf -- uvx --from "ukaf-cli[mcp]" ukaf mcp
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Tools
|
|
180
|
+
|
|
181
|
+
| Tool | Inputs | Result |
|
|
182
|
+
| --- | --- | --- |
|
|
183
|
+
| `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. |
|
|
184
|
+
| `cost_per_feature` | `usage_csv`, `github_fixture` | Per-feature list and billed costs, stage breakdown, and tier. |
|
|
185
|
+
| `recommendations` | `usage_csv`, `github_fixture` | Ranked actions with evidence and estimated impact. |
|
|
186
|
+
| `dora_summary` | `usage_csv`, `github_fixture` | Deployment frequency, median lead time, failure rate, and restore time. |
|
|
187
|
+
|
|
188
|
+
## Agent skill
|
|
189
|
+
|
|
190
|
+
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`.
|
|
191
|
+
|
|
192
|
+
## Sponsorship
|
|
193
|
+
|
|
194
|
+
The tool is MIT. Funding is for maintenance, not a paid tier.
|
|
195
|
+
|
|
196
|
+
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:
|
|
197
|
+
|
|
198
|
+
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.
|
|
199
|
+
2. A sponsor badge and a short section in this README.
|
|
200
|
+
3. A [SUPPORTERS.md](SUPPORTERS.md) that separates sponsors and backers, and says when the list is empty.
|
|
201
|
+
4. One line in `ukaf --version` and in the report footer. No nag on every log line.
|
|
202
|
+
|
|
203
|
+
`ukaf 0.1.0 · sponsor the work: https://github.com/sponsors/UriBer`
|
|
204
|
+
|
|
205
|
+
**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.
|
|
206
|
+
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md). CI runs ruff and pytest.
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
ukaf --version
|
|
213
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
ukaf/__init__.py,sha256=e_wIMnc9ydaEVG3zLY5YG86S2SUCr19pCDGU8qAJUPg,301
|
|
2
|
+
ukaf/__main__.py,sha256=H7nMi5qF-jzlvVawwFRPDMBsT2WLAMLjeCwnMadLRBg,83
|
|
3
|
+
ukaf/cli.py,sha256=aKGNqkHy1rOqRqVdaWA7EhkZCoRI9k4mNMTX-u5cXF8,3567
|
|
4
|
+
ukaf/delivery.py,sha256=HrYZ7AhNCwGsdz3lIOnFRIech-dDkIddUCaR00Y6BBg,7396
|
|
5
|
+
ukaf/dora.py,sha256=9nkqIdPo1dDa7tY6WXqEegBw2l4ZSOlbO9G7XPxNWPw,2171
|
|
6
|
+
ukaf/github_api.py,sha256=pTzACXkDl9wq5X9XnIFzdLqh343GLoiOiaXfNbIgr-I,9967
|
|
7
|
+
ukaf/i18n.py,sha256=G7kIvnzaiDcP9yL7RJyAYa7s1NS2a6cLRPHRnQlPPcs,4925
|
|
8
|
+
ukaf/mcp_server.py,sha256=HUpjzdpRPRDZ9HkiBvbXruSf-min2jfEaIKenUdc_tA,3083
|
|
9
|
+
ukaf/money.py,sha256=Lh18oJQ7_jpM2Fkq1nudKlWE9hxKvF5r7rXrdgRf9_c,1047
|
|
10
|
+
ukaf/pricing.py,sha256=TlulHCeExZ3VmqZHP7V6Fo3dAbnLV4lkX0EEm2G37gM,5135
|
|
11
|
+
ukaf/recommend.py,sha256=msOsSZ-k5c6fZ8PCvveaFdu5YFi1Woi2kklusuGBySI,15879
|
|
12
|
+
ukaf/reconcile.py,sha256=pw2BCawoPCtXTASQNbI3tcj2Ey-AFAw0L5tOhao6roE,5977
|
|
13
|
+
ukaf/render_html.py,sha256=ctPB54W7uHerHby2KipneXzJ9vjoOIIfRlwnNUw5YJY,25962
|
|
14
|
+
ukaf/reporting.py,sha256=QVBxxJUmOpX2wY6_uS6bbA1nCs887x9og3DQog1J2cQ,1981
|
|
15
|
+
ukaf/serialize.py,sha256=rbeBFnAwvR4OUrYonl2swx3Pi2TZ1oer6GVv1fZUSk4,14698
|
|
16
|
+
ukaf/story.py,sha256=7L8uAZGfg-I-BS0mMgm6iNBgmhb5OSYOjAKg0thk5Cg,15889
|
|
17
|
+
ukaf/timeutil.py,sha256=aVtEK9-8q875bk6rnD_lv9VNeTfwSveDrIb3owHqihA,1885
|
|
18
|
+
ukaf/usage.py,sha256=GyT71yHtOZPOmErB0XQ1s-E4nYNtgZ85N_-92JKPUEE,4454
|
|
19
|
+
ukaf/data/cursor.toml,sha256=4KgoKJfmbIAbEnOpiGdp784dchND0oheUd-ds50Ghxw,3822
|
|
20
|
+
ukaf_cli-0.1.0.dist-info/licenses/LICENSE,sha256=olLB3bJXoQs6r0lVFzKmsLk1DvKB2k1CfHPvA68iV34,1067
|
|
21
|
+
ukaf_cli-0.1.0.dist-info/METADATA,sha256=B1lQLKMz7eYEfXSq2jP5lv7Af4kDuOz-orBhGmb7pT4,9374
|
|
22
|
+
ukaf_cli-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
23
|
+
ukaf_cli-0.1.0.dist-info/entry_points.txt,sha256=GK_phqEs_am5MQboLx0CvyQYILd5R5IN0U_A3UIurPg,64
|
|
24
|
+
ukaf_cli-0.1.0.dist-info/top_level.txt,sha256=EQgngDsJzYfjdjFX9yFglr6C3KR5GbwCi76rV6ClXhY,5
|
|
25
|
+
ukaf_cli-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Uri Berman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ukaf
|