coding-agent-roi 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.
- agent_roi/__init__.py +3 -0
- agent_roi/api/__init__.py +1 -0
- agent_roi/api/app.py +179 -0
- agent_roi/classify/__init__.py +26 -0
- agent_roi/classify/base.py +44 -0
- agent_roi/classify/semantic.py +197 -0
- agent_roi/cli/__init__.py +1 -0
- agent_roi/cli/main.py +200 -0
- agent_roi/collectors/__init__.py +31 -0
- agent_roi/collectors/base.py +49 -0
- agent_roi/collectors/claude_code.py +165 -0
- agent_roi/collectors/codex.py +157 -0
- agent_roi/collectors/copilot.py +210 -0
- agent_roi/collectors/gemini.py +220 -0
- agent_roi/core/__init__.py +1 -0
- agent_roi/core/config.py +58 -0
- agent_roi/core/models.py +241 -0
- agent_roi/core/platform.py +113 -0
- agent_roi/core/pricing.py +79 -0
- agent_roi/core/project.py +52 -0
- agent_roi/core/service.py +172 -0
- agent_roi/core/timeframe.py +76 -0
- agent_roi/core/tokens.py +30 -0
- agent_roi/storage/__init__.py +5 -0
- agent_roi/storage/db.py +542 -0
- coding_agent_roi-0.1.0.dist-info/METADATA +163 -0
- coding_agent_roi-0.1.0.dist-info/RECORD +30 -0
- coding_agent_roi-0.1.0.dist-info/WHEEL +4 -0
- coding_agent_roi-0.1.0.dist-info/entry_points.txt +2 -0
- coding_agent_roi-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: coding-agent-roi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Track the cost, usage, and ROI of your AI coding agents across every tool.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Agent-ROI/agent-roi
|
|
6
|
+
Project-URL: Repository, https://github.com/Agent-ROI/agent-roi
|
|
7
|
+
Project-URL: Issues, https://github.com/Agent-ROI/agent-roi/issues
|
|
8
|
+
Author: Agent-ROI contributors
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai,claude,codex,cost,llm,observability,roi,tokens
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Requires-Dist: fastapi>=0.111
|
|
19
|
+
Requires-Dist: httpx>=0.27
|
|
20
|
+
Requires-Dist: platformdirs>=4.2
|
|
21
|
+
Requires-Dist: pydantic-settings>=2.3
|
|
22
|
+
Requires-Dist: pydantic>=2.7
|
|
23
|
+
Requires-Dist: rich>=13.7
|
|
24
|
+
Requires-Dist: sqlalchemy>=2.0
|
|
25
|
+
Requires-Dist: tomli>=2.0; python_version < '3.11'
|
|
26
|
+
Requires-Dist: typer>=0.12
|
|
27
|
+
Requires-Dist: uvicorn[standard]>=0.30
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: pytest>=8.2; extra == 'dev'
|
|
33
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
<div align="center">
|
|
37
|
+
|
|
38
|
+
# Agent-ROI
|
|
39
|
+
|
|
40
|
+
**Track the cost, usage, and ROI of your AI coding agents — across every tool.**
|
|
41
|
+
|
|
42
|
+
[](LICENSE)
|
|
43
|
+
[](https://www.python.org/downloads/)
|
|
44
|
+
[](https://github.com/Agent-ROI/agent-roi/actions/workflows/ci.yml)
|
|
45
|
+
|
|
46
|
+
[English](./README.md) · [繁體中文](./README.zh.md)
|
|
47
|
+
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## What is Agent-ROI?
|
|
53
|
+
|
|
54
|
+
When you use multiple AI coding tools — Claude Code, Codex CLI, GitHub Copilot, Cursor, and others — your token spend is scattered everywhere and impossible to evaluate. **Agent-ROI** unifies all of it.
|
|
55
|
+
|
|
56
|
+
It reads the local session logs each tool already writes, uses a **model-free semantic classifier** to discover *what topic / task* each session was about, and then shows you **how many tokens each topic consumed** — so you can measure the **return on investment** of your agents, not just raw token counts.
|
|
57
|
+
|
|
58
|
+
> The core question Agent-ROI answers: *"For this feature / bug / topic, how many tokens did my agents burn — and was it worth it?"*
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- 🔌 **Tool-agnostic collectors** — parse local logs from Claude Code, Codex CLI, GitHub Copilot, and Gemini CLI (no proxy, no workflow change).
|
|
63
|
+
- 🧠 **Topic classification** — a model-free semantic classifier groups sessions by topic so you see cost *per subject*, not per request. Runs fully offline, costs nothing, requires no external service.
|
|
64
|
+
- 💰 **Cost & ROI tracking** — token usage mapped to per-model pricing, aggregated by **topic, tool, or model**, over a **custom time window**.
|
|
65
|
+
- 🔎 **Drill-down & trust** — click any topic to see which tools and models its tokens came from; every figure is backed by a **viewable pricing table**, and estimated numbers are clearly badged vs exact ones.
|
|
66
|
+
- 🖥️ **CLI** — `report`, per-topic drill-down, and a `pricing` command straight from the terminal.
|
|
67
|
+
- 🌐 **Web UI** — a modern React dashboard with dimension/time controls, breakdowns, and drill-downs.
|
|
68
|
+
- 🗄️ **Local-first** — everything stays on your machine (SQLite); fully offline; classification never sends data anywhere.
|
|
69
|
+
|
|
70
|
+
## Architecture
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
┌──────────────┐ ┌──────────────┐ ┌──────────────┐
|
|
74
|
+
│ Collectors │──▶│ Classifier │──▶│ Storage │
|
|
75
|
+
│ (parse logs) │ │ (semantic) │ │ (SQLite) │
|
|
76
|
+
└──────────────┘ └──────────────┘ └──────┬───────┘
|
|
77
|
+
│
|
|
78
|
+
┌──────────────────┼──────────────────┐
|
|
79
|
+
▼ ▼
|
|
80
|
+
┌────────────┐ ┌────────────┐
|
|
81
|
+
│ CLI │ │ REST API │──▶ Web UI (React)
|
|
82
|
+
└────────────┘ └────────────┘
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
See [docs/architecture.md](./docs/architecture.md) for details.
|
|
86
|
+
|
|
87
|
+
## Install
|
|
88
|
+
|
|
89
|
+
One line (macOS / Linux / WSL). Installs `uv` if needed, then the `agent-roi` command:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
curl -LsSf https://raw.githubusercontent.com/Agent-ROI/agent-roi/main/scripts/install.sh | sh
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
<details>
|
|
96
|
+
<summary>Other ways to install</summary>
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# With pipx
|
|
100
|
+
pipx install agent-roi
|
|
101
|
+
|
|
102
|
+
# With uv
|
|
103
|
+
uv tool install agent-roi
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
To install the latest from source before a release is published, set
|
|
107
|
+
`AGENT_ROI_FROM_GIT=1` before running the install script.
|
|
108
|
+
</details>
|
|
109
|
+
|
|
110
|
+
## Quick Start
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Ingest logs from all detected tools
|
|
114
|
+
agent-roi ingest
|
|
115
|
+
|
|
116
|
+
# Discover topics from your sessions (model-free, fully local)
|
|
117
|
+
agent-roi classify
|
|
118
|
+
|
|
119
|
+
# Cost breakdown — group by topic, tool, or model, over a time window
|
|
120
|
+
agent-roi report --by tool --since 7d
|
|
121
|
+
|
|
122
|
+
# Drill into one topic: which tools/models did its tokens come from?
|
|
123
|
+
agent-roi topic "auth refactor"
|
|
124
|
+
|
|
125
|
+
# Inspect the pricing table behind every cost figure
|
|
126
|
+
agent-roi pricing
|
|
127
|
+
|
|
128
|
+
# Launch the web dashboard (API + React UI), then open http://127.0.0.1:8000
|
|
129
|
+
agent-roi serve
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
> Developing Agent-ROI itself? See [CONTRIBUTING.md](./CONTRIBUTING.md) — local
|
|
133
|
+
> dev uses `uv` and runs the frontend on a separate Vite dev server.
|
|
134
|
+
|
|
135
|
+
## Configuration
|
|
136
|
+
|
|
137
|
+
Agent-ROI looks for config at `~/.config/agent-roi/config.toml`. See [docs/configuration.md](./docs/configuration.md).
|
|
138
|
+
|
|
139
|
+
```toml
|
|
140
|
+
[classifier]
|
|
141
|
+
similarity_threshold = 0.18 # higher = more, smaller topics
|
|
142
|
+
label_terms = 3 # words used to name each topic
|
|
143
|
+
|
|
144
|
+
[collectors]
|
|
145
|
+
enabled = ["claude_code", "codex", "copilot", "gemini"]
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
| Doc | English | 繁體中文 |
|
|
151
|
+
|-----|---------|----------|
|
|
152
|
+
| Architecture | [architecture.md](./docs/architecture.md) | [architecture.zh.md](./docs/architecture.zh.md) |
|
|
153
|
+
| Configuration | [configuration.md](./docs/configuration.md) | [configuration.zh.md](./docs/configuration.zh.md) |
|
|
154
|
+
| Collectors | [collectors.md](./docs/collectors.md) | [collectors.zh.md](./docs/collectors.zh.md) |
|
|
155
|
+
| Contributing | [CONTRIBUTING.md](./CONTRIBUTING.md) | [CONTRIBUTING.zh.md](./CONTRIBUTING.zh.md) |
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
Contributions are welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) and our [Code of Conduct](./CODE_OF_CONDUCT.md).
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
[MIT](./LICENSE) © Agent-ROI contributors
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
agent_roi/__init__.py,sha256=w5PAbosOHLW324YR33d1EdHhLufCMJX5OAEmZZeaBkM,105
|
|
2
|
+
agent_roi/api/__init__.py,sha256=8LheufkuMWBJbkSeZqzpwWmGBHxShmb5-wPGEXE5p38,24
|
|
3
|
+
agent_roi/api/app.py,sha256=mdMpbjjJVVluSrgBb2PP1rxrp8Ilzm2bMlcTELyu6Wo,6489
|
|
4
|
+
agent_roi/classify/__init__.py,sha256=KOAibqKlDqCBTbrCypn7LOVXlGJ0wN30b-nI5qjakSU,866
|
|
5
|
+
agent_roi/classify/base.py,sha256=MJWy9nq1SQvZnfdKYF7rNFb-Es5_FlpR9U-GuAkO0C0,1445
|
|
6
|
+
agent_roi/classify/semantic.py,sha256=6RbWfk9Fe_bwzmpVV512OEJQCJAt0syTpJ-VUFZSIM4,7582
|
|
7
|
+
agent_roi/cli/__init__.py,sha256=C63yWifzpA0IV7YWDatpAdrhoV8zjqxAKv0xMf09VdM,19
|
|
8
|
+
agent_roi/cli/main.py,sha256=-OkN3SH7E7mdVHqFgaj1TunIrcx56bD8XqD4pkQRjcQ,7008
|
|
9
|
+
agent_roi/collectors/__init__.py,sha256=ax0xj61Ynq411QwzH02Bco8MqS78NGhbNNG3cCgAl9M,982
|
|
10
|
+
agent_roi/collectors/base.py,sha256=Ihzxke6p-38Bxf5mJZK5HCndxs0bFA5-aiPX4-AvvP4,1539
|
|
11
|
+
agent_roi/collectors/claude_code.py,sha256=0LDJyCTDryFR6R6-pZuMEi9B554m70p_hqLCqeQpbZ0,5701
|
|
12
|
+
agent_roi/collectors/codex.py,sha256=VQ9_ny4M2PEKHGdAuaOs1qrtzp7GrWDmOjfVrlSyWpE,5478
|
|
13
|
+
agent_roi/collectors/copilot.py,sha256=jHT8rPTxH7KdeZghZdUa6WBumn9OcZ9FG10JtpMa_mU,7560
|
|
14
|
+
agent_roi/collectors/gemini.py,sha256=2fpv-mzCqcCLB5lPCOH478_AMgCG7hJEB5Xp7BUiIzg,7843
|
|
15
|
+
agent_roi/core/__init__.py,sha256=ETauXfgnwzwFR_NUEv6XbO7W9aa7bwtGbjVkpB1TT_I,75
|
|
16
|
+
agent_roi/core/config.py,sha256=n7Va6sI_SD5oQ9E0r7fkJ_QL9hyRAWsF14dqk7xg76Q,1725
|
|
17
|
+
agent_roi/core/models.py,sha256=SYX1YGyJaLRY00lZGWRdAA9BI0UATNpUakFDWn8SkVU,6543
|
|
18
|
+
agent_roi/core/platform.py,sha256=2I5KGLsNmt0TRA27BMKMV4BCkpGg_n4lqn_qXYDSw1U,4049
|
|
19
|
+
agent_roi/core/pricing.py,sha256=G4204TbrjkzkMV9eJKA0oWYS9sNMpWyK3pFf6F3F-SA,3053
|
|
20
|
+
agent_roi/core/project.py,sha256=z9GDVqshBpiZPwoUAoxtc92sUy972ah1uBmBEd6bqmo,1792
|
|
21
|
+
agent_roi/core/service.py,sha256=AaJD5qcR4hKpNvBOP8GwqoPUxCMIe9q7YwvNqlnQxWY,6483
|
|
22
|
+
agent_roi/core/timeframe.py,sha256=-2oJ2Wz8dUhDvjoF6c7NReSNbg5mlez32BBnUqmpoJo,2498
|
|
23
|
+
agent_roi/core/tokens.py,sha256=sWMgvlr_aW5z7VoPPSbXIxmUgR73JBPjQIoqg4I_ZLw,1348
|
|
24
|
+
agent_roi/storage/__init__.py,sha256=tP0GmIOTy55sTE0qOz933mje3vk1A15Bu5Y6IbTsa8U,88
|
|
25
|
+
agent_roi/storage/db.py,sha256=Zf29lCwSsrc3zWL1A71ZaC1bTc4WeYx75EOrmvBYgdw,21140
|
|
26
|
+
coding_agent_roi-0.1.0.dist-info/METADATA,sha256=t7YjKrKo0LoInlg3d0L2zvuoF0qM4IUbYKOsm9YP3z4,7035
|
|
27
|
+
coding_agent_roi-0.1.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
|
|
28
|
+
coding_agent_roi-0.1.0.dist-info/entry_points.txt,sha256=Cl2DXAx1ygCVb7c5OqyxHzJumcAW3j8DLP3KQvdazIc,53
|
|
29
|
+
coding_agent_roi-0.1.0.dist-info/licenses/LICENSE,sha256=mDk0ZOBLVgqU1YR0YKy8kLeX7Mic-QTcCxRsaqqtx38,1079
|
|
30
|
+
coding_agent_roi-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Agent-ROI contributors
|
|
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.
|