repospend 0.0.1 → 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 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
@@ -1,37 +1,21 @@
1
1
  # RepoSpend
2
2
 
3
- RepoSpend is a local dashboard for seeing where your AI coding usage is going.
3
+ [![npm version](https://img.shields.io/npm/v/repospend)](https://www.npmjs.com/package/repospend)
4
+ [![npm downloads](https://img.shields.io/npm/dm/repospend)](https://www.npmjs.com/package/repospend)
5
+ [![license](https://img.shields.io/npm/l/repospend)](./LICENSE)
6
+ [![node](https://img.shields.io/node/v/repospend)](https://www.npmjs.com/package/repospend)
7
+ [![CI](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml/badge.svg)](https://github.com/mehmetdemircs/RepoSpend/actions/workflows/ci.yml)
4
8
 
5
- It reads your local Codex data, groups work by Git repository, and shows the repos,
6
- sessions, models, commands, and days that are driving token usage and
7
- API-equivalent cost.
9
+ RepoSpend is a local-first dashboard for seeing which repositories are using the
10
+ most AI coding tokens.
8
11
 
9
- `0.0.1` is an early Codex-first release.
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.
10
15
 
11
- ## Why RepoSpend?
16
+ No login. No telemetry. No prompt uploads.
12
17
 
13
- AI coding usage usually gets shown by date, model, or raw session. RepoSpend starts
14
- with the thing most developers actually care about: the repo.
15
-
16
- If Codex records work from both of these paths:
17
-
18
- ```text
19
- /Users/elrond/dev/RivendellRecords
20
- /Users/elrond/dev/RivendellRecords/apps/web
21
- ```
22
-
23
- RepoSpend walks up to the Git root and shows them together as one
24
- `RivendellRecords` project.
25
-
26
- That makes it easier to answer questions like:
27
-
28
- - Which repo is using the most tokens?
29
- - Which sessions were unusually expensive?
30
- - How much came from cached input, output, or reasoning tokens?
31
- - Are command failures or repeated tool issues adding friction?
32
- - Which models and days are driving the total?
33
-
34
- ## Run It
18
+ ## Quick Start
35
19
 
36
20
  You can run RepoSpend without installing it globally:
37
21
 
@@ -39,6 +23,8 @@ You can run RepoSpend without installing it globally:
39
23
  npx repospend
40
24
  ```
41
25
 
26
+ Then open the local dashboard URL printed in your terminal.
27
+
42
28
  Or install it once:
43
29
 
44
30
  ```bash
@@ -53,42 +39,152 @@ prints the dashboard URL. By default it runs at
53
39
  RepoSpend requires Node.js `20` or newer. It uses `better-sqlite3`, so npm may
54
40
  install a native SQLite package for your platform.
55
41
 
56
- ## Commands
42
+ ## Good For
57
43
 
58
- Most of the time you only need:
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
59
49
 
60
- ```bash
61
- repospend
62
- ```
50
+ ## Screenshots
63
51
 
64
- There are also a few terminal-friendly commands:
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.
65
55
 
66
- ```bash
67
- repospend scan
68
- repospend by-repo
69
- repospend by-day
70
- repospend by-hour
71
- repospend by-model
72
- repospend by-app
73
- repospend export --format json
74
- repospend export --format csv
56
+ ### Overview
57
+
58
+ ![RepoSpend overview dashboard with fictional Middle-earth usage data](docs/screenshots/dashboard-overview.png)
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
+ ![RepoSpend repositories table with fictional repo usage](docs/screenshots/repos-view.png)
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
+ ![RepoSpend repository detail for one-ring-infra](docs/screenshots/repo-detail.png)
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
+ ![RepoSpend sessions table with fictional session titles](docs/screenshots/sessions-view.png)
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
+ ![RepoSpend session detail for a fictional palantir event stream fix](docs/screenshots/session-detail.png)
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
+ ![RepoSpend agent friction screen with fictional command issue signals](docs/screenshots/agent-friction.png)
94
+
95
+ Agent Friction separates blocking command failures from harmless shell exits so
96
+ high-token troubleshooting is easier to review.
97
+
98
+ ## What It Shows
99
+
100
+ RepoSpend helps you break down local AI coding usage by:
101
+
102
+ - repo
103
+ - session
104
+ - day and hour
105
+ - model
106
+ - source/tool and app/surface, where detectable
107
+ - token type
108
+ - estimated API-equivalent cost
109
+
110
+ If Codex records work from both of these paths:
111
+
112
+ ```text
113
+ /Users/elrond/dev/RivendellRecords
114
+ /Users/elrond/dev/RivendellRecords/apps/web
75
115
  ```
76
116
 
77
- Use `REPOSPEND_NO_OPEN=1 repospend` if you want the URL printed without opening a
78
- browser.
117
+ RepoSpend walks up to the Git root and shows them together as one
118
+ `RivendellRecords` project.
119
+
120
+ ## Supported Tools
121
+
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.
79
158
 
80
159
  ## What It Reads
81
160
 
82
- RepoSpend reads Codex data from:
161
+ RepoSpend only reads local files. It does not edit Codex, Claude Code, or RTK
162
+ data.
163
+
164
+ Codex data:
83
165
 
84
166
  ```text
85
167
  ~/.codex/state_5.sqlite
86
168
  ~/.codex/sessions
87
169
  ```
88
170
 
89
- Those files are opened read-only. RepoSpend does not modify Codex data.
171
+ Claude Code data:
90
172
 
91
- RepoSpend stores its own settings here:
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
+ ```
179
+
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:
92
188
 
93
189
  ```text
94
190
  ~/.repospend/pricing.json
@@ -96,31 +192,54 @@ RepoSpend stores its own settings here:
96
192
  ```
97
193
 
98
194
  The Settings page includes a reset action for RepoSpend-owned files under
99
- `~/.repospend/`. It does not delete or edit anything under `~/.codex`.
195
+ `~/.repospend/`. It does not delete or edit anything under `~/.codex` or
196
+ `~/.claude`.
100
197
 
101
- ## About Cost
198
+ ## Commands
102
199
 
103
- RepoSpend shows **API-equivalent cost**.
200
+ Most users only need:
104
201
 
105
- That means it estimates cost from local token counts and the pricing assumptions
106
- stored in RepoSpend. It is useful for comparing repos and sessions, but it is not
107
- an invoice.
202
+ ```bash
203
+ repospend
204
+ ```
108
205
 
109
- Your actual cost may be different because of subscriptions, credits, included
110
- usage, account-level terms, provider changes, or other billing details. If you use
111
- Codex through a subscription, read the number as "what this token usage would
112
- roughly cost at API-style rates."
206
+ There are also a few terminal-friendly commands:
113
207
 
114
- ## Privacy
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
+ ```
115
218
 
116
- RepoSpend is local-first:
219
+ Most commands also accept a simple source filter:
117
220
 
118
- - no login
119
- - no telemetry
120
- - no prompt uploads
121
- - no changes to Codex files
221
+ ```bash
222
+ repospend by-repo --source codex
223
+ repospend by-repo --source claude
224
+ repospend by-repo --source all
225
+ ```
122
226
 
123
- Everything the dashboard shows comes from files already on your machine.
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.
124
243
 
125
244
  ## Develop
126
245
 
@@ -144,14 +263,17 @@ pnpm build
144
263
  [http://127.0.0.1:4318](http://127.0.0.1:4318) and the dashboard on
145
264
  [http://127.0.0.1:2005](http://127.0.0.1:2005), with `/api` proxied locally.
146
265
 
147
- ## Current Limits
266
+ ## Maintainers
148
267
 
149
- - Codex is the first supported data source.
150
- - Cost is estimated, not billed.
151
- - Budget alerts are not active yet.
152
- - Some older sessions may not include full token, command, or prompt details.
153
- - Unknown models show token totals with unknown cost instead of guessing.
154
- - RTK analytics appear only when local `rtk` data is available.
268
+ Publishing notes are in [docs/PUBLISHING.md](docs/PUBLISHING.md).
269
+
270
+ ## Security
271
+
272
+ Please see [SECURITY.md](SECURITY.md) for reporting security issues.
273
+
274
+ ## Changelog
275
+
276
+ Please see [CHANGELOG.md](CHANGELOG.md) for release notes.
155
277
 
156
278
  ## License
157
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