repospend 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ Copyright 2026 RepoSpend contributors
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ https://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,158 @@
1
+ # RepoSpend
2
+
3
+ RepoSpend is a local dashboard for seeing where your AI coding usage is going.
4
+
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.
8
+
9
+ `0.0.1` is an early Codex-first release.
10
+
11
+ ## Why RepoSpend?
12
+
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
35
+
36
+ You can run RepoSpend without installing it globally:
37
+
38
+ ```bash
39
+ npx repospend
40
+ ```
41
+
42
+ Or install it once:
43
+
44
+ ```bash
45
+ npm install -g repospend
46
+ repospend
47
+ ```
48
+
49
+ RepoSpend starts a local dashboard, binds to localhost, opens your browser, and
50
+ prints the dashboard URL. By default it runs at
51
+ [http://localhost:2005](http://localhost:2005).
52
+
53
+ RepoSpend requires Node.js `20` or newer. It uses `better-sqlite3`, so npm may
54
+ install a native SQLite package for your platform.
55
+
56
+ ## Commands
57
+
58
+ Most of the time you only need:
59
+
60
+ ```bash
61
+ repospend
62
+ ```
63
+
64
+ There are also a few terminal-friendly commands:
65
+
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
75
+ ```
76
+
77
+ Use `REPOSPEND_NO_OPEN=1 repospend` if you want the URL printed without opening a
78
+ browser.
79
+
80
+ ## What It Reads
81
+
82
+ RepoSpend reads Codex data from:
83
+
84
+ ```text
85
+ ~/.codex/state_5.sqlite
86
+ ~/.codex/sessions
87
+ ```
88
+
89
+ Those files are opened read-only. RepoSpend does not modify Codex data.
90
+
91
+ RepoSpend stores its own settings here:
92
+
93
+ ```text
94
+ ~/.repospend/pricing.json
95
+ ~/.repospend/config.json
96
+ ```
97
+
98
+ The Settings page includes a reset action for RepoSpend-owned files under
99
+ `~/.repospend/`. It does not delete or edit anything under `~/.codex`.
100
+
101
+ ## About Cost
102
+
103
+ RepoSpend shows **API-equivalent cost**.
104
+
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.
108
+
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."
113
+
114
+ ## Privacy
115
+
116
+ RepoSpend is local-first:
117
+
118
+ - no login
119
+ - no telemetry
120
+ - no prompt uploads
121
+ - no changes to Codex files
122
+
123
+ Everything the dashboard shows comes from files already on your machine.
124
+
125
+ ## Develop
126
+
127
+ From source:
128
+
129
+ ```bash
130
+ pnpm install
131
+ pnpm dev
132
+ ```
133
+
134
+ Useful checks before publishing:
135
+
136
+ ```bash
137
+ pnpm lint
138
+ pnpm typecheck
139
+ pnpm test
140
+ pnpm build
141
+ ```
142
+
143
+ `pnpm dev` starts the API on
144
+ [http://127.0.0.1:4318](http://127.0.0.1:4318) and the dashboard on
145
+ [http://127.0.0.1:2005](http://127.0.0.1:2005), with `/api` proxied locally.
146
+
147
+ ## Current Limits
148
+
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.
155
+
156
+ ## License
157
+
158
+ [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)