@ipv9/tokentracker-cli 0.39.41 → 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.
Files changed (27) hide show
  1. package/README.md +82 -36
  2. package/dashboard/dist/assets/{Card-BwY_Qv6N.js → Card-B8Y_I2mQ.js} +1 -1
  3. package/dashboard/dist/assets/{DashboardPage-C7b_GjA-.js → DashboardPage-BDJHJCf-.js} +3 -3
  4. package/dashboard/dist/assets/{FadeIn-DiAafUDN.js → FadeIn-ChNG3KP0.js} +1 -1
  5. package/dashboard/dist/assets/{IpCheckPage-CYgWVZJr.js → IpCheckPage-Ca1uwFdQ.js} +1 -1
  6. package/dashboard/dist/assets/{LimitsPage-C1y75ftN.js → LimitsPage-CyDE5D02.js} +1 -1
  7. package/dashboard/dist/assets/{LocalOnlyNotice-B5_-ydeu.js → LocalOnlyNotice-yBRg7mqR.js} +1 -1
  8. package/dashboard/dist/assets/{PopoverPopup-DDjjQ5CG.js → PopoverPopup-BGzAyIYN.js} +1 -1
  9. package/dashboard/dist/assets/{Select-BPspkl9p.js → Select-DEntlQun.js} +1 -1
  10. package/dashboard/dist/assets/{SelectItemText-CX0dWYB1.js → SelectItemText-Bn_0YJTr.js} +1 -1
  11. package/dashboard/dist/assets/{SettingsPage-9K5ST4D_.js → SettingsPage-CGmzeeBt.js} +1 -1
  12. package/dashboard/dist/assets/{SkillsPage-BpCSS7ls.js → SkillsPage-vY8xnrco.js} +1 -1
  13. package/dashboard/dist/assets/{WidgetsPage-aBisLWrM.js → WidgetsPage-BM16UPSy.js} +1 -1
  14. package/dashboard/dist/assets/{WrappedPage-BgkuBG_j.js → WrappedPage-dK7Mh5mP.js} +1 -1
  15. package/dashboard/dist/assets/{arrow-up-right-DPb2FRSP.js → arrow-up-right-UZisIdFP.js} +1 -1
  16. package/dashboard/dist/assets/{download-CbZ8YL8m.js → download-C-J68Mev.js} +1 -1
  17. package/dashboard/dist/assets/{format-aRaCvnht.js → format-DIhJkiH4.js} +1 -1
  18. package/dashboard/dist/assets/{limitDisplay-1O9-AdgI.js → limitDisplay-HQrH6Bc9.js} +1 -1
  19. package/dashboard/dist/assets/{main-DRcFJLLD.js → main-B7TdYIfs.js} +3 -3
  20. package/dashboard/dist/assets/{mock-data-sZ3-GZV0.js → mock-data-DjoQefEM.js} +1 -1
  21. package/dashboard/dist/assets/{use-limits-display-prefs-2-qYvffB.js → use-limits-display-prefs-g_zmpVGY.js} +1 -1
  22. package/dashboard/dist/assets/{use-native-settings-C1uhDKdL.js → use-native-settings-DrNnC_U7.js} +1 -1
  23. package/dashboard/dist/assets/{useCurrency-BPCF4zUv.js → useCurrency-xmDhKr0q.js} +1 -1
  24. package/dashboard/dist/index.html +1 -1
  25. package/package.json +1 -1
  26. package/src/lib/pricing/index.js +23 -1
  27. package/src/lib/pricing/seed-snapshot.json +1 -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 **22 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.
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
  [![npm version](https://img.shields.io/npm/v/@ipv9/tokentracker-cli.svg?color=blue)](https://www.npmjs.com/package/@ipv9/tokentracker-cli)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/@ipv9/tokentracker-cli.svg?color=brightgreen)](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
- - 🔒 **Private by design.** Runs entirely on your machine token counts and timestamps only, never prompts, responses, or file contents. No account, no required API keys, no telemetry, no phone-home. Nothing ever leaves your laptop.
54
- - 📊 **One calm web dashboard.** Your whole picture in the browser at a local URL (no login): total spend, usage trend, per-provider breakdown, context breakdown, and a GitHub-style activity heatmap — light or dark, auto-refreshing while the tab is open.
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)
55
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.
56
- - 💰 **Cost you can trust.** 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. Cross-provider records are de-duplicated to match each provider's own billing.
57
- - 🔌 **22 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.
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
- ## 🏗️ How it works
122
+ ## 🧩 How it works
97
123
 
98
124
  ```
99
- AI CLI tools → hooks / passive readers → local SQLite → dashboard
100
- (logs) (token counts only) (30-min buckets) (your browser)
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 in a local SQLite snapshot.
106
- 4. The dashboard reads that snapshot and renders it in your browser's timezone.
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
- Nothing leaves your machine. There is no account, no upload, and no server to sign in to.
134
+ No account, no upload of your usage, and no server to sign in to.
109
135
 
110
136
  ---
111
137
 
112
- ## 🛡️ Privacy
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
- | **Local only** | All data stays on your machine. There is no upload path at all. |
118
- | **Auditable** | Open sourceread [`src/lib/rollout.js`](src/lib/rollout.js); it's just numbers and timestamps. |
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
- ## 🛠️ Development
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
- npm install
194
+ ./scripts/install-local-service.sh # remove later with ./scripts/uninstall-local-service.sh
195
+ ```
156
196
 
157
- # build the dashboard, then run the CLI
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
- npm test # root tests
162
- npm run ci:local # full local gate (build + tests + validators)
163
- ```
199
+ ---
164
200
 
165
- ## 📚 Code Documentation
201
+ ## 🧰 Development
166
202
 
167
- Source-backed engineering documentation starts at
168
- [`openwiki/README.md`](openwiki/README.md). Regenerate the local fact
169
- ledger with `npm run docs:openwiki:extract`, validate it with
170
- `npm run docs:openwiki:check`, and use `npm run docs:openwiki:verify` for the
171
- independent read-only review. The model-backed update command expects credentials
172
- from the caller's environment and never reads them from this repository.
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 activate-if-needed` to re-run detection. Still missing? [Open an issue](https://github.com/pitimon/TokenTracker/issues/new) with the `doctor` output.
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](#configuration). To see what's holding port `7680`:
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-DRcFJLLD.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};
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};