@ipv9/tokentracker-cli 0.39.40 → 0.39.42
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/README.md +83 -37
- package/dashboard/dist/assets/{Card-JS4gjUZf.js → Card-B8Y_I2mQ.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-BDJHJCf-.js +60 -0
- package/dashboard/dist/assets/{FadeIn-DvLfvwys.js → FadeIn-ChNG3KP0.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-Dcfc0Uts.js → IpCheckPage-Ca1uwFdQ.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-Vz-GVdi9.js → LimitsPage-CyDE5D02.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-8xF5couh.js → LocalOnlyNotice-yBRg7mqR.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-7HrUzeRx.js → PopoverPopup-BGzAyIYN.js} +1 -1
- package/dashboard/dist/assets/{Select-9XDsaO_C.js → Select-DEntlQun.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-DE5Fs9p6.js → SelectItemText-Bn_0YJTr.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-CMnfAptE.js → SettingsPage-CGmzeeBt.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-CbvLHN0L.js → SkillsPage-vY8xnrco.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-CeGQlyt7.js → WidgetsPage-BM16UPSy.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-Bux8qLUC.js → WrappedPage-dK7Mh5mP.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-B7rCoZdW.js → arrow-up-right-UZisIdFP.js} +1 -1
- package/dashboard/dist/assets/{download-CtTYpbcx.js → download-C-J68Mev.js} +1 -1
- package/dashboard/dist/assets/{format-BuQKK6kQ.js → format-DIhJkiH4.js} +1 -1
- package/dashboard/dist/assets/limitDisplay-HQrH6Bc9.js +1 -0
- package/dashboard/dist/assets/{main-Ck4SUH4m.js → main-B7TdYIfs.js} +3 -3
- package/dashboard/dist/assets/mock-data-DjoQefEM.js +1 -0
- package/dashboard/dist/assets/{use-limits-display-prefs-BKWYPgeA.js → use-limits-display-prefs-g_zmpVGY.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-D7Nj1dXR.js → use-native-settings-DrNnC_U7.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-BX3pvyhh.js → useCurrency-xmDhKr0q.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/package.json +3 -2
- package/src/commands/serve.js +121 -38
- package/src/lib/fs.js +149 -25
- package/src/lib/local-api.js +20 -2
- package/src/lib/pricing/curated-overrides.json +10 -3
- package/src/lib/pricing/index.js +219 -18
- package/src/lib/pricing/litellm-fetcher.js +6 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/dashboard/dist/assets/DashboardPage-BoXhzJb1.js +0 -60
- package/dashboard/dist/assets/limitDisplay-WwuTdS_a.js +0 -1
- package/dashboard/dist/assets/mock-data-Bvbe8tYK.js +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### Know exactly what you're spending on AI — across every CLI
|
|
6
6
|
|
|
7
|
-
Auto-collect token usage from **
|
|
7
|
+
Auto-collect token usage from **20+ AI coding tools**, aggregate it locally, and read real cost trends in one dashboard. No account or API key required to start — just one command.
|
|
8
8
|
|
|
9
9
|
[](https://www.npmjs.com/package/@ipv9/tokentracker-cli)
|
|
10
10
|
[](https://www.npmjs.com/package/@ipv9/tokentracker-cli)
|
|
@@ -24,6 +24,19 @@ Auto-collect token usage from **22 AI coding tools**, aggregate it locally, and
|
|
|
24
24
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
|
+
## 🤔 Why not just read each provider's billing page?
|
|
28
|
+
|
|
29
|
+
You can — that is the honest alternative, and for a single tool it is enough. TokenTracker earns its place once you use more than one:
|
|
30
|
+
|
|
31
|
+
- **One number instead of six tabs.** Claude, Codex, Cursor, Gemini and Copilot each bill in their own dashboard, on their own reset schedule, in their own units. Nobody adds them up for you.
|
|
32
|
+
- **Subscriptions hide the number entirely.** A flat monthly plan shows you a quota bar, not what your usage would have cost. TokenTracker prices every token against public model rates, so you can see whether the plan is a bargain or a subsidy you have outgrown.
|
|
33
|
+
- **Per-project and per-model, not just per-account.** Billing pages answer "what do I owe this month". This answers "which repo, which model, and which hour" — the resolution you need to actually change something.
|
|
34
|
+
- **Quota chips before you hit the wall.** Live plan-limit usage sits on each provider's card, so a 5-hour window running out is something you see rather than something you discover.
|
|
35
|
+
|
|
36
|
+
If you only use one tool and never care about per-project cost, the provider's own page is genuinely fine. This is for the rest.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
27
40
|
## ⚡ Quick Start
|
|
28
41
|
|
|
29
42
|
> **Requires** Node.js **20+**.
|
|
@@ -48,21 +61,34 @@ tokentracker doctor # health check
|
|
|
48
61
|
|
|
49
62
|
---
|
|
50
63
|
|
|
64
|
+
## 💻 Prefer an app? There's a desktop build
|
|
65
|
+
|
|
66
|
+
If you'd rather not keep a terminal open, both native apps are on the [Releases page](https://github.com/pitimon/TokenTracker/releases/latest):
|
|
67
|
+
|
|
68
|
+
| Platform | Download | What it adds |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| **macOS 12+** | `TokenTrackerBar.dmg` | A menu-bar app — live token count in the menu bar, launch at login, sync and update from a click, plus a desktop widget. |
|
|
71
|
+
| **Windows** | `TokenTracker-Setup.exe` | The same dashboard as a standalone app. |
|
|
72
|
+
|
|
73
|
+
<img src="https://raw.githubusercontent.com/pitimon/TokenTracker/main/docs/screenshots/menubar.gif" alt="TokenTracker in the macOS menu bar" width="420" />
|
|
74
|
+
|
|
75
|
+
Both bundle their own Node runtime, so there is nothing else to install. They share the same local data as the CLI — run either, or both. The desktop builds are cut less often than the npm package, so the latest release tag usually trails the npm version badge above.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
51
79
|
## ✨ What you get
|
|
52
80
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- 💰 **
|
|
57
|
-
-
|
|
81
|
+
- 🔒 **Your usage data never leaves your machine.** Token counts and timestamps only — never prompts, responses, or file contents. No account, no telemetry, no analytics, no phone-home. TokenTracker does make a few outbound calls *on your behalf* (model prices, your own plan quotas); every one is named in [Privacy](#-privacy) below, and none of them carry your usage.
|
|
82
|
+
- 📊 **One calm web dashboard.** Your whole picture in the browser at a local URL, no login — light or dark, auto-refreshing while the tab is open. [What's on it ↓](#-the-dashboard)
|
|
83
|
+
- 📈 **Quota at a glance, on every card.** Live plan-quota usage (used %, e.g. 5h + weekly) as color-coded chips right on each provider's card — see how close you are to your limits without leaving the overview. Full windows + reset countdowns on the Limits page. Covers Claude, Codex, Cursor, Gemini, Kimi, Z.AI, Kiro, Copilot, and Antigravity.
|
|
84
|
+
- 💰 **Cost you can trust — and a price tag when it can't.** 2,200+ models priced from [LiteLLM](https://github.com/BerriAI/litellm) (refreshed daily) with a bundled offline snapshot, so USD totals are right even without a network. A model too new to have a price is badged **pricing missing** rather than quietly counted as $0, and prices refresh in the background instead of waiting for a restart. Cross-provider records are de-duplicated to match each provider's own billing.
|
|
85
|
+
- 🔌 **20+ tools, zero config.** Claude Code, Codex, Cursor, Gemini, Copilot, Antigravity, OpenCode, Kiro, Zed, Goose, and more — auto-detected, hooks auto-install on first run. Zero to dashboard in ~30 seconds.
|
|
58
86
|
- 🧩 **Skills tab.** Syncs 250+ public skills across your tools.
|
|
59
87
|
|
|
60
88
|
---
|
|
61
89
|
|
|
62
90
|
## 📊 The dashboard
|
|
63
91
|
|
|
64
|
-
A calm, single-screen readout — a hero total paired with a usage-trend chart, a provider breakdown stacked above a per-provider context breakdown, and a GitHub-style activity heatmap.
|
|
65
|
-
|
|
66
92
|
| Dark | Light |
|
|
67
93
|
|---|---|
|
|
68
94
|
| <img src="https://raw.githubusercontent.com/pitimon/TokenTracker/main/docs/screenshots/dashboard-dark.png" alt="Dashboard — dark" /> | <img src="https://raw.githubusercontent.com/pitimon/TokenTracker/main/docs/screenshots/dashboard-light.png" alt="Dashboard — light" /> |
|
|
@@ -83,7 +109,7 @@ Auto-refresh runs only while the tab is visible (`Off` / `30s` / `60s` / `120s`,
|
|
|
83
109
|
|
|
84
110
|
Auto-detected on first run — no manual plugin or hook wiring:
|
|
85
111
|
|
|
86
|
-
> **Claude Code · Codex CLI · Cursor · Gemini CLI · GitHub Copilot · Antigravity · Kiro · OpenCode · OpenClaw · Every Code · Hermes · Kimi Code · CodeBuddy · Grok Build · oh-my-pi · pi · Craft Agents · Kilo CLI · Kilo Code · Roo Code · Zed Agent · Goose**
|
|
112
|
+
> **Claude Code · Codex CLI · Cursor · Gemini CLI · GitHub Copilot · Antigravity · Kiro · OpenCode · OpenClaw · Every Code · Hermes · Kimi Code · CodeBuddy · Grok Build · Droid · oh-my-pi · pi · Craft Agents · Kilo CLI · Kilo Code · Roo Code · Zed Agent · Goose**
|
|
87
113
|
|
|
88
114
|
Each tool is connected one of three ways, all automatic: a **SessionEnd/notify hook** (Claude Code, Codex, Gemini, Every Code, CodeBuddy, Grok Build), a **bundled plugin** linked via the tool's own CLI (OpenCode, OpenClaw), or a **passive reader** that only reads files the tool already writes — SQLite, JSONL, OTEL exports (Cursor, Kiro, Copilot, Zed, Goose, and the rest).
|
|
89
115
|
|
|
@@ -93,30 +119,41 @@ Rate-limit providers are auto-detected where possible. For Z.AI / GLM Coding Pla
|
|
|
93
119
|
|
|
94
120
|
---
|
|
95
121
|
|
|
96
|
-
##
|
|
122
|
+
## 🧩 How it works
|
|
97
123
|
|
|
98
124
|
```
|
|
99
|
-
AI CLI tools → hooks / passive readers → local
|
|
100
|
-
(logs) (token counts only)
|
|
125
|
+
AI CLI tools → hooks / passive readers → local queue file → dashboard
|
|
126
|
+
(logs) (token counts only) (30-min buckets) (your browser)
|
|
101
127
|
```
|
|
102
128
|
|
|
103
129
|
1. Your AI tools write logs during normal use.
|
|
104
|
-
2. Lightweight hooks (or passive file readers) pick up token counts locally — never prompt or response content.
|
|
105
|
-
3. Counts are aggregated into 30-minute UTC buckets
|
|
106
|
-
4. The dashboard reads that
|
|
130
|
+
2. Lightweight hooks (or passive file readers) pick up token counts locally — never prompt or response content. Some tools keep their logs in SQLite (Cursor, Kiro, Zed and friends); TokenTracker only ever *reads* those.
|
|
131
|
+
3. Counts are aggregated into 30-minute UTC buckets and appended to one plain-text file: `~/.tokentracker/tracker/queue.jsonl`.
|
|
132
|
+
4. The dashboard reads that file and renders it in your browser's timezone.
|
|
107
133
|
|
|
108
|
-
|
|
134
|
+
No account, no upload of your usage, and no server to sign in to.
|
|
109
135
|
|
|
110
136
|
---
|
|
111
137
|
|
|
112
|
-
##
|
|
138
|
+
## 🔐 Privacy
|
|
113
139
|
|
|
114
140
|
| Protection | What it means |
|
|
115
141
|
|---|---|
|
|
116
142
|
| **No content** | Only token counts and timestamps. Never prompts, responses, or files. |
|
|
117
|
-
| **
|
|
118
|
-
| **Auditable** |
|
|
119
|
-
| **No telemetry** | No analytics, no crash reporting, no phone-home. |
|
|
143
|
+
| **Your usage stays local** | Every count TokenTracker collects is written to one file on your disk and read back by a server on your own machine. There is no endpoint it uploads usage to. |
|
|
144
|
+
| **Auditable in one command** | You don't have to take our word for it — the store is an append-only text file you can open yourself: `cat ~/.tokentracker/tracker/queue.jsonl`. It's numbers and timestamps. |
|
|
145
|
+
| **No telemetry** | No analytics, no crash reporting, no phone-home, no account. |
|
|
146
|
+
|
|
147
|
+
**Outbound calls, on your behalf only.** TokenTracker is local-first, not network-free. It talks to the internet in exactly these cases, and none of them carry your usage data:
|
|
148
|
+
|
|
149
|
+
| When | Where | Why |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| Pricing refresh (daily) | `raw.githubusercontent.com` | Downloads the public [LiteLLM](https://github.com/BerriAI/litellm) price list. Anonymous — no credentials, nothing sent. Works offline from a bundled snapshot. |
|
|
152
|
+
| Quota chips + Limits page | `api.anthropic.com`, `chatgpt.com`, `cursor.com`, `cloudcode-pa.googleapis.com`, `api.kimi.com`, `api.z.ai`, `api.github.com` | Asks *your* provider about *your* plan limits, using credentials already on your machine. Only for providers you actually use. |
|
|
153
|
+
| Token refresh | `auth.openai.com`, `oauth2.googleapis.com`, `auth.kimi.com` | Renews those same provider credentials when they expire. |
|
|
154
|
+
| Profile avatars | Allowlisted avatar CDNs | Fetched server-side so your browser doesn't contact them directly. |
|
|
155
|
+
| IP check page | `ip.net.coffee` | Only if you open that page. |
|
|
156
|
+
| `npx` startup | npm registry | How `npx` works — it downloads the package. A global install avoids it. |
|
|
120
157
|
|
|
121
158
|
---
|
|
122
159
|
|
|
@@ -147,29 +184,30 @@ Browser auto-open is opt-in: `tokentracker serve --open`. Background services an
|
|
|
147
184
|
|
|
148
185
|
---
|
|
149
186
|
|
|
150
|
-
##
|
|
187
|
+
## ⏰ Always-on, without a terminal (macOS)
|
|
188
|
+
|
|
189
|
+
If you want the dashboard up all the time but don't want the desktop app, the repo ships a launchd installer. It registers two LaunchAgents — the dashboard on port `7680`, and a periodic background sync — both pinned to a specific published version:
|
|
151
190
|
|
|
152
191
|
```bash
|
|
153
192
|
git clone https://github.com/pitimon/TokenTracker.git
|
|
154
193
|
cd TokenTracker
|
|
155
|
-
|
|
194
|
+
./scripts/install-local-service.sh # remove later with ./scripts/uninstall-local-service.sh
|
|
195
|
+
```
|
|
156
196
|
|
|
157
|
-
|
|
158
|
-
npm run dashboard:build
|
|
159
|
-
node bin/tracker.js
|
|
197
|
+
macOS only; it uses `launchd` directly. On Linux, the same effect is a small systemd user unit running `tokentracker serve --sync --no-open`.
|
|
160
198
|
|
|
161
|
-
|
|
162
|
-
npm run ci:local # full local gate (build + tests + validators)
|
|
163
|
-
```
|
|
199
|
+
---
|
|
164
200
|
|
|
165
|
-
##
|
|
201
|
+
## 🧰 Development
|
|
166
202
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
203
|
+
```bash
|
|
204
|
+
git clone https://github.com/pitimon/TokenTracker.git
|
|
205
|
+
cd TokenTracker && npm install
|
|
206
|
+
npm run dashboard:build && node bin/tracker.js
|
|
207
|
+
npm run ci:local # the full gate: build + tests + validators
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Setup details, the test layout, and how to add a new tool integration are in [CONTRIBUTING.md](CONTRIBUTING.md). Source-backed engineering documentation starts at [`openwiki/README.md`](openwiki/README.md).
|
|
173
211
|
|
|
174
212
|
---
|
|
175
213
|
|
|
@@ -185,7 +223,7 @@ tokentracker status # see each integration's state
|
|
|
185
223
|
tokentracker doctor # deeper health check
|
|
186
224
|
```
|
|
187
225
|
|
|
188
|
-
If a tool you use shows as not configured, run `tokentracker
|
|
226
|
+
If a tool you use shows as not configured, run `tokentracker init` — it re-runs detection and installs anything missing. Still missing? [Open an issue](https://github.com/pitimon/TokenTracker/issues/new) with the `doctor` output.
|
|
189
227
|
|
|
190
228
|
</details>
|
|
191
229
|
|
|
@@ -194,7 +232,7 @@ If a tool you use shows as not configured, run `tokentracker activate-if-needed`
|
|
|
194
232
|
|
|
195
233
|
<br/>
|
|
196
234
|
|
|
197
|
-
The server auto-picks the next free port (`7681`, `7682`, …) and logs it on startup. To force one, use the Bash or PowerShell command in [Configuration](
|
|
235
|
+
The server auto-picks the next free port (`7681`, `7682`, …) and logs it on startup. To force one, use the Bash or PowerShell command in [Configuration](#-configuration). To see what's holding port `7680`:
|
|
198
236
|
|
|
199
237
|
```bash
|
|
200
238
|
lsof -i :7680
|
|
@@ -261,6 +299,14 @@ tokentracker uninstall
|
|
|
261
299
|
|
|
262
300
|
Removes every hook TokenTracker installed across all detected tools, plus local config and data. Safe to re-run.
|
|
263
301
|
|
|
302
|
+
One thing it does **not** touch: if you set up the always-on macOS service yourself with `scripts/install-local-service.sh`, that LaunchAgent is installed outside the CLI and keeps restarting the dashboard. Remove it first:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
./scripts/uninstall-local-service.sh
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
(The CLI never installs a LaunchAgent, so if you have only ever run `npx`/`tokentracker`, there is nothing extra to clean up.)
|
|
309
|
+
|
|
264
310
|
</details>
|
|
265
311
|
|
|
266
312
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./main-
|
|
1
|
+
import{j as r}from"./main-B7TdYIfs.js";function t({children:i,title:a,subtitle:o,className:s="",bodyClassName:d=""}){return r.jsxs("div",{className:`rounded-xl border border-oai-gray-200 dark:border-oai-gray-800 bg-white dark:bg-oai-gray-900 transition-colors duration-200 ${s}`,children:[(a||o)&&r.jsxs("div",{className:"px-5 py-4 border-b border-oai-gray-200 dark:border-oai-gray-800 transition-colors duration-200",children:[a&&r.jsx("h3",{className:"text-sm font-medium text-oai-gray-500 dark:text-oai-gray-300 uppercase tracking-wide transition-colors duration-200",children:a}),o&&r.jsx("p",{className:"text-sm text-oai-gray-500 dark:text-oai-gray-300 mt-1 transition-colors duration-200",children:o})]}),r.jsx("div",{className:`p-5 ${d}`,children:i})]})}export{t as C};
|