tokentracker-cli 0.2.27 → 0.3.0
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 +60 -28
- package/dashboard/dist/assets/DashboardPage-CdsMxGgP.js +12 -0
- package/dashboard/dist/assets/{LandingExtras-BUwK_c-9.js → LandingExtras-BPCBL0OB.js} +1 -1
- package/dashboard/dist/assets/LeaderboardPage-T0DeP6QE.js +1 -0
- package/dashboard/dist/assets/LeaderboardProfilePage-DeXNLaq5.js +1 -0
- package/dashboard/dist/assets/{MatrixRain-D7Pm88QF.js → MatrixRain-DNvnkted.js} +1 -1
- package/dashboard/dist/assets/MatrixShell-p6MtAS33.js +1 -0
- package/dashboard/dist/assets/{main-oIbJf8pA.js → main-CvjKTqMk.js} +10 -8
- package/dashboard/dist/assets/main-DJvWJCv5.css +1 -0
- package/dashboard/dist/assets/vibeusage-api-By1xP_lg.js +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dashboard/dist/share.html +2 -2
- package/package.json +2 -2
- package/src/commands/init.js +22 -1
- package/src/commands/sync.js +52 -2
- package/src/lib/cursor-config.js +328 -0
- package/src/lib/local-api.js +108 -12
- package/src/lib/rollout.js +116 -2
- package/dashboard/dist/assets/AsciiBox-BZ2xYyXa.js +0 -1
- package/dashboard/dist/assets/DashboardPage-ynq92wZf.js +0 -12
- package/dashboard/dist/assets/LeaderboardPage-IzN8LibU.js +0 -1
- package/dashboard/dist/assets/LeaderboardProfilePage-3JjGYRaz.js +0 -1
- package/dashboard/dist/assets/MatrixShell-BtjokX5f.js +0 -1
- package/dashboard/dist/assets/main-hwTpulbk.css +0 -1
package/README.md
CHANGED
|
@@ -11,67 +11,87 @@
|
|
|
11
11
|
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
+
<div align="center">
|
|
15
|
+
<img src="docs/screenshots/dashboard-dark.png" alt="Token Tracker Dashboard" width="800" />
|
|
16
|
+
<br/><br/>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
14
19
|
---
|
|
15
20
|
|
|
16
|
-
##
|
|
21
|
+
## Two Ways to Use
|
|
22
|
+
|
|
23
|
+
### Option A: macOS Menu Bar App (Recommended)
|
|
24
|
+
|
|
25
|
+
Download `TokenTrackerBar.dmg` from the [latest release](https://github.com/mm7894215/tokentracker/releases/latest), drag to Applications, done.
|
|
26
|
+
|
|
27
|
+
- Lives in your menu bar — click to see usage stats
|
|
28
|
+
- Auto-syncs data from all supported CLI tools
|
|
29
|
+
- No terminal, no Node.js, no setup required
|
|
30
|
+
|
|
31
|
+
<div align="center">
|
|
32
|
+
<img src="docs/screenshots/menubar.jpeg" alt="Menu Bar App" width="420" />
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
### Option B: CLI + Web Dashboard
|
|
17
36
|
|
|
18
37
|
```bash
|
|
19
38
|
npx tokentracker-cli
|
|
20
39
|
```
|
|
21
40
|
|
|
22
|
-
One command does everything: first-time setup → hook installation → data sync → open dashboard
|
|
41
|
+
One command does everything: first-time setup → hook installation → data sync → open dashboard at `http://localhost:7890`.
|
|
42
|
+
|
|
43
|
+
Install globally for shorter commands:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm i -g tokentracker-cli
|
|
47
|
+
tokentracker # Open dashboard
|
|
48
|
+
tokentracker sync # Manual sync
|
|
49
|
+
tokentracker status # Check hook status
|
|
50
|
+
tokentracker doctor # Health check
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
<div align="center">
|
|
56
|
+
<img src="docs/screenshots/dashboard-light.png" alt="Web Dashboard" width="800" />
|
|
57
|
+
</div>
|
|
23
58
|
|
|
24
59
|
## Features
|
|
25
60
|
|
|
26
|
-
- **Multi-Source Tracking** — Codex CLI,
|
|
61
|
+
- **Multi-Source Tracking** — Claude Code, Codex CLI, Cursor, Gemini CLI, OpenCode, OpenClaw, Every Code
|
|
27
62
|
- **Local-First** — All data stays on your machine. No cloud account required.
|
|
28
63
|
- **Zero-Config** — Hooks auto-detect and configure on first run
|
|
29
|
-
- **Built-in Dashboard** — Web UI
|
|
64
|
+
- **Built-in Dashboard** — Web UI with usage trends, model breakdowns, heatmaps
|
|
30
65
|
- **Privacy-First** — Only token counts tracked, never prompts or responses
|
|
31
66
|
|
|
32
67
|
## Supported CLI Tools
|
|
33
68
|
|
|
34
69
|
| CLI Tool | Auto-Detection |
|
|
35
70
|
|----------|----------------|
|
|
36
|
-
| **Codex CLI** | ✅ |
|
|
37
71
|
| **Claude Code** | ✅ |
|
|
72
|
+
| **Codex CLI** | ✅ |
|
|
73
|
+
| **Cursor** | ✅ (via API) |
|
|
38
74
|
| **Gemini CLI** | ✅ |
|
|
39
75
|
| **OpenCode** | ✅ |
|
|
40
76
|
| **OpenClaw** | ✅ |
|
|
41
77
|
| **Every Code** | ✅ |
|
|
42
78
|
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
After first run via `npx tokentracker-cli`, you can also install globally for shorter commands:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm i -g tokentracker-cli
|
|
49
|
-
|
|
50
|
-
# Then use anywhere:
|
|
51
|
-
tokentracker # Open dashboard
|
|
52
|
-
tokentracker serve --port 3000
|
|
53
|
-
tokentracker sync # Manual sync
|
|
54
|
-
tokentracker status # Check hook status
|
|
55
|
-
tokentracker doctor # Health check
|
|
56
|
-
tokentracker uninstall # Remove hooks
|
|
57
|
-
```
|
|
58
|
-
|
|
59
79
|
## How It Works
|
|
60
80
|
|
|
61
81
|
```
|
|
62
|
-
AI CLI Tools (Codex,
|
|
82
|
+
AI CLI Tools (Claude, Codex, Cursor, Gemini, OpenCode, ...)
|
|
63
83
|
│
|
|
64
84
|
│ hooks auto-trigger on usage
|
|
65
85
|
▼
|
|
66
|
-
Token Tracker
|
|
86
|
+
Token Tracker (local parsing + aggregation)
|
|
67
87
|
│
|
|
68
88
|
│ 30-minute UTC buckets
|
|
69
89
|
▼
|
|
70
|
-
|
|
90
|
+
Dashboard (Menu Bar App or localhost:7890)
|
|
71
91
|
```
|
|
72
92
|
|
|
73
93
|
1. AI CLI tools generate logs during usage
|
|
74
|
-
2. Lightweight hooks detect changes and trigger sync
|
|
94
|
+
2. Lightweight hooks detect changes and trigger sync (Cursor: usage pulled via API)
|
|
75
95
|
3. CLI parses logs locally, extracts only token counts
|
|
76
96
|
4. Data aggregated into 30-minute buckets
|
|
77
97
|
5. Dashboard reads local data directly — no cloud needed
|
|
@@ -102,16 +122,28 @@ git clone https://github.com/mm7894215/tokentracker.git
|
|
|
102
122
|
cd tokentracker
|
|
103
123
|
npm install
|
|
104
124
|
|
|
105
|
-
# Build dashboard
|
|
125
|
+
# Build and run web dashboard
|
|
106
126
|
cd dashboard && npm install && npm run build && cd ..
|
|
107
|
-
|
|
108
|
-
# Run locally
|
|
109
127
|
node bin/tracker.js
|
|
110
128
|
|
|
111
129
|
# Run tests
|
|
112
130
|
npm test
|
|
113
131
|
```
|
|
114
132
|
|
|
133
|
+
### Building the macOS App
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
cd TokenTrackerBar
|
|
137
|
+
npm run dashboard:build # Build dashboard (from repo root)
|
|
138
|
+
./scripts/bundle-node.sh # Download Node.js + bundle tokentracker
|
|
139
|
+
xcodegen generate # Generate Xcode project
|
|
140
|
+
ruby scripts/patch-pbxproj-icon.rb # Patch Icon Composer support
|
|
141
|
+
xcodebuild -scheme TokenTrackerBar -configuration Release clean build
|
|
142
|
+
./scripts/create-dmg.sh # Create distributable DMG
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Requires: Xcode 16+, [XcodeGen](https://github.com/yonaskolb/XcodeGen)
|
|
146
|
+
|
|
115
147
|
## License
|
|
116
148
|
|
|
117
149
|
[MIT](LICENSE)
|