tokmon 0.13.0 → 0.14.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/README.md +31 -13
- package/dist/cli.js +2141 -403
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# tokmon
|
|
2
2
|
|
|
3
|
-
Terminal dashboard for **Claude Code**, **Codex**, and **
|
|
3
|
+
Terminal dashboard for **Claude Code**, **Codex**, **Cursor**, **Copilot**, **opencode**, **pi**, **Antigravity**, and **Gemini** — usage, costs, and rate limits, all in one place.
|
|
4
4
|
|
|
5
5
|
Built with [Ink](https://github.com/vadimdemedes/ink) and TypeScript.
|
|
6
6
|
|
|
@@ -28,15 +28,27 @@ Then run `tokmon`. On first launch you'll pick which providers to track; press `
|
|
|
28
28
|
|
|
29
29
|
## Providers
|
|
30
30
|
|
|
31
|
+
**Usage providers** — full cost & token history (Today / Week / Month, sparkline, per-model table):
|
|
32
|
+
|
|
33
|
+
| Provider | What it reads | What you get |
|
|
34
|
+
|----------|---------------|--------------|
|
|
35
|
+
| **Claude** | `~/.claude/projects/**/*.jsonl` | Cost & token history, plan (e.g. Max 20x), live 5h / weekly / Sonnet limits |
|
|
36
|
+
| **Codex** | `~/.codex/sessions/**/rollout-*.jsonl` | Cost & token history, plan, live 5h / weekly limits, credit balance |
|
|
37
|
+
| **opencode** | `~/.local/share/opencode/opencode.db` | Cost & token history across whatever providers opencode routes to (uses its own recorded cost) |
|
|
38
|
+
| **pi** | `~/.pi/agent/sessions/**/*.jsonl` | Cost & token history (uses pi's own recorded cost) |
|
|
39
|
+
|
|
40
|
+
**Billing / quota providers** — plan + live quota or spend (no local token history):
|
|
41
|
+
|
|
31
42
|
| Provider | What it reads | What you get |
|
|
32
43
|
|----------|---------------|--------------|
|
|
33
|
-
| **
|
|
34
|
-
| **
|
|
35
|
-
| **
|
|
44
|
+
| **Cursor** | `state.vscdb` + local tracking DBs | Plan, current-period spend, on-demand caps, per-model spend, AI-code activity |
|
|
45
|
+
| **Copilot** | GitHub token (gh / VS Code) | Plan + premium-request & chat quota |
|
|
46
|
+
| **Antigravity** | its `state.vscdb` OAuth → Google Cloud Code | Plan + per-pool (Gemini Pro/Flash/Claude) quota |
|
|
47
|
+
| **Gemini** | `~/.gemini/oauth_creds.json` → Google Cloud Code | Plan + quota (re-run `gemini` to refresh an expired token) |
|
|
36
48
|
|
|
37
|
-
tokmon auto-detects which tools are installed (on `PATH` or as a desktop app)
|
|
49
|
+
tokmon auto-detects which tools are installed (on `PATH` or as a desktop app). On first launch you pick which to track, and when a new provider you have installed is added in an update, tokmon offers it once on the next launch. You can also toggle any provider in settings.
|
|
38
50
|
|
|
39
|
-
Costs use each model's published pricing. **Cached tokens are billed at the discounted cache-read rate**, not full input rate — so tokmon's totals reflect what you're actually charged, and tend to be far lower than tools that count cache reads at full price.
|
|
51
|
+
Costs use each model's published pricing (or the tool's own recorded cost where it stores one). **Cached tokens are billed at the discounted cache-read rate**, not full input rate — so tokmon's totals reflect what you're actually charged, and tend to be far lower than tools that count cache reads at full price.
|
|
40
52
|
|
|
41
53
|
## Views
|
|
42
54
|
|
|
@@ -50,7 +62,7 @@ A responsive grid of provider cards (or one card at a time — see **Dashboard l
|
|
|
50
62
|
- **Rate limits** — live utilization bars with reset countdowns
|
|
51
63
|
- **Sparkline** — recent daily activity
|
|
52
64
|
|
|
53
|
-
When you track more than one account, a focus strip lets you view **All** together or zoom into a single account.
|
|
65
|
+
The grid reflows to fit your terminal — more columns when it's wide, compacting cards when it's short. With more providers than fit on screen, it splits into **pages**; **scroll** (mouse wheel) to move between them (or `↑`/`↓` / `[` `]`). When you track more than one account, a focus strip lets you view **All** together or zoom into a single account.
|
|
54
66
|
|
|
55
67
|
A **Peak / Off-Peak** badge appears in the header (Claude only), fetched from [promoclock.co](https://promoclock.co) — peak hours drain session limits faster.
|
|
56
68
|
|
|
@@ -76,6 +88,7 @@ For **Cursor** — a per-model spend table (cost, request count, share of total,
|
|
|
76
88
|
|-----|--------|
|
|
77
89
|
| `Tab` | Switch between Dashboard and Table |
|
|
78
90
|
| `←` `→` | (Dashboard) switch between Dashboard and Table |
|
|
91
|
+
| scroll / `↑` `↓` / `[` `]` | (Dashboard) move between pages when paginated |
|
|
79
92
|
| `a` `A` | Cycle account focus forward / back |
|
|
80
93
|
| `0`–`9` | Jump to an account focus slot |
|
|
81
94
|
| `s` | Open settings |
|
|
@@ -120,6 +133,7 @@ Press `s` to open.
|
|
|
120
133
|
- **Timezone** — IANA timezone, or `System`
|
|
121
134
|
- **Dashboard layout** — `grid` (all providers at once) or `single` (one at a time)
|
|
122
135
|
- **Default focus** — start on `all`, or remember your `last` focused account
|
|
136
|
+
- **ASCII glyphs** — `auto` (detect), `on` (force ASCII), or `off` (force Unicode)
|
|
123
137
|
|
|
124
138
|
**Providers** — toggle each provider on or off.
|
|
125
139
|
|
|
@@ -129,9 +143,13 @@ Press `s` to open.
|
|
|
129
143
|
|
|
130
144
|
```
|
|
131
145
|
-i, --interval <seconds> Refresh interval in seconds (default: from config, or 2)
|
|
146
|
+
--ascii Force ASCII glyphs (also: TOKMON_ASCII=1)
|
|
147
|
+
--no-ascii Force Unicode glyphs
|
|
132
148
|
-h, --help Show help
|
|
133
149
|
```
|
|
134
150
|
|
|
151
|
+
tokmon auto-detects whether your terminal can render Unicode (block sparklines, box borders) and falls back to ASCII on terminals/fonts that can't (e.g. legacy Windows console). Override with `--ascii` / `--no-ascii`, the `TOKMON_ASCII` env var, or the **ASCII glyphs** setting.
|
|
152
|
+
|
|
135
153
|
## Files
|
|
136
154
|
|
|
137
155
|
| Path | Purpose |
|
|
@@ -148,8 +166,8 @@ Config writes are atomic (temp + rename) so a crash mid-save can't corrupt the f
|
|
|
148
166
|
|
|
149
167
|
tokmon runs entirely on your machine and reads everything **read-only**:
|
|
150
168
|
|
|
151
|
-
- It never writes to any provider's data
|
|
152
|
-
- Credentials are read only to call each provider's **own official API** (Anthropic, ChatGPT backend, Cursor) for *your own* usage. Tokens are never logged, displayed, or sent anywhere else.
|
|
169
|
+
- It never writes to any provider's data — SQLite databases (Cursor, opencode) are opened strictly read-only.
|
|
170
|
+
- Credentials are read only to call each provider's **own official API** (Anthropic, ChatGPT backend, Cursor, GitHub, Google Cloud Code) for *your own* usage. Tokens are never logged, displayed, or sent anywhere else.
|
|
153
171
|
- The only outbound requests are to those provider APIs and the optional peak-pricing clock.
|
|
154
172
|
|
|
155
173
|
## How It Works
|
|
@@ -163,16 +181,16 @@ Cross-platform: macOS, Linux, Windows.
|
|
|
163
181
|
|
|
164
182
|
## Requirements
|
|
165
183
|
|
|
166
|
-
- Node.js 20+
|
|
167
|
-
- The CLIs/apps you want to track
|
|
168
|
-
-
|
|
184
|
+
- Node.js 20+ (**24+ recommended**)
|
|
185
|
+
- The CLIs/apps you want to track
|
|
186
|
+
- **SQLite** for the Cursor / opencode readers: on Node 24+ this uses the built-in `node:sqlite` — **nothing to install**. On Node 20–23 it falls back to the system `sqlite3` CLI (preinstalled on macOS; `apt install sqlite3` / `winget install sqlite` elsewhere).
|
|
169
187
|
|
|
170
188
|
## CI/CD
|
|
171
189
|
|
|
172
190
|
Publishes to npm and GitHub Packages via GitHub Actions on version tags:
|
|
173
191
|
|
|
174
192
|
```bash
|
|
175
|
-
git tag v0.
|
|
193
|
+
git tag v0.14.0 && git push --tags
|
|
176
194
|
```
|
|
177
195
|
|
|
178
196
|
## Author
|