repospend 0.0.2 → 0.0.3
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.
- package/CHANGELOG.md +24 -0
- package/README.md +175 -92
- package/SECURITY.md +65 -0
- package/dist/cli.js +1216 -74
- package/docs/PUBLISHING.md +57 -0
- package/package.json +8 -3
- package/web-dist/assets/index-B8lKmhuv.js +260 -0
- package/web-dist/assets/index-CUTybR_N.css +1 -0
- package/web-dist/index.html +2 -2
- package/web-dist/assets/index-B8WOvRzk.js +0 -260
- package/web-dist/assets/index-vwATk9ov.css +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to RepoSpend will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 0.0.3
|
|
6
|
+
|
|
7
|
+
- Add initial Claude Code support for local JSONL session transcripts, including projects, timestamps, models, token usage when available, and source status.
|
|
8
|
+
- Add source filtering across dashboard data and CLI summaries with `--source all|codex|claude`.
|
|
9
|
+
- Add bundled Claude pricing coverage, cache write input pricing, and Claude family pricing fallback for dated model IDs.
|
|
10
|
+
- Refresh the dashboard experience with source-aware views, Settings improvements, and fictional demo screenshots.
|
|
11
|
+
- Document supported Codex and Claude Code data sources, pricing assumptions, privacy boundaries, security reporting, and release notes.
|
|
12
|
+
- Remove the roadmap document from `docs/`.
|
|
13
|
+
|
|
14
|
+
## 0.0.2
|
|
15
|
+
|
|
16
|
+
- Add GitHub CI and npm publish workflow support.
|
|
17
|
+
- Improve npm package metadata for discovery and release publishing.
|
|
18
|
+
- Keep RepoSpend focused on local-first AI coding usage visibility.
|
|
19
|
+
|
|
20
|
+
## 0.0.1
|
|
21
|
+
|
|
22
|
+
- Initial public release.
|
|
23
|
+
- Add Codex-first local usage dashboard.
|
|
24
|
+
- Add CLI entry point for running RepoSpend locally.
|
package/README.md
CHANGED
|
@@ -6,36 +6,14 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/repospend)
|
|
7
7
|
[](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml)
|
|
8
8
|
|
|
9
|
-
RepoSpend
|
|
10
|
-
coding tokens.
|
|
9
|
+
RepoSpend is a local-first dashboard for seeing which repositories are using the
|
|
10
|
+
most AI coding tokens.
|
|
11
11
|
|
|
12
|
-
It
|
|
13
|
-
|
|
12
|
+
It reads supported local Codex and Claude Code files in read-only mode, groups
|
|
13
|
+
sessions by Git repo, and shows token usage, cost estimates, models, sessions,
|
|
14
|
+
and agent friction.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Why RepoSpend?
|
|
18
|
-
|
|
19
|
-
AI coding usage usually gets shown by date, model, or raw session. RepoSpend starts
|
|
20
|
-
with the thing most developers actually care about: the repo.
|
|
21
|
-
|
|
22
|
-
If Codex records work from both of these paths:
|
|
23
|
-
|
|
24
|
-
```text
|
|
25
|
-
/Users/elrond/dev/RivendellRecords
|
|
26
|
-
/Users/elrond/dev/RivendellRecords/apps/web
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
RepoSpend walks up to the Git root and shows them together as one
|
|
30
|
-
`RivendellRecords` project.
|
|
31
|
-
|
|
32
|
-
That makes it easier to answer questions like:
|
|
33
|
-
|
|
34
|
-
- Which repo is using the most tokens?
|
|
35
|
-
- Which sessions were unusually expensive?
|
|
36
|
-
- How much came from cached input, output, or reasoning tokens?
|
|
37
|
-
- Are command failures or repeated tool issues adding friction?
|
|
38
|
-
- Which models and days are driving the total?
|
|
16
|
+
No login. No telemetry. No prompt uploads.
|
|
39
17
|
|
|
40
18
|
## Quick Start
|
|
41
19
|
|
|
@@ -45,6 +23,8 @@ You can run RepoSpend without installing it globally:
|
|
|
45
23
|
npx repospend
|
|
46
24
|
```
|
|
47
25
|
|
|
26
|
+
Then open the local dashboard URL printed in your terminal.
|
|
27
|
+
|
|
48
28
|
Or install it once:
|
|
49
29
|
|
|
50
30
|
```bash
|
|
@@ -59,54 +39,152 @@ prints the dashboard URL. By default it runs at
|
|
|
59
39
|
RepoSpend requires Node.js `20` or newer. It uses `better-sqlite3`, so npm may
|
|
60
40
|
install a native SQLite package for your platform.
|
|
61
41
|
|
|
42
|
+
## Good For
|
|
43
|
+
|
|
44
|
+
- finding which repo is burning the most AI coding tokens
|
|
45
|
+
- reviewing expensive or unusual coding-agent sessions
|
|
46
|
+
- comparing Codex and Claude Code usage locally
|
|
47
|
+
- spotting repeated command failures and agent friction
|
|
48
|
+
- exporting usage data for your own analysis
|
|
49
|
+
|
|
50
|
+
## Screenshots
|
|
51
|
+
|
|
52
|
+
Screenshots use fictional Middle-earth demo data. The Lord of the Rings themed
|
|
53
|
+
repo names, sessions, prompts, token counts, and costs are intentional; no private
|
|
54
|
+
repository data is shown.
|
|
55
|
+
|
|
56
|
+
### Overview
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
The main dashboard summarizes AI coding tokens, API-equivalent cost, top repos,
|
|
61
|
+
cache reuse, file edits, and command issue rate.
|
|
62
|
+
|
|
63
|
+
### Repositories
|
|
64
|
+
|
|
65
|
+

|
|
66
|
+
|
|
67
|
+
The repos view compares spend, tokens, sessions, cache hit rate, file edits, and
|
|
68
|
+
token intensity across projects.
|
|
69
|
+
|
|
70
|
+
### Repository Detail
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
Repo detail explains why a project stands out, including cost concentration,
|
|
75
|
+
warnings, token shape, sessions, and command signals.
|
|
76
|
+
|
|
77
|
+
### Sessions
|
|
78
|
+
|
|
79
|
+

|
|
80
|
+
|
|
81
|
+
The sessions view makes individual AI coding runs searchable and sortable by
|
|
82
|
+
repo, tool, model, outcome, cost, tokens, and activity.
|
|
83
|
+
|
|
84
|
+
### Session Detail
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
Session detail shows the shape of one run: cost, tokens, model, file edits,
|
|
89
|
+
commands, highlights, and issues to inspect.
|
|
90
|
+
|
|
91
|
+
### Agent Friction
|
|
92
|
+
|
|
93
|
+

|
|
94
|
+
|
|
95
|
+
Agent Friction separates blocking command failures from harmless shell exits so
|
|
96
|
+
high-token troubleshooting is easier to review.
|
|
97
|
+
|
|
62
98
|
## What It Shows
|
|
63
99
|
|
|
64
|
-
RepoSpend helps you break down local
|
|
100
|
+
RepoSpend helps you break down local AI coding usage by:
|
|
65
101
|
|
|
66
102
|
- repo
|
|
67
103
|
- session
|
|
68
104
|
- day and hour
|
|
69
105
|
- model
|
|
70
|
-
- app/
|
|
106
|
+
- source/tool and app/surface, where detectable
|
|
71
107
|
- token type
|
|
72
108
|
- estimated API-equivalent cost
|
|
73
109
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Most of the time you only need:
|
|
110
|
+
If Codex records work from both of these paths:
|
|
77
111
|
|
|
78
|
-
```
|
|
79
|
-
|
|
112
|
+
```text
|
|
113
|
+
/Users/elrond/dev/RivendellRecords
|
|
114
|
+
/Users/elrond/dev/RivendellRecords/apps/web
|
|
80
115
|
```
|
|
81
116
|
|
|
82
|
-
|
|
117
|
+
RepoSpend walks up to the Git root and shows them together as one
|
|
118
|
+
`RivendellRecords` project.
|
|
83
119
|
|
|
84
|
-
|
|
85
|
-
repospend scan
|
|
86
|
-
repospend by-repo
|
|
87
|
-
repospend by-day
|
|
88
|
-
repospend by-hour
|
|
89
|
-
repospend by-model
|
|
90
|
-
repospend by-app
|
|
91
|
-
repospend export --format json
|
|
92
|
-
repospend export --format csv
|
|
93
|
-
```
|
|
120
|
+
## Supported Tools
|
|
94
121
|
|
|
95
|
-
|
|
96
|
-
|
|
122
|
+
| Tool | Status | Notes |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| Codex | Most complete support | Tokens, models, sessions, repo grouping, command friction |
|
|
125
|
+
| Claude Code | Initial support | Sessions, projects, models, timestamps, tokens when available |
|
|
126
|
+
| RTK | Optional/local | Shown only when local RTK data exists |
|
|
127
|
+
|
|
128
|
+
RepoSpend started as a Codex-first release. Claude Code support is newer and
|
|
129
|
+
depends on what your local Claude Code files include.
|
|
130
|
+
|
|
131
|
+
## Privacy
|
|
132
|
+
|
|
133
|
+
RepoSpend is local-first:
|
|
134
|
+
|
|
135
|
+
- no login
|
|
136
|
+
- no telemetry
|
|
137
|
+
- no prompt uploads
|
|
138
|
+
- no changes to Codex or Claude Code files
|
|
139
|
+
|
|
140
|
+
Everything the dashboard shows comes from files already on your machine.
|
|
141
|
+
|
|
142
|
+
## Cost Estimates, Not Invoices
|
|
143
|
+
|
|
144
|
+
RepoSpend shows **API-equivalent cost**.
|
|
145
|
+
|
|
146
|
+
That means it estimates cost from local token counts and the pricing assumptions
|
|
147
|
+
stored in RepoSpend. It is useful for comparing repos and sessions, but it is not
|
|
148
|
+
an invoice.
|
|
149
|
+
|
|
150
|
+
Your actual cost may be different because of subscriptions, credits, included
|
|
151
|
+
usage, account-level terms, provider changes, or other billing details. If you use
|
|
152
|
+
Codex or Claude Code through a subscription, read the number as "what this token
|
|
153
|
+
usage would roughly cost at API-style rates."
|
|
154
|
+
|
|
155
|
+
Claude Code cost may show as unknown when local files do not include token counts
|
|
156
|
+
or a model name. RepoSpend shows those sessions with unknown tokens/cost rather
|
|
157
|
+
than guessing.
|
|
97
158
|
|
|
98
159
|
## What It Reads
|
|
99
160
|
|
|
100
|
-
RepoSpend reads Codex
|
|
161
|
+
RepoSpend only reads local files. It does not edit Codex, Claude Code, or RTK
|
|
162
|
+
data.
|
|
163
|
+
|
|
164
|
+
Codex data:
|
|
101
165
|
|
|
102
166
|
```text
|
|
103
167
|
~/.codex/state_5.sqlite
|
|
104
168
|
~/.codex/sessions
|
|
105
169
|
```
|
|
106
170
|
|
|
107
|
-
|
|
171
|
+
Claude Code data:
|
|
172
|
+
|
|
173
|
+
```text
|
|
174
|
+
~/.claude/projects
|
|
175
|
+
~/.config/claude/projects
|
|
176
|
+
~/Library/Application Support/Claude/local-agent-mode-sessions
|
|
177
|
+
~/.config/Claude/local-agent-mode-sessions
|
|
178
|
+
```
|
|
108
179
|
|
|
109
|
-
RepoSpend
|
|
180
|
+
RepoSpend also checks `~/.claude/history.jsonl` for source status, but does not
|
|
181
|
+
import history-only entries into usage analytics because they do not contain
|
|
182
|
+
reliable token/model data.
|
|
183
|
+
|
|
184
|
+
Claude Code transcript files can contain prompt text, tool output, and file
|
|
185
|
+
contents. RepoSpend keeps all scanning local.
|
|
186
|
+
|
|
187
|
+
RepoSpend-owned settings:
|
|
110
188
|
|
|
111
189
|
```text
|
|
112
190
|
~/.repospend/pricing.json
|
|
@@ -114,31 +192,54 @@ RepoSpend stores its own settings here:
|
|
|
114
192
|
```
|
|
115
193
|
|
|
116
194
|
The Settings page includes a reset action for RepoSpend-owned files under
|
|
117
|
-
`~/.repospend/`. It does not delete or edit anything under `~/.codex
|
|
195
|
+
`~/.repospend/`. It does not delete or edit anything under `~/.codex` or
|
|
196
|
+
`~/.claude`.
|
|
118
197
|
|
|
119
|
-
##
|
|
198
|
+
## Commands
|
|
120
199
|
|
|
121
|
-
|
|
200
|
+
Most users only need:
|
|
122
201
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
202
|
+
```bash
|
|
203
|
+
repospend
|
|
204
|
+
```
|
|
126
205
|
|
|
127
|
-
|
|
128
|
-
usage, account-level terms, provider changes, or other billing details. If you use
|
|
129
|
-
Codex through a subscription, read the number as "what this token usage would
|
|
130
|
-
roughly cost at API-style rates."
|
|
206
|
+
There are also a few terminal-friendly commands:
|
|
131
207
|
|
|
132
|
-
|
|
208
|
+
```bash
|
|
209
|
+
repospend scan
|
|
210
|
+
repospend by-repo
|
|
211
|
+
repospend by-day
|
|
212
|
+
repospend by-hour
|
|
213
|
+
repospend by-model
|
|
214
|
+
repospend by-app
|
|
215
|
+
repospend export --format json
|
|
216
|
+
repospend export --format csv
|
|
217
|
+
```
|
|
133
218
|
|
|
134
|
-
|
|
219
|
+
Most commands also accept a simple source filter:
|
|
135
220
|
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
221
|
+
```bash
|
|
222
|
+
repospend by-repo --source codex
|
|
223
|
+
repospend by-repo --source claude
|
|
224
|
+
repospend by-repo --source all
|
|
225
|
+
```
|
|
140
226
|
|
|
141
|
-
|
|
227
|
+
Use `REPOSPEND_NO_OPEN=1 repospend` if you want the URL printed without opening a
|
|
228
|
+
browser.
|
|
229
|
+
|
|
230
|
+
## Current Limits
|
|
231
|
+
|
|
232
|
+
- Codex support is still the most complete path for token and command-friction
|
|
233
|
+
analysis.
|
|
234
|
+
- Claude Code support is initial: sessions, projects, timestamps, models, and
|
|
235
|
+
token usage are shown when present in local JSONL files.
|
|
236
|
+
- Claude Code sessions without local token details are shown with unknown
|
|
237
|
+
tokens/cost.
|
|
238
|
+
- Cost estimates do not represent subscription billing, credits, regional
|
|
239
|
+
pricing, or account-specific terms.
|
|
240
|
+
- Budget alerts are not active yet.
|
|
241
|
+
- Some older sessions may not include full token, command, or prompt details.
|
|
242
|
+
- RTK analytics appear only when local `rtk` data is available.
|
|
142
243
|
|
|
143
244
|
## Develop
|
|
144
245
|
|
|
@@ -162,35 +263,17 @@ pnpm build
|
|
|
162
263
|
[http://127.0.0.1:4318](http://127.0.0.1:4318) and the dashboard on
|
|
163
264
|
[http://127.0.0.1:2005](http://127.0.0.1:2005), with `/api` proxied locally.
|
|
164
265
|
|
|
165
|
-
##
|
|
266
|
+
## Maintainers
|
|
166
267
|
|
|
167
|
-
|
|
268
|
+
Publishing notes are in [docs/PUBLISHING.md](docs/PUBLISHING.md).
|
|
168
269
|
|
|
169
|
-
|
|
170
|
-
npx repospend
|
|
171
|
-
```
|
|
270
|
+
## Security
|
|
172
271
|
|
|
173
|
-
|
|
174
|
-
tag:
|
|
272
|
+
Please see [SECURITY.md](SECURITY.md) for reporting security issues.
|
|
175
273
|
|
|
176
|
-
|
|
177
|
-
pnpm version patch
|
|
178
|
-
git push --follow-tags
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
The npm package `repospend` must have npm Trusted Publishing configured for the
|
|
182
|
-
GitHub repository `mehmetdemircs/RepoSpend` and workflow file
|
|
183
|
-
`.github/workflows/publish.yml` (workflow filename `publish.yml` in npm
|
|
184
|
-
settings). No `NPM_TOKEN` is required for that workflow.
|
|
185
|
-
|
|
186
|
-
## Current Limits
|
|
274
|
+
## Changelog
|
|
187
275
|
|
|
188
|
-
|
|
189
|
-
- Cost is estimated, not billed.
|
|
190
|
-
- Budget alerts are not active yet.
|
|
191
|
-
- Some older sessions may not include full token, command, or prompt details.
|
|
192
|
-
- Unknown models show token totals with unknown cost instead of guessing.
|
|
193
|
-
- RTK analytics appear only when local `rtk` data is available.
|
|
276
|
+
Please see [CHANGELOG.md](CHANGELOG.md) for release notes.
|
|
194
277
|
|
|
195
278
|
## License
|
|
196
279
|
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
RepoSpend is an early-stage, local-first developer tool. It is designed to help you inspect AI coding usage data on your own machine, not to collect or upload that data.
|
|
4
|
+
|
|
5
|
+
## Supported Versions
|
|
6
|
+
|
|
7
|
+
While RepoSpend is early-stage, only the latest published npm version is actively supported for security fixes.
|
|
8
|
+
|
|
9
|
+
Please upgrade to the latest version before reporting a vulnerability when possible.
|
|
10
|
+
|
|
11
|
+
## Reporting a Vulnerability
|
|
12
|
+
|
|
13
|
+
Please do not open a public GitHub issue for suspected vulnerabilities.
|
|
14
|
+
|
|
15
|
+
Please contact the maintainer privately via GitHub. If the repository later lists a dedicated private security reporting method or maintainer contact, use that instead.
|
|
16
|
+
|
|
17
|
+
When reporting, include:
|
|
18
|
+
|
|
19
|
+
- the RepoSpend version
|
|
20
|
+
- your operating system and Node.js version
|
|
21
|
+
- a clear description of the issue
|
|
22
|
+
- minimal steps to reproduce it
|
|
23
|
+
- whether the issue involves local files, logs, prompts, or usage data
|
|
24
|
+
|
|
25
|
+
## Security Expectations
|
|
26
|
+
|
|
27
|
+
RepoSpend should:
|
|
28
|
+
|
|
29
|
+
- run locally by default
|
|
30
|
+
- read supported AI coding tool data without modifying it
|
|
31
|
+
- avoid uploading prompts, logs, local files, telemetry, or local usage data by default
|
|
32
|
+
- keep security-sensitive changes small and reviewable
|
|
33
|
+
|
|
34
|
+
RepoSpend is not guaranteed to be free of vulnerabilities. Please use care when running any local tool that reads files from your machine.
|
|
35
|
+
|
|
36
|
+
## Local-First Data Handling
|
|
37
|
+
|
|
38
|
+
RepoSpend inspects local usage data, including Codex-related local files and logs when available. Some source files may contain prompt text, tool output, file paths, repository names, or other sensitive details.
|
|
39
|
+
|
|
40
|
+
Before sharing logs, screenshots, exports, or reproduction steps, remove private data such as prompts, file contents, access tokens, usernames, repo names, customer names, and local paths you do not want to disclose.
|
|
41
|
+
|
|
42
|
+
## What Not to Include in Public Issues
|
|
43
|
+
|
|
44
|
+
Please do not include the following in public GitHub issues:
|
|
45
|
+
|
|
46
|
+
- prompts or conversation logs
|
|
47
|
+
- access tokens, API keys, or secrets
|
|
48
|
+
- private repository names or file paths
|
|
49
|
+
- customer, employer, or personal data
|
|
50
|
+
- raw local usage files that may contain sensitive content
|
|
51
|
+
- details for an unpatched security issue
|
|
52
|
+
|
|
53
|
+
Use a private maintainer contact for anything security-sensitive.
|
|
54
|
+
|
|
55
|
+
## Maintainer Response Expectations
|
|
56
|
+
|
|
57
|
+
Maintainers will try to acknowledge valid vulnerability reports promptly, but response times may vary because RepoSpend is a small open-source project.
|
|
58
|
+
|
|
59
|
+
The expected process is:
|
|
60
|
+
|
|
61
|
+
- review the report privately
|
|
62
|
+
- ask follow-up questions if needed
|
|
63
|
+
- prepare a fix when the issue is reproducible and in scope
|
|
64
|
+
- publish a release or mitigation notes when appropriate
|
|
65
|
+
- credit reporters when requested and safe to do so
|