@ipv9/tokentracker-cli 0.39.24 → 0.39.26
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 +75 -259
- package/dashboard/dist/assets/{ActivityHeatmap-pkbOn5CW.js → ActivityHeatmap-Bd0iZJ6a.js} +1 -1
- package/dashboard/dist/assets/{Card-Dwm_LQs-.js → Card-haRmR1K7.js} +1 -1
- package/dashboard/dist/assets/DashboardPage-DRc_stxj.js +19 -0
- package/dashboard/dist/assets/{DevicePage-34aJHtG2.js → DevicePage-CJChUEqE.js} +1 -1
- package/dashboard/dist/assets/{DialogTitle-D9yUdjSh.js → DialogTitle-Cz9WUbh9.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-GDS45ZHm.js → FadeIn-q1TGAvwV.js} +1 -1
- package/dashboard/dist/assets/{InsforgeUserHeaderControls-CwcDs37b.js → InsforgeUserHeaderControls-xsCQOt2c.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage--VTxGDrd.js → IpCheckPage-DvQMZaQK.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-BQUN5SnJ.js → LandingPage-DgkyH15h.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardAvatar-DcobB5Fc.js → LeaderboardAvatar-Cm_fpEoO.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardPage-DusbZDys.js → LeaderboardPage-DfnEz-hE.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfileModal-Cw5EkMqw.js → LeaderboardProfileModal-Dj_ezuGq.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfilePage-wMsUhTDi.js → LeaderboardProfilePage-C6hiY6KR.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-Bgbdgg1W.js → LimitsPage-C-8owRKv.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-CUiNMLlY.js → LocalOnlyNotice-Cn-H985J.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-DNNzef-E.js → LoginPage-C_Xok1Rn.js} +1 -1
- package/dashboard/dist/assets/{PopoverPopup-CTzS8tJT.js → PopoverPopup-Cq-OD9f_.js} +1 -1
- package/dashboard/dist/assets/{Select-7UiemI4U.js → Select-BXECV7lt.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-DtW9-hYv.js → SelectItemText-RqWbvFrK.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-CVeb9f5h.js → SettingsPage-BKhusy2H.js} +1 -1
- package/dashboard/dist/assets/{SkillsPage-BGwHtMhl.js → SkillsPage-BO5lQhHC.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-jFrIrKaG.js → WidgetsPage-CARj4bQj.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-BXEtRxYW.js → WrappedPage-CN53dGaG.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-CHqkAPgz.js → arrow-up-right-ChOW2uFm.js} +1 -1
- package/dashboard/dist/assets/{download-Y3R3A8GZ.js → download-BC5NcNbL.js} +1 -1
- package/dashboard/dist/assets/{info-D6K_n5pA.js → info-BbYU4QX-.js} +1 -1
- package/dashboard/dist/assets/{main-hIn9XJ1G.js → main-Bh7uxuzz.js} +2 -2
- package/dashboard/dist/assets/main-VDl0Xv3R.css +1 -0
- package/dashboard/dist/assets/{use-limits-display-prefs-BOuSOHCM.js → use-limits-display-prefs-x3rqSYWB.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-CNmYxOKS.js → use-native-settings-C0_wO6M4.js} +1 -1
- package/dashboard/dist/assets/{use-spring-HcY99iIj.js → use-spring-Dnh34LY6.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-D8r0IYip.js → use-usage-limits-Cn5iTbde.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-CnWficjI.js → useCurrency-CIUHS4dh.js} +1 -1
- package/dashboard/dist/assets/{useOpenInteractionType-Bco2rRXo.js → useOpenInteractionType-_VCFiQZ0.js} +1 -1
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +1 -1
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/README.ja.md +0 -464
- package/README.ko.md +0 -464
- package/README.zh-CN.md +0 -469
- package/dashboard/dist/assets/DashboardPage-CPeI1rol.js +0 -19
- package/dashboard/dist/assets/main-WbVJOozv.css +0 -1
package/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
3
|
# Token Tracker
|
|
4
4
|
|
|
5
|
-
**English** · [简体中文](./README.zh-CN.md) · [日本語](./README.ja.md) · [한국어](./README.ko.md)
|
|
6
|
-
|
|
7
5
|
### Know exactly what you're spending on AI — across every CLI
|
|
8
6
|
|
|
9
|
-
Auto-collect token
|
|
7
|
+
Auto-collect token usage from **22 AI coding tools**, aggregate it locally, and read real cost trends in one dashboard. No account, no API keys, no setup — just one command.
|
|
10
8
|
|
|
11
9
|
[](https://www.npmjs.com/package/@ipv9/tokentracker-cli)
|
|
12
10
|
[](https://www.npmjs.com/package/@ipv9/tokentracker-cli)
|
|
@@ -16,13 +14,11 @@ Auto-collect token counts from **22 AI coding tools**, aggregate them locally, a
|
|
|
16
14
|
|
|
17
15
|
<br/>
|
|
18
16
|
|
|
19
|
-
<
|
|
20
|
-
<img src="https://raw.githubusercontent.com/pitimon/TokenTracker/main/docs/screenshots/dashboard-dark.png" alt="Token Tracker Dashboard" width="820" />
|
|
21
|
-
</video>
|
|
17
|
+
<img src="https://raw.githubusercontent.com/pitimon/TokenTracker/main/docs/screenshots/dashboard-dark.png" alt="Token Tracker dashboard" width="820" />
|
|
22
18
|
|
|
23
19
|
<br/><br/>
|
|
24
20
|
|
|
25
|
-
⭐ **If TokenTracker saves you time, please [star it on GitHub](https://github.com/pitimon/TokenTracker)
|
|
21
|
+
⭐ **If TokenTracker saves you time, please [star it on GitHub](https://github.com/pitimon/TokenTracker).**
|
|
26
22
|
|
|
27
23
|
</div>
|
|
28
24
|
|
|
@@ -30,190 +26,110 @@ Auto-collect token counts from **22 AI coding tools**, aggregate them locally, a
|
|
|
30
26
|
|
|
31
27
|
## ⚡ Quick Start
|
|
32
28
|
|
|
33
|
-
> **
|
|
29
|
+
> **Requires** Node.js **20+**.
|
|
34
30
|
|
|
35
31
|
```bash
|
|
36
32
|
npx --yes @ipv9/tokentracker-cli
|
|
37
33
|
```
|
|
38
34
|
|
|
39
|
-
That's it.
|
|
40
|
-
|
|
41
|
-
**What you get in 30 seconds:**
|
|
42
|
-
- 📊 A local dashboard at `localhost:7680` with usage trends, model breakdown, cost analysis, 24h/day/week/month views, and visible-only auto-refresh
|
|
43
|
-
- 🔌 Auto-detected hooks for every supported AI tool you have installed
|
|
44
|
-
- 🏠 100% local — no account, no API keys, no network calls (except optional leaderboard)
|
|
45
|
-
- 🧩 *Optional:* a Skills tab that browses 250+ public skills and syncs them across Claude · Codex · Grok · Antigravity · Gemini · OpenCode · Hermes
|
|
35
|
+
That's it. The first run installs hooks, syncs your data, and opens the dashboard at `http://localhost:7680`.
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
Prefer a global install for shorter commands:
|
|
48
38
|
|
|
49
39
|
```bash
|
|
50
40
|
npm install -g @ipv9/tokentracker-cli
|
|
51
41
|
|
|
52
|
-
tokentracker
|
|
53
|
-
tokentracker sync
|
|
54
|
-
tokentracker status
|
|
55
|
-
tokentracker
|
|
56
|
-
tokentracker status --light # Plain ASCII table (CI / SSH, no spinner)
|
|
57
|
-
tokentracker doctor # Health check
|
|
42
|
+
tokentracker # open the dashboard
|
|
43
|
+
tokentracker sync # sync now
|
|
44
|
+
tokentracker status # check which tools are connected
|
|
45
|
+
tokentracker doctor # health check
|
|
58
46
|
```
|
|
59
47
|
|
|
60
|
-
## ✨ Features
|
|
61
|
-
|
|
62
|
-
- 🔌 **22 AI tools out of the box** — Claude Code, Codex CLI, Cursor, Gemini CLI, Antigravity, Kiro, OpenCode, OpenClaw, Every Code, Hermes Agent, GitHub Copilot, Kimi Code, CodeBuddy, Grok Build, oh-my-pi, pi, Craft Agents, Kilo CLI, Kilo Code, Roo Code, Zed Agent, Goose
|
|
63
|
-
- 🏠 **100% local** — Token data never leaves your machine. No account, no API keys.
|
|
64
|
-
- 🚀 **Zero config** — Hooks auto-install on first run. From zero to dashboard in 30 seconds.
|
|
65
|
-
- 📊 **Beautiful dashboard** — Usage trends, cost breakdowns by model, GitHub-style activity heatmap, project attribution, 24h detail view, browser-timezone "Updated" timestamp, and configurable visible-only auto-refresh (`Off`, `30s`, `60s`, `120s`; default `30s`)
|
|
66
|
-
- 📈 **Real-time rate limit tracking** — Claude / Codex / Cursor / Gemini / Kiro / Copilot / Antigravity quota windows with reset countdowns
|
|
67
|
-
- 💰 **Cost engine** — 2,200+ models priced via [LiteLLM](https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json) (auto-refreshed daily) + curated overrides for niche tools (Kiro, Cursor Composer, Kimi, CodeBuddy hy3); 24h disk cache + bundled offline snapshot mean accurate USD without an internet connection. Models without published vendor pricing (e.g. Tencent hy3-preview) are tracked by tokens but show $0 cost until the vendor publishes a rate.
|
|
68
|
-
- 🌐 **Optional leaderboard** — Compare with developers worldwide; drag-to-reorder columns to focus on the providers you care about (opt-in, sign in to participate)
|
|
69
|
-
- 🧩 **Optional Skills tab** — browse 250+ public skills from `anthropics/skills`, `ComposioHQ/awesome-claude-skills`, `skills.sh` and any GitHub repo you add; sync them across Claude / Codex / Grok / Antigravity / Gemini / OpenCode / Hermes with named targets and one-click Undo
|
|
70
|
-
- 🔒 **Privacy-first** — Only token counts and timestamps. Never prompts, responses, or file contents.
|
|
71
|
-
|
|
72
48
|
---
|
|
73
49
|
|
|
74
|
-
##
|
|
50
|
+
## ✨ What you get
|
|
75
51
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
52
|
+
- 🏠 **100% local.** Token counts and timestamps only — never prompts, responses, or file contents. No account, no API keys, no phone-home.
|
|
53
|
+
- 🚀 **Zero config.** Hooks auto-install on the first run. Zero to dashboard in about 30 seconds.
|
|
54
|
+
- 🔌 **22 tools out of the box.** Claude Code, Codex, Cursor, Gemini, Copilot, Antigravity, OpenCode, Kiro, Zed, Goose, and more — auto-detected.
|
|
55
|
+
- 💰 **Accurate cost.** 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 so your numbers match each provider's own billing.
|
|
56
|
+
- 📈 **Rate-limit tracking.** Live quota windows with reset countdowns for Claude, Codex, Cursor, Gemini, Kiro, Copilot, and Antigravity.
|
|
57
|
+
- 🧩 **Optional extras.** A worldwide leaderboard (opt-in) and a Skills tab that syncs 250+ public skills across your tools.
|
|
79
58
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<img src="https://raw.githubusercontent.com/pitimon/TokenTracker/main/docs/screenshots/dashboard-light.png" alt="Dashboard" />
|
|
83
|
-
|
|
84
|
-
</td>
|
|
85
|
-
<td width="50%">
|
|
86
|
-
|
|
87
|
-
**Global Leaderboard** — compare with developers worldwide
|
|
59
|
+
---
|
|
88
60
|
|
|
89
|
-
|
|
61
|
+
## 📊 The dashboard
|
|
90
62
|
|
|
91
|
-
|
|
92
|
-
</tr>
|
|
93
|
-
<tr>
|
|
94
|
-
<td colspan="2">
|
|
63
|
+
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.
|
|
95
64
|
|
|
96
|
-
|
|
65
|
+
| Dark | Light |
|
|
66
|
+
|---|---|
|
|
67
|
+
| <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" /> |
|
|
97
68
|
|
|
98
|
-
|
|
69
|
+
**On one screen:**
|
|
70
|
+
- **Total tokens + cost** for the selected window (24h / day / 7d / 30d / total / custom), with a browser-timezone "Updated" stamp.
|
|
71
|
+
- **Usage Trend** — token volume over time, right beside the total.
|
|
72
|
+
- **Provider breakdown** — every tool's share and top models, with a click-to-expand per-model drill-down.
|
|
73
|
+
- **Context breakdown** — where Claude's and Codex's tokens actually go (input / output / cache / reasoning), shown side by side.
|
|
74
|
+
- **Activity heatmap** — daily usage at a glance.
|
|
75
|
+
- **Project & daily tables** — per-project totals and a day-by-day breakdown with cost and $/MTok.
|
|
99
76
|
|
|
100
|
-
|
|
101
|
-
</tr>
|
|
102
|
-
</table>
|
|
77
|
+
Auto-refresh runs only while the tab is visible (`Off` / `30s` / `60s` / `120s`, default `30s`).
|
|
103
78
|
|
|
104
79
|
---
|
|
105
80
|
|
|
106
|
-
## 🔌 Supported
|
|
81
|
+
## 🔌 Supported tools
|
|
107
82
|
|
|
108
|
-
|
|
109
|
-
|---|---|---|
|
|
110
|
-
| **Claude Code** | ✅ Auto | SessionEnd hook in `settings.json` |
|
|
111
|
-
| **Codex CLI** | ✅ Auto | TOML notify hook in `config.toml` |
|
|
112
|
-
| **Cursor** | ✅ Auto | API + SQLite auth token |
|
|
113
|
-
| **Kiro** | ✅ Auto | SQLite + JSONL hybrid |
|
|
114
|
-
| **Gemini CLI** | ✅ Auto | SessionEnd hook |
|
|
115
|
-
| **OpenCode** | ✅ Auto | Plugin system + SQLite |
|
|
116
|
-
| **OpenClaw** | ✅ Auto | Session plugin |
|
|
117
|
-
| **Every Code** | ✅ Auto | TOML notify hook |
|
|
118
|
-
| **Hermes Agent** | ✅ Auto | SQLite sessions table (`~/.hermes/state.db`) |
|
|
119
|
-
| **GitHub Copilot** | ✅ Auto | OpenTelemetry file exporter (`COPILOT_OTEL_FILE_EXPORTER_PATH`) |
|
|
120
|
-
| **Kimi Code** | ✅ Auto | Passive `wire.jsonl` reader (`~/.kimi/sessions/**/wire.jsonl`) |
|
|
121
|
-
| **oh-my-pi (Pi Coding Agent)** | ✅ Auto | Passive reader (`~/.omp/agent/sessions/**/*.jsonl`) |
|
|
122
|
-
| **CodeBuddy** (Tencent) | ✅ Auto | SessionEnd hook in `~/.codebuddy/settings.json` (Claude-Code fork) |
|
|
123
|
-
| **Grok Build** (xAI) | ✅ Auto | SessionEnd hook + passive `updates.jsonl` / `signals.json` scan (`~/.grok/sessions/**/`) |
|
|
124
|
-
| **Kilo CLI** (kilo.ai) | ✅ Auto | Passive SQLite reader (`~/.local/share/kilo/kilo.db`, OpenCode-fork schema) |
|
|
125
|
-
| **Kilo Code** (VS Code extension) | ✅ Auto | Passive `ui_messages.json` reader (Cursor/Code/CodeBuddy/Windsurf globalStorage) |
|
|
126
|
-
| **Antigravity** | ✅ Auto | Passive transcript reader (`~/.gemini/{antigravity,antigravity-ide,antigravity-cli}/brain/**/transcript.jsonl`) |
|
|
127
|
-
| **pi** (`@mariozechner/pi-coding-agent`) | ✅ Auto | Passive reader (`~/.pi/agent/sessions/**/*.jsonl`) |
|
|
128
|
-
| **Craft Agents** | ✅ Auto | Passive session reader (`~/.craft-agent` + workspace session logs) |
|
|
129
|
-
| **Roo Code** (VS Code extension) | ✅ Auto | Passive `ui_messages.json` reader (`rooveterinaryinc.roo-cline`) |
|
|
130
|
-
| **Zed Agent** | ✅ Auto | Passive SQLite reader (`threads.db`, hosted `zed.dev` models only) |
|
|
131
|
-
| **Goose** (Block) | ✅ Auto | Passive SQLite reader (`sessions.db`, cumulative deltas) |
|
|
132
|
-
|
|
133
|
-
> **Do I need to install any plugin or hook manually?** No. `tokentracker` (or `tokentracker init`) handles everything on first run:
|
|
134
|
-
> - **Hook-based** tools (Claude Code, Codex, Gemini, Every Code, **CodeBuddy**, **Grok Build**) — we write a SessionEnd hook or TOML notify entry into the tool's own config.
|
|
135
|
-
> - **Plugin-based** tools (OpenCode, **OpenClaw**) — the plugin ships inside the npm package (`~/.tokentracker/app/openclaw-plugin/`). We link it via the tool's own CLI (`openclaw plugins install --link …` + `enable`). No download, no drag-and-drop.
|
|
136
|
-
> - **Passive readers** (Cursor, Kiro, Hermes, Kimi Code, Copilot, **Grok Build**, **oh-my-pi**, **pi**, **Craft Agents**, **Kilo CLI**, **Kilo Code**, **Roo Code**, **Antigravity**, **Zed Agent**, **Goose**) — nothing is installed into those tools. We only read files they already produce (SQLite DB, JSONL, OTEL export, session logs).
|
|
137
|
-
> - **Grok Build estimate** — current local telemetry exposes cumulative `updates.jsonl` `totalTokens`, but not a stable prompt/output/cache split; `signals.json` remains a fallback with `contextTokensUsed` snapshots. TokenTracker estimates Grok cost until per-call usage details are available.
|
|
138
|
-
>
|
|
139
|
-
> Run `tokentracker status` anytime to verify every integration's state. If something shows `skipped`, the `detail` column explains why (e.g. tool CLI not on `PATH`, config unreadable).
|
|
140
|
-
>
|
|
141
|
-
> Deeper dives: [OpenClaw integration & troubleshooting](docs/openclaw-integration.md).
|
|
142
|
-
|
|
143
|
-
Missing your tool? [Open an issue](https://github.com/pitimon/TokenTracker/issues/new) — adding new providers is usually one parser file away.
|
|
144
|
-
|
|
145
|
-
---
|
|
83
|
+
Auto-detected on first run — no manual plugin or hook wiring:
|
|
146
84
|
|
|
147
|
-
|
|
85
|
+
> **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**
|
|
148
86
|
|
|
149
|
-
|
|
87
|
+
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).
|
|
150
88
|
|
|
151
|
-
|
|
152
|
-
|--------------------------|:---:|:---:|:---:|
|
|
153
|
-
| **AI tools supported** | **22** | 1 (Claude) | 1 (Cursor) |
|
|
154
|
-
| **Local-first, no account** | ✅ | ✅ | ❌ |
|
|
155
|
-
| **Rate-limit tracking** | ✅ 7 providers | ❌ | Cursor only |
|
|
156
|
-
| **Accurate multi-provider dedup** | ✅ | ❌ ¹ | — |
|
|
157
|
-
|
|
158
|
-
<sub>¹ `reqId`-based deduplication over-counts providers that omit a request ID (DeepSeek / Kimi / MiniMax / Claude sub-agents) by 1.6–3.7×. TokenTracker dedups on a composite key, so totals match each provider's own billing dashboard.</sub>
|
|
89
|
+
Run `tokentracker status` to see each integration's state. Missing your tool? [Open an issue](https://github.com/pitimon/TokenTracker/issues/new) — a new provider is usually one parser file away.
|
|
159
90
|
|
|
160
91
|
---
|
|
161
92
|
|
|
162
|
-
## 🏗️ How
|
|
93
|
+
## 🏗️ How it works
|
|
163
94
|
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
A -->|hooks trigger| B[Token Tracker]
|
|
168
|
-
B -->|parse logs<br/>30-min UTC buckets| C[(Local SQLite)]
|
|
169
|
-
C --> D[Web Dashboard]
|
|
170
|
-
C -.->|opt-in| E[(Cloud Leaderboard)]
|
|
95
|
+
```
|
|
96
|
+
AI CLI tools → hooks / passive readers → local SQLite → dashboard
|
|
97
|
+
(logs) (token counts only) (30-min buckets) (your browser)
|
|
171
98
|
```
|
|
172
99
|
|
|
173
|
-
1. AI
|
|
174
|
-
2. Lightweight hooks
|
|
175
|
-
3.
|
|
176
|
-
4.
|
|
177
|
-
|
|
178
|
-
|
|
100
|
+
1. Your AI tools write logs during normal use.
|
|
101
|
+
2. Lightweight hooks (or passive file readers) pick up token counts locally — never prompt or response content.
|
|
102
|
+
3. Counts are aggregated into 30-minute UTC buckets in a local SQLite snapshot.
|
|
103
|
+
4. The dashboard reads that snapshot and renders it in your browser's timezone.
|
|
104
|
+
|
|
105
|
+
The leaderboard is the only feature that ever leaves your machine, and only when you opt in.
|
|
179
106
|
|
|
180
107
|
---
|
|
181
108
|
|
|
182
109
|
## 🛡️ Privacy
|
|
183
110
|
|
|
184
|
-
| Protection |
|
|
111
|
+
| Protection | What it means |
|
|
185
112
|
|---|---|
|
|
186
|
-
| **No content
|
|
187
|
-
| **Local
|
|
188
|
-
| **Auditable** | Open source
|
|
113
|
+
| **No content** | Only token counts and timestamps. Never prompts, responses, or files. |
|
|
114
|
+
| **Local by default** | All data stays on your machine. The leaderboard is fully opt-in. |
|
|
115
|
+
| **Auditable** | Open source — read [`src/lib/rollout.js`](src/lib/rollout.js); it's just numbers and timestamps. |
|
|
189
116
|
| **No telemetry** | No analytics, no crash reporting, no phone-home. |
|
|
190
117
|
|
|
191
118
|
---
|
|
192
119
|
|
|
193
120
|
## 📦 Configuration
|
|
194
121
|
|
|
195
|
-
Most users never
|
|
122
|
+
Most users never touch this — defaults are sensible.
|
|
196
123
|
|
|
197
124
|
| Variable | Description | Default |
|
|
198
125
|
|---|---|---|
|
|
199
|
-
| `TOKENTRACKER_DEBUG` |
|
|
200
|
-
| `TOKENTRACKER_HTTP_TIMEOUT_MS` | HTTP timeout
|
|
126
|
+
| `TOKENTRACKER_DEBUG` | Debug output (`1` to enable) | — |
|
|
127
|
+
| `TOKENTRACKER_HTTP_TIMEOUT_MS` | HTTP timeout (ms) | `20000` |
|
|
201
128
|
| `CODEX_HOME` | Override Codex CLI directory | `~/.codex` |
|
|
202
129
|
| `GEMINI_HOME` | Override Gemini CLI directory | `~/.gemini` |
|
|
203
|
-
| `TOKENTRACKER_GROK_HOME` | Override Grok Build directory
|
|
204
|
-
| `GROK_HOME` | Legacy Grok Build directory override, used when `TOKENTRACKER_GROK_HOME` is unset | `~/.grok` |
|
|
205
|
-
| `TOKENTRACKER_ANTIGRAVITY_HOME` | Force a single Antigravity Skills directory (auto-detects `~/.gemini/antigravity` + `~/.gemini/antigravity-ide` otherwise) | auto |
|
|
206
|
-
|
|
207
|
-
### Dashboard refresh behavior
|
|
208
|
-
|
|
209
|
-
The local dashboard is designed to stay current without hammering the local sync path:
|
|
130
|
+
| `TOKENTRACKER_GROK_HOME` | Override Grok Build directory | `~/.grok` |
|
|
210
131
|
|
|
211
|
-
|
|
212
|
-
- The default interval is `30s`; the selector supports `Off`, `30s`, `60s`, and `120s`.
|
|
213
|
-
- If an older browser session has a removed `10s` preference saved, TokenTracker falls back to `30s`.
|
|
214
|
-
- Manual refresh runs local sync first in local mode, then reloads dashboard data.
|
|
215
|
-
- Auto-refresh starts local sync in the background, keeps the UI responsive, and only performs a second data reload when sync reports new 30-minute buckets.
|
|
216
|
-
- The Total tokens panel shows an `Updated ...` timestamp formatted in the browser's timezone, so you can tell when the displayed snapshot last refreshed.
|
|
132
|
+
To force a dashboard port: `PORT=7700 tokentracker serve` (otherwise it auto-picks the next free port from `7680`).
|
|
217
133
|
|
|
218
134
|
---
|
|
219
135
|
|
|
@@ -224,103 +140,43 @@ git clone https://github.com/pitimon/TokenTracker.git
|
|
|
224
140
|
cd TokenTracker
|
|
225
141
|
npm install
|
|
226
142
|
|
|
227
|
-
#
|
|
228
|
-
|
|
143
|
+
# build the dashboard, then run the CLI
|
|
144
|
+
npm run dashboard:build
|
|
229
145
|
node bin/tracker.js
|
|
230
146
|
|
|
231
|
-
#
|
|
232
|
-
npm
|
|
147
|
+
npm test # root tests
|
|
148
|
+
npm run ci:local # full local gate (build + tests + validators)
|
|
233
149
|
```
|
|
234
150
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
### CLI
|
|
238
|
-
|
|
239
|
-
<details>
|
|
240
|
-
<summary><b>"engines.node" or unsupported version error</b></summary>
|
|
241
|
-
|
|
242
|
-
<br/>
|
|
243
|
-
|
|
244
|
-
TokenTracker requires **Node 20+**. Check your version:
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
node --version
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
If lower, upgrade via [nvm](https://github.com/nvm-sh/nvm), [fnm](https://github.com/Schniz/fnm), or your package manager (`brew upgrade node`, `apt install nodejs`).
|
|
251
|
-
|
|
252
|
-
</details>
|
|
253
|
-
|
|
254
|
-
<details>
|
|
255
|
-
<summary><b>Port 7680 already in use</b></summary>
|
|
256
|
-
|
|
257
|
-
<br/>
|
|
258
|
-
|
|
259
|
-
The dashboard server picks the next free port automatically (`7681`, `7682`, ...) when `7680` is taken. The actual port is logged on startup. If you want to force a specific port:
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
PORT=7700 tokentracker serve
|
|
263
|
-
```
|
|
264
|
-
|
|
265
|
-
To find what's holding `7680`:
|
|
266
|
-
|
|
267
|
-
```bash
|
|
268
|
-
lsof -i :7680
|
|
269
|
-
```
|
|
151
|
+
---
|
|
270
152
|
|
|
271
|
-
|
|
153
|
+
## 🔧 Troubleshooting
|
|
272
154
|
|
|
273
155
|
<details>
|
|
274
|
-
<summary><b>
|
|
156
|
+
<summary><b>A tool isn't being detected</b></summary>
|
|
275
157
|
|
|
276
158
|
<br/>
|
|
277
159
|
|
|
278
|
-
If `~/Library/LaunchAgents/com.pitimon.tokentracker.local-sync.plist` was installed by an older development checkout, its wrapper may still point at a deleted repo path. The symptom in `~/.tokentracker/tracker/logs/local-sync.err.log` looks like:
|
|
279
|
-
|
|
280
|
-
```text
|
|
281
|
-
cd: /Users/you/src/TokenTracker: No such file or directory
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Regenerate the local services from the current checkout:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
bash scripts/install-local-service.sh
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
Then verify:
|
|
291
|
-
|
|
292
160
|
```bash
|
|
293
|
-
|
|
294
|
-
|
|
161
|
+
tokentracker status # see each integration's state
|
|
162
|
+
tokentracker doctor # deeper health check
|
|
295
163
|
```
|
|
296
164
|
|
|
297
|
-
|
|
165
|
+
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.
|
|
298
166
|
|
|
299
167
|
</details>
|
|
300
168
|
|
|
301
169
|
<details>
|
|
302
|
-
<summary><b>
|
|
170
|
+
<summary><b>Port 7680 is already in use</b></summary>
|
|
303
171
|
|
|
304
172
|
<br/>
|
|
305
173
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
```bash
|
|
309
|
-
tokentracker status
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
Then run the doctor for a deeper health check:
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
tokentracker doctor
|
|
316
|
-
```
|
|
317
|
-
|
|
318
|
-
If a provider shows as not configured even though you use it, try `tokentracker activate-if-needed` to re-run hook detection. If still missing, [open an issue](https://github.com/pitimon/TokenTracker/issues/new) with the `doctor` output attached.
|
|
174
|
+
The server auto-picks the next free port (`7681`, `7682`, …) and logs it on startup. To force one: `PORT=7700 tokentracker serve`. To see what's holding the port: `lsof -i :7680`.
|
|
319
175
|
|
|
320
176
|
</details>
|
|
321
177
|
|
|
322
178
|
<details>
|
|
323
|
-
<summary><b>
|
|
179
|
+
<summary><b>Remove everything</b></summary>
|
|
324
180
|
|
|
325
181
|
<br/>
|
|
326
182
|
|
|
@@ -328,57 +184,17 @@ If a provider shows as not configured even though you use it, try `tokentracker
|
|
|
328
184
|
tokentracker uninstall
|
|
329
185
|
```
|
|
330
186
|
|
|
331
|
-
|
|
187
|
+
Removes every hook TokenTracker installed across all detected tools, plus local config and data. Safe to re-run.
|
|
332
188
|
|
|
333
189
|
</details>
|
|
334
190
|
|
|
335
|
-
## 🪪 README Badges
|
|
336
|
-
|
|
337
|
-
Show off your token usage on your GitHub profile or project README.
|
|
338
|
-
|
|
339
|
-
To get `YOUR_USER_ID`:
|
|
340
|
-
1. Run `tokentracker`, open the dashboard, and sign in to the leaderboard.
|
|
341
|
-
2. Go to **Settings → Account**.
|
|
342
|
-
3. Use the **User ID** shown there. On headless machines, `tokentracker device-login` also writes the same `user_id` to `~/.tokentracker/tracker/config.json`.
|
|
343
|
-
|
|
344
|
-
Then drop one of these in:
|
|
345
|
-
|
|
346
|
-
```markdown
|
|
347
|
-
[](https://github.com/pitimon/TokenTracker)
|
|
348
|
-
[](https://github.com/pitimon/TokenTracker)
|
|
349
|
-
[](https://github.com/pitimon/TokenTracker)
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
> The link target defaults to the TokenTracker repo so every click helps other developers discover the tool. Swap it for your leaderboard profile or personal site if you'd rather route clicks elsewhere.
|
|
353
|
-
|
|
354
|
-
Renders shields.io-compatible badges with your current totals (60s cache):
|
|
355
|
-
|
|
356
|
-
| Param | Values | Default |
|
|
357
|
-
|---|---|---|
|
|
358
|
-
| `metric` | `tokens` / `cost` / `rank` | `tokens` |
|
|
359
|
-
| `period` | `week` / `month` / `total` | `total` |
|
|
360
|
-
| `style` | `flat` / `flat-square` | `flat` |
|
|
361
|
-
| `label` | any short string | metric name |
|
|
362
|
-
| `color` | hex, e.g. `ff6b35` | brand green |
|
|
363
|
-
|
|
364
|
-
> **Privacy**: badges only resolve for profiles where leaderboard sharing is **on** (`Settings → Account → Public profile`). Private profiles get a "private" placeholder.
|
|
365
|
-
|
|
366
|
-
---
|
|
367
|
-
|
|
368
|
-
## ⭐ Star History
|
|
369
|
-
|
|
370
|
-
<a href="https://star-history.com/#pitimon/TokenTracker&Date">
|
|
371
|
-
<img src="https://api.star-history.com/svg?repos=pitimon/TokenTracker&type=Date" alt="Star History Chart" width="600" />
|
|
372
|
-
</a>
|
|
373
|
-
|
|
374
191
|
---
|
|
375
192
|
|
|
376
193
|
## 🤝 Contributing & Support
|
|
377
194
|
|
|
378
|
-
- **Bugs /
|
|
379
|
-
- **Security
|
|
380
|
-
- **Pull requests
|
|
381
|
-
- **Questions / showcase**: [GitHub Discussions](https://github.com/pitimon/TokenTracker/discussions)
|
|
195
|
+
- **Bugs / features** — [open an issue](https://github.com/pitimon/TokenTracker/issues/new)
|
|
196
|
+
- **Security** — see [SECURITY.md](SECURITY.md) (please don't file public issues for security reports)
|
|
197
|
+
- **Pull requests** — see [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
382
198
|
|
|
383
199
|
## 🙏 Credits
|
|
384
200
|
|
|
@@ -392,8 +208,8 @@ The Clawd character design belongs to Anthropic. This is a community project wit
|
|
|
392
208
|
|
|
393
209
|
<div align="center">
|
|
394
210
|
|
|
395
|
-
**Token Tracker** —
|
|
211
|
+
**Token Tracker** — quantify your AI output.
|
|
396
212
|
|
|
397
|
-
<a href="https://www.npmjs.com/package/@ipv9/tokentracker-cli">npm</a>
|
|
213
|
+
<a href="https://www.npmjs.com/package/@ipv9/tokentracker-cli">npm</a> · <a href="https://github.com/pitimon/TokenTracker">GitHub</a>
|
|
398
214
|
|
|
399
215
|
</div>
|