@mai0313/vct 1.3.0 → 1.3.2
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 +131 -45
- package/README.zh-CN.md +130 -44
- package/README.zh-TW.md +130 -44
- package/binaries/linux-arm64-gnu/vibe_coding_tracker +0 -0
- package/binaries/linux-x64-gnu/vibe_coding_tracker +0 -0
- package/binaries/macos-arm64/vibe_coding_tracker +0 -0
- package/binaries/macos-x64/vibe_coding_tracker +0 -0
- package/binaries/windows-arm64/vibe_coding_tracker.exe +0 -0
- package/binaries/windows-x64/vibe_coding_tracker.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# Vibe Coding Tracker — AI Coding Assistant Usage Tracker
|
|
4
4
|
|
|
5
|
-
<img src="assets/social-preview.png" alt="Vibe Coding Tracker social preview" width="640">
|
|
6
|
-
|
|
7
5
|
[](https://crates.io/crates/vibe_coding_tracker)
|
|
8
6
|
[](https://crates.io/crates/vibe_coding_tracker)
|
|
9
7
|
[](https://www.npmjs.com/package/vibe-coding-tracker)
|
|
@@ -17,6 +15,8 @@
|
|
|
17
15
|
[](https://github.com/Mai0313/VibeCodingTracker)
|
|
18
16
|
[](https://github.com/Mai0313/VibeCodingTracker/pulls)
|
|
19
17
|
|
|
18
|
+
<img src="assets/social-preview.png" alt="Vibe Coding Tracker social preview" width="640">
|
|
19
|
+
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
**Track your AI coding costs in real-time.** Vibe Coding Tracker is a lightweight, high-performance CLI tool built in Rust that monitors and analyzes your Claude Code, Codex, Copilot, Gemini, and OpenCode usage — with detailed cost breakdowns, token statistics, and code operation insights, all while keeping the memory footprint minimal.
|
|
@@ -64,13 +64,13 @@ Automatically detects and processes logs from Claude Code, Codex, Copilot, Gemin
|
|
|
64
64
|
|
|
65
65
|
| Feature | Description |
|
|
66
66
|
| --------------------- | -------------------------------------------------------------------- |
|
|
67
|
-
| **Multi-Provider** | Claude Code, Codex, Copilot, and
|
|
67
|
+
| **Multi-Provider** | Claude Code, Codex, Copilot, Gemini, and OpenCode — all in one place |
|
|
68
68
|
| **Smart Pricing** | Fuzzy model matching + daily cache from LiteLLM |
|
|
69
69
|
| **4 Display Modes** | Interactive TUI, static table, plain text, and JSON |
|
|
70
70
|
| **Dual Analysis** | Token/cost stats (`usage`) + code operation stats (`analysis`) |
|
|
71
|
+
| **Live Quota Panels** | Live remaining quota for Claude, Codex, Copilot, and Cursor |
|
|
71
72
|
| **Ultra-Lightweight** | Under ~50 MB RSS in the TUI, streaming JSONL parse — built with Rust |
|
|
72
|
-
| **Live Updates** |
|
|
73
|
-
| **Efficient Caching** | Smart daily cache reduces API calls |
|
|
73
|
+
| **Live Updates** | Auto-refreshing dashboard (every 10s) with change highlighting |
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -107,6 +107,9 @@ npm install -g @mai0313/vibe-coding-tracker
|
|
|
107
107
|
pip install vibe_coding_tracker
|
|
108
108
|
# Or with uv
|
|
109
109
|
uv pip install vibe_coding_tracker
|
|
110
|
+
|
|
111
|
+
# Run without installing, straight from PyPI (uv)
|
|
112
|
+
uvx vibe_coding_tracker usage
|
|
110
113
|
```
|
|
111
114
|
|
|
112
115
|
#### Method 3: Install from crates.io
|
|
@@ -205,24 +208,69 @@ vct usage --json --daily
|
|
|
205
208
|
|
|
206
209
|
```
|
|
207
210
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
208
|
-
│ Model Input Output
|
|
211
|
+
│ Model Input Output Cache Read Cache Write Total Cost (USD) │
|
|
209
212
|
│ │
|
|
210
|
-
│ gemini-3.1-pro-preview 129K 10.3K
|
|
211
|
-
│ claude-haiku-4-5-20251001 5.57K 19.8K
|
|
212
|
-
│ claude-opus-4-
|
|
213
|
+
│ gemini-3.1-pro-preview 129K 10.3K 67.4K 0 207K $0.40 │
|
|
214
|
+
│ claude-haiku-4-5-20251001 5.57K 19.8K 4.63M 620K 5.27M $1.34 │
|
|
215
|
+
│ claude-opus-4-8 25.7K 179K 40.8M 2.57M 43.6M $77.59 │
|
|
213
216
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
214
217
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
215
|
-
│ Provider
|
|
218
|
+
│ Provider Tokens Cost │
|
|
216
219
|
│ │
|
|
217
|
-
│ Claude Code
|
|
218
|
-
│ Gemini
|
|
220
|
+
│ Claude Code 48.9M $78.93 │
|
|
221
|
+
│ Gemini 207K $0.40 │
|
|
219
222
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
220
223
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
221
|
-
│
|
|
224
|
+
│ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB │
|
|
222
225
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
223
226
|
↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
|
|
224
227
|
```
|
|
225
228
|
|
|
229
|
+
### Preview: Table & JSON (`vct usage`)
|
|
230
|
+
|
|
231
|
+
`--table` prints the same numbers as a static report with a per-provider summary; `--json` emits one enriched row per model (each with `cost_usd`) for scripting.
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
Token Usage Statistics
|
|
235
|
+
|
|
236
|
+
┌───────────────────────────┬─────────┬─────────┬─────────────┬─────────────┬──────────────┬────────────┐
|
|
237
|
+
│ Model ┆ Input ┆ Output ┆ Cache Read ┆ Cache Write ┆ Total Tokens ┆ Cost (USD) │
|
|
238
|
+
╞═══════════════════════════╪═════════╪═════════╪═════════════╪═════════════╪══════════════╪════════════╡
|
|
239
|
+
│ opencode/gemini-3.5-flash ┆ 19,421 ┆ 254 ┆ 0 ┆ 0 ┆ 19,675 ┆ $0.03 │
|
|
240
|
+
│ gpt-5.5 ┆ 242,227 ┆ 16,229 ┆ 2,406,912 ┆ 0 ┆ 2,665,368 ┆ $5.56 │
|
|
241
|
+
│ claude-opus-4-8 ┆ 401,937 ┆ 936,186 ┆ 138,099,926 ┆ 6,057,836 ┆ 145,495,885 ┆ $151.29 │
|
|
242
|
+
│ TOTAL ┆ 663,585 ┆ 952,669 ┆ 140,506,838 ┆ 6,057,836 ┆ 148,180,928 ┆ $156.88 │
|
|
243
|
+
└───────────────────────────┴─────────┴─────────┴─────────────┴─────────────┴──────────────┴────────────┘
|
|
244
|
+
|
|
245
|
+
Totals (by Provider)
|
|
246
|
+
|
|
247
|
+
┌───────────────┬─────────────┬─────────┐
|
|
248
|
+
│ Provider ┆ Tokens ┆ Cost │
|
|
249
|
+
╞═══════════════╪═════════════╪═════════╡
|
|
250
|
+
│ Claude Code ┆ 145,495,885 ┆ $151.29 │
|
|
251
|
+
│ OpenAI Codex ┆ 2,665,368 ┆ $5.56 │
|
|
252
|
+
│ OpenCode ┆ 19,675 ┆ $0.03 │
|
|
253
|
+
│ All Providers ┆ 148,180,928 ┆ $156.88 │
|
|
254
|
+
└───────────────┴─────────────┴─────────┘
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
// vct usage --json (one model shown; rows are sorted by cost)
|
|
259
|
+
[
|
|
260
|
+
{
|
|
261
|
+
"model": "claude-opus-4-8",
|
|
262
|
+
"cost_usd": 151.29,
|
|
263
|
+
"usage": {
|
|
264
|
+
"input_tokens": 401937,
|
|
265
|
+
"output_tokens": 936186,
|
|
266
|
+
"cache_read_input_tokens": 138099926,
|
|
267
|
+
"cache_creation_input_tokens": 6057836,
|
|
268
|
+
"reasoning_output_tokens": 0
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
```
|
|
273
|
+
|
|
226
274
|
### What It Scans
|
|
227
275
|
|
|
228
276
|
The tool automatically scans these directories:
|
|
@@ -240,17 +288,17 @@ The tool automatically scans these directories:
|
|
|
240
288
|
```
|
|
241
289
|
┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
|
|
242
290
|
│ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
|
|
243
|
-
│ 5h ▰▱▱▱▱
|
|
244
|
-
│ 7d
|
|
245
|
-
│
|
|
291
|
+
│ 5h ▰▱▱▱▱ 13% ↻ 1h42m││ 5h ▰▰▱▱▱ 33% ↻ 12m ││ prem ▰▱▱▱▱ 3% ↻ 24d ││ total ▰▱▱▱▱ 6% ↻ 16d │
|
|
292
|
+
│ 7d ▰▰▰▱▱ 58% ↻ 1d23h││ 7d ▰▰▱▱▱ 36% ↻ 1h54m││ reqs ▰▱▱▱▱ 45/1500 ││ auto ▱▱▱▱▱ 0% ↻ 16d │
|
|
293
|
+
│ Fable ▰▰▰▰▱ 79% ↻ 1d23h││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 56% ↻ 16d │
|
|
246
294
|
│ Balance: - $0.00 used ││ updated just now ││ ││ updated just now │
|
|
247
295
|
└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
|
|
248
296
|
```
|
|
249
297
|
|
|
250
298
|
- **Claude** — plan tier, 5-hour, weekly, and per-model weekly usage from the official OAuth usage API (`GET /api/oauth/usage`), read from `~/.claude/.credentials.json`, plus your credit balance. Polled about once a minute to stay under the endpoint's rate limit; a red `LIMIT` flag appears in the title when a cap is hit. The per-model weekly row is best-effort and simply hides when that scope is not returned.
|
|
251
299
|
- **Codex** — plan tier, 5-hour and weekly usage, and credit balance from the ChatGPT backend (`wham/usage`) using `~/.codex/auth.json` (with approximate remaining messages / spend cap when applicable); falls back to the newest `rate_limits` in your Codex session logs when the API is unavailable (the title shows `Codex` vs `Codex (session)`).
|
|
252
|
-
- **Copilot** — plan tier
|
|
253
|
-
- **Cursor** — plan tier, total / auto / API
|
|
300
|
+
- **Copilot** — plan tier plus your premium-request quota, shown as two gauges: percent used and the used / total request count (e.g. `45/1500`), from GitHub's Copilot API (`GET /copilot_internal/user`), read from `~/.copilot/config.json`. The request impersonates the Copilot CLI. The token is long-lived, so there is no refresh; a `401` / `403` shows a `run: copilot login` hint.
|
|
301
|
+
- **Cursor** — plan tier, total / auto / API percent **used**, and on-demand spend from cursor.com (`GET /api/usage-summary`), using the session token in `~/.config/cursor/auth.json`. Refresh is reactive: vct re-reads the file each poll and uses the token while it is valid, since the official Cursor client keeps it fresh.
|
|
254
302
|
|
|
255
303
|
**Automatic token refresh.** For Claude and Codex, when a token is near expiry or rejected, vct refreshes it and writes the new token back to the provider's own credential file (in that CLI's exact format), so a token is reused across checks rather than refreshed every time. If a refresh cannot proceed, the panel shows a `run: <provider> auth login` hint instead of breaking. Copilot (long-lived token) and Cursor (kept fresh by its own client) are read-only — vct never writes their credential files.
|
|
256
304
|
|
|
@@ -309,25 +357,58 @@ vct analysis --output today.json --daily
|
|
|
309
357
|
### Preview: Interactive Dashboard (`vct analysis`)
|
|
310
358
|
|
|
311
359
|
```
|
|
312
|
-
|
|
313
|
-
│ Model
|
|
314
|
-
│
|
|
315
|
-
│ claude-haiku-4-5-20251001
|
|
316
|
-
│ claude-opus-4-
|
|
317
|
-
│ gemini-3.1-pro-preview
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
│ Provider
|
|
321
|
-
│
|
|
322
|
-
│ Claude Code
|
|
323
|
-
│ Gemini
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
│
|
|
327
|
-
|
|
360
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
361
|
+
│ Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write │
|
|
362
|
+
│ │
|
|
363
|
+
│ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 0 │
|
|
364
|
+
│ claude-opus-4-8 1.28K 13.3K 1.58K 82 146 209 18 62 │
|
|
365
|
+
│ gemini-3.1-pro-preview 0 0 0 0 0 0 0 0 │
|
|
366
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
367
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
368
|
+
│ Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
|
|
369
|
+
│ │
|
|
370
|
+
│ Claude Code 1.28K 13.3K 1.58K 125 146 268 18 62 3 │
|
|
371
|
+
│ Gemini 0 0 0 0 0 0 0 0 1 │
|
|
372
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
373
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
374
|
+
│ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB │
|
|
375
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
328
376
|
↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
|
|
329
377
|
```
|
|
330
378
|
|
|
379
|
+
### Preview: Table & JSON (`vct analysis`)
|
|
380
|
+
|
|
381
|
+
`--table` renders the per-model breakdown plus a per-provider summary (with an Active Days column); `--json` emits one aggregated row per model.
|
|
382
|
+
|
|
383
|
+
```text
|
|
384
|
+
Analysis Statistics
|
|
385
|
+
|
|
386
|
+
┌─────────────────┬────────────┬────────────┬─────────────┬──────┬──────┬──────┬───────────┬───────┐
|
|
387
|
+
│ Model ┆ Edit Lines ┆ Read Lines ┆ Write Lines ┆ Bash ┆ Edit ┆ Read ┆ TodoWrite ┆ Write │
|
|
388
|
+
╞═════════════════╪════════════╪════════════╪═════════════╪══════╪══════╪══════╪═══════════╪═══════╡
|
|
389
|
+
│ gpt-5.5 ┆ 0 ┆ 3,087 ┆ 0 ┆ 25 ┆ 0 ┆ 10 ┆ 0 ┆ 0 │
|
|
390
|
+
│ claude-opus-4-8 ┆ 1,493 ┆ 15,564 ┆ 970 ┆ 123 ┆ 134 ┆ 144 ┆ 0 ┆ 12 │
|
|
391
|
+
│ TOTAL ┆ 1,493 ┆ 18,651 ┆ 970 ┆ 148 ┆ 134 ┆ 154 ┆ 0 ┆ 12 │
|
|
392
|
+
└─────────────────┴────────────┴────────────┴─────────────┴──────┴──────┴──────┴───────────┴───────┘
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
// vct analysis --json (one model shown)
|
|
397
|
+
[
|
|
398
|
+
{
|
|
399
|
+
"model": "claude-opus-4-8",
|
|
400
|
+
"editLines": 1493,
|
|
401
|
+
"readLines": 15564,
|
|
402
|
+
"writeLines": 970,
|
|
403
|
+
"bashCount": 124,
|
|
404
|
+
"editCount": 134,
|
|
405
|
+
"readCount": 144,
|
|
406
|
+
"todoWriteCount": 0,
|
|
407
|
+
"writeCount": 12
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
```
|
|
411
|
+
|
|
331
412
|
---
|
|
332
413
|
|
|
333
414
|
## Update Command
|
|
@@ -352,9 +433,9 @@ vct update --force
|
|
|
352
433
|
### Preview (`vct update --check`)
|
|
353
434
|
|
|
354
435
|
```
|
|
355
|
-
Current version:
|
|
436
|
+
Current version: v1.3.0
|
|
356
437
|
Checking for latest release...
|
|
357
|
-
Latest version:
|
|
438
|
+
Latest version: v1.3.0 — you are up to date!
|
|
358
439
|
```
|
|
359
440
|
|
|
360
441
|
---
|
|
@@ -369,6 +450,14 @@ vct version --text # One-field-per-line, script-friendly
|
|
|
369
450
|
vct version --json # Machine-readable JSON
|
|
370
451
|
```
|
|
371
452
|
|
|
453
|
+
```text
|
|
454
|
+
┌───────────────┬──────────┐
|
|
455
|
+
│ Version ┆ 1.3.0 │
|
|
456
|
+
│ Rust Version ┆ 1.96.0 │
|
|
457
|
+
│ Cargo Version ┆ 1.96.0 │
|
|
458
|
+
└───────────────┴──────────┘
|
|
459
|
+
```
|
|
460
|
+
|
|
372
461
|
The binary version is produced at build time by `build.rs` from `git describe`, so development builds include commit count + short SHA + `dirty` suffix when applicable.
|
|
373
462
|
|
|
374
463
|
---
|
|
@@ -392,6 +481,12 @@ The binary version is produced at build time by `build.rs` from `git describe`,
|
|
|
392
481
|
4. **Fuzzy (AI-powered)**: Uses Jaro-Winkler similarity (70% threshold)
|
|
393
482
|
5. **Fallback**: Shows $0.00 if no match found
|
|
394
483
|
|
|
484
|
+
### Cost Details
|
|
485
|
+
|
|
486
|
+
- **Beyond tokens**: Claude web-search tool calls (`server_tool_use.web_search_requests`) are billed per query on top of the token cost; every other model's per-query charge is $0.
|
|
487
|
+
- **OpenCode**: a novel model name is priced from its tokens only on an **exact** LiteLLM match; with no exact match, vct trusts the assistant message's own stored cost instead of guessing from a loosely-similar name.
|
|
488
|
+
- **Cache is raw**: the daily cache stores the filtered upstream LiteLLM JSON (not a derived shape), so tiered / batch pricing stays available without re-fetching, and a small in-process LRU keeps repeated lookups cheap during a TUI refresh.
|
|
489
|
+
|
|
395
490
|
---
|
|
396
491
|
|
|
397
492
|
## Docker Support
|
|
@@ -399,13 +494,4 @@ The binary version is produced at build time by `build.rs` from `git describe`,
|
|
|
399
494
|
```bash
|
|
400
495
|
# Build image
|
|
401
496
|
docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
|
|
402
|
-
|
|
403
|
-
# Run with your sessions
|
|
404
|
-
docker run --rm \
|
|
405
|
-
-v ~/.claude:/root/.claude \
|
|
406
|
-
-v ~/.codex:/root/.codex \
|
|
407
|
-
-v ~/.copilot:/root/.copilot \
|
|
408
|
-
-v ~/.gemini:/root/.gemini \
|
|
409
|
-
-v ~/.local/share/opencode:/root/.local/share/opencode \
|
|
410
|
-
vibe_coding_tracker:latest usage
|
|
411
497
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# Vibe Coding Tracker — AI 编程助手使用量追踪器
|
|
4
4
|
|
|
5
|
-
<img src="assets/social-preview.png" alt="Vibe Coding Tracker social preview" width="640">
|
|
6
|
-
|
|
7
5
|
[](https://crates.io/crates/vibe_coding_tracker)
|
|
8
6
|
[](https://crates.io/crates/vibe_coding_tracker)
|
|
9
7
|
[](https://www.npmjs.com/package/vibe-coding-tracker)
|
|
@@ -17,6 +15,8 @@
|
|
|
17
15
|
[](https://github.com/Mai0313/VibeCodingTracker)
|
|
18
16
|
[](https://github.com/Mai0313/VibeCodingTracker/pulls)
|
|
19
17
|
|
|
18
|
+
<img src="assets/social-preview.png" alt="Vibe Coding Tracker social preview" width="640">
|
|
19
|
+
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
**实时追踪你的 AI 编程开销。** Vibe Coding Tracker 是一款基于 Rust 构建的轻量级高性能 CLI 工具,用于监控和分析你在 Claude Code、Codex、Copilot、Gemini 和 OpenCode 上的使用情况——提供详细的费用明细、token 统计和代码操作洞察,同时保持极低的内存占用。
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
| **智能定价** | 模糊模型匹配 + 从 LiteLLM 每日缓存更新 |
|
|
69
69
|
| **4 种显示模式** | 交互式 TUI、静态表格、纯文本和 JSON |
|
|
70
70
|
| **双维度分析** | token/费用统计(`usage`)+ 代码操作统计(`analysis`) |
|
|
71
|
+
| **实时额度面板** | Claude、Codex、Copilot 和 Cursor 的实时剩余额度 |
|
|
71
72
|
| **超轻量级** | TUI 常驻内存 50 MB 以内、流式 JSONL 解析——基于 Rust 构建 |
|
|
72
|
-
| **实时更新** |
|
|
73
|
-
| **高效缓存** | 智能每日缓存,减少 API 调用次数 |
|
|
73
|
+
| **实时更新** | 面板自动刷新(每 10 秒),并高亮变化 |
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -107,6 +107,9 @@ npm install -g @mai0313/vibe-coding-tracker
|
|
|
107
107
|
pip install vibe_coding_tracker
|
|
108
108
|
# Or with uv
|
|
109
109
|
uv pip install vibe_coding_tracker
|
|
110
|
+
|
|
111
|
+
# Run without installing, straight from PyPI (uv)
|
|
112
|
+
uvx vibe_coding_tracker usage
|
|
110
113
|
```
|
|
111
114
|
|
|
112
115
|
#### 方式三:通过 crates.io 安装
|
|
@@ -205,24 +208,69 @@ vct usage --json --daily
|
|
|
205
208
|
|
|
206
209
|
```
|
|
207
210
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
208
|
-
│ Model Input Output
|
|
211
|
+
│ Model Input Output Cache Read Cache Write Total Cost (USD) │
|
|
209
212
|
│ │
|
|
210
|
-
│ gemini-3.1-pro-preview 129K 10.3K
|
|
211
|
-
│ claude-haiku-4-5-20251001 5.57K 19.8K
|
|
212
|
-
│ claude-opus-4-
|
|
213
|
+
│ gemini-3.1-pro-preview 129K 10.3K 67.4K 0 207K $0.40 │
|
|
214
|
+
│ claude-haiku-4-5-20251001 5.57K 19.8K 4.63M 620K 5.27M $1.34 │
|
|
215
|
+
│ claude-opus-4-8 25.7K 179K 40.8M 2.57M 43.6M $77.59 │
|
|
213
216
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
214
217
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
215
|
-
│ Provider
|
|
218
|
+
│ Provider Tokens Cost │
|
|
216
219
|
│ │
|
|
217
|
-
│ Claude Code
|
|
218
|
-
│ Gemini
|
|
220
|
+
│ Claude Code 48.9M $78.93 │
|
|
221
|
+
│ Gemini 207K $0.40 │
|
|
219
222
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
220
223
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
221
|
-
│
|
|
224
|
+
│ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB │
|
|
222
225
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
223
226
|
↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
|
|
224
227
|
```
|
|
225
228
|
|
|
229
|
+
### 预览:表格与 JSON(`vct usage`)
|
|
230
|
+
|
|
231
|
+
`--table` 会以静态报表的形式打印相同的数字,并附带按 provider 的汇总;`--json` 则为每个 model 输出一行富化数据(各自带有 `cost_usd`),方便脚本处理。
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
Token Usage Statistics
|
|
235
|
+
|
|
236
|
+
┌───────────────────────────┬─────────┬─────────┬─────────────┬─────────────┬──────────────┬────────────┐
|
|
237
|
+
│ Model ┆ Input ┆ Output ┆ Cache Read ┆ Cache Write ┆ Total Tokens ┆ Cost (USD) │
|
|
238
|
+
╞═══════════════════════════╪═════════╪═════════╪═════════════╪═════════════╪══════════════╪════════════╡
|
|
239
|
+
│ opencode/gemini-3.5-flash ┆ 19,421 ┆ 254 ┆ 0 ┆ 0 ┆ 19,675 ┆ $0.03 │
|
|
240
|
+
│ gpt-5.5 ┆ 242,227 ┆ 16,229 ┆ 2,406,912 ┆ 0 ┆ 2,665,368 ┆ $5.56 │
|
|
241
|
+
│ claude-opus-4-8 ┆ 401,937 ┆ 936,186 ┆ 138,099,926 ┆ 6,057,836 ┆ 145,495,885 ┆ $151.29 │
|
|
242
|
+
│ TOTAL ┆ 663,585 ┆ 952,669 ┆ 140,506,838 ┆ 6,057,836 ┆ 148,180,928 ┆ $156.88 │
|
|
243
|
+
└───────────────────────────┴─────────┴─────────┴─────────────┴─────────────┴──────────────┴────────────┘
|
|
244
|
+
|
|
245
|
+
Totals (by Provider)
|
|
246
|
+
|
|
247
|
+
┌───────────────┬─────────────┬─────────┐
|
|
248
|
+
│ Provider ┆ Tokens ┆ Cost │
|
|
249
|
+
╞═══════════════╪═════════════╪═════════╡
|
|
250
|
+
│ Claude Code ┆ 145,495,885 ┆ $151.29 │
|
|
251
|
+
│ OpenAI Codex ┆ 2,665,368 ┆ $5.56 │
|
|
252
|
+
│ OpenCode ┆ 19,675 ┆ $0.03 │
|
|
253
|
+
│ All Providers ┆ 148,180,928 ┆ $156.88 │
|
|
254
|
+
└───────────────┴─────────────┴─────────┘
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
// vct usage --json (one model shown; rows are sorted by cost)
|
|
259
|
+
[
|
|
260
|
+
{
|
|
261
|
+
"model": "claude-opus-4-8",
|
|
262
|
+
"cost_usd": 151.29,
|
|
263
|
+
"usage": {
|
|
264
|
+
"input_tokens": 401937,
|
|
265
|
+
"output_tokens": 936186,
|
|
266
|
+
"cache_read_input_tokens": 138099926,
|
|
267
|
+
"cache_creation_input_tokens": 6057836,
|
|
268
|
+
"reasoning_output_tokens": 0
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
```
|
|
273
|
+
|
|
226
274
|
### 扫描范围
|
|
227
275
|
|
|
228
276
|
该工具会自动扫描以下目录:
|
|
@@ -240,17 +288,17 @@ vct usage --json --daily
|
|
|
240
288
|
```
|
|
241
289
|
┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
|
|
242
290
|
│ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
|
|
243
|
-
│ 5h ▰▱▱▱▱
|
|
244
|
-
│ 7d
|
|
245
|
-
│
|
|
291
|
+
│ 5h ▰▱▱▱▱ 13% ↻ 1h42m││ 5h ▰▰▱▱▱ 33% ↻ 12m ││ prem ▰▱▱▱▱ 3% ↻ 24d ││ total ▰▱▱▱▱ 6% ↻ 16d │
|
|
292
|
+
│ 7d ▰▰▰▱▱ 58% ↻ 1d23h││ 7d ▰▰▱▱▱ 36% ↻ 1h54m││ reqs ▰▱▱▱▱ 45/1500 ││ auto ▱▱▱▱▱ 0% ↻ 16d │
|
|
293
|
+
│ Fable ▰▰▰▰▱ 79% ↻ 1d23h││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 56% ↻ 16d │
|
|
246
294
|
│ Balance: - $0.00 used ││ updated just now ││ ││ updated just now │
|
|
247
295
|
└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
|
|
248
296
|
```
|
|
249
297
|
|
|
250
298
|
- **Claude** — 方案类型、5 小时、每周以及单模型每周用量,来自官方 OAuth 用量 API(`GET /api/oauth/usage`),从 `~/.claude/.credentials.json` 读取,并显示额度余额。约每分钟轮询一次以避开该端点的速率限制;触及上限时标题会出现红色 `LIMIT` 标记。单模型每周那一行属于尽力而为,未返回该范围时就自动隐藏。
|
|
251
299
|
- **Codex** — 套餐类型、5 小时和每周用量以及额度余额,使用 `~/.codex/auth.json` 从 ChatGPT 后端(`wham/usage`)获取(在适用时显示大致剩余讯息数 / 消费上限);API 不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `Codex` 或 `Codex (session)`)。
|
|
252
|
-
- **Copilot** —
|
|
253
|
-
- **Cursor** — 方案类型、total / auto / API
|
|
300
|
+
- **Copilot** — 方案类型,以及你的 premium 请求额度,以两个进度条呈现:已用百分比,以及已用 / 总量的请求数(例如 `45/1500`),来自 GitHub 的 Copilot API(`GET /copilot_internal/user`),从 `~/.copilot/config.json` 读取。该请求会模拟 Copilot CLI。token 为长期有效,因此不需要刷新;遇到 `401` / `403` 时会显示 `run: copilot login` 提示。
|
|
301
|
+
- **Cursor** — 方案类型、total / auto / API 已用百分比,以及按需消费,来自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被动式的:vct 每次轮询都会重新读取该文件,并在 token 有效期内使用它,因为官方 Cursor 客户端会让它保持最新。
|
|
254
302
|
|
|
255
303
|
**自动刷新 token。** 对 Claude 和 Codex,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式),因此 token 会在多次检查之间复用,而不是每次都重新刷新。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。Copilot(长期有效的 token)和 Cursor(由其自身客户端保持最新)为只读——vct 从不写入它们的凭证文件。
|
|
256
304
|
|
|
@@ -309,25 +357,58 @@ vct analysis --output today.json --daily
|
|
|
309
357
|
### 预览:交互式面板(`vct analysis`)
|
|
310
358
|
|
|
311
359
|
```
|
|
312
|
-
|
|
313
|
-
│ Model
|
|
314
|
-
│
|
|
315
|
-
│ claude-haiku-4-5-20251001
|
|
316
|
-
│ claude-opus-4-
|
|
317
|
-
│ gemini-3.1-pro-preview
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
│ Provider
|
|
321
|
-
│
|
|
322
|
-
│ Claude Code
|
|
323
|
-
│ Gemini
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
│
|
|
327
|
-
|
|
360
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
361
|
+
│ Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write │
|
|
362
|
+
│ │
|
|
363
|
+
│ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 0 │
|
|
364
|
+
│ claude-opus-4-8 1.28K 13.3K 1.58K 82 146 209 18 62 │
|
|
365
|
+
│ gemini-3.1-pro-preview 0 0 0 0 0 0 0 0 │
|
|
366
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
367
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
368
|
+
│ Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
|
|
369
|
+
│ │
|
|
370
|
+
│ Claude Code 1.28K 13.3K 1.58K 125 146 268 18 62 3 │
|
|
371
|
+
│ Gemini 0 0 0 0 0 0 0 0 1 │
|
|
372
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
373
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
374
|
+
│ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB │
|
|
375
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
328
376
|
↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
|
|
329
377
|
```
|
|
330
378
|
|
|
379
|
+
### 预览:表格与 JSON(`vct analysis`)
|
|
380
|
+
|
|
381
|
+
`--table` 会渲染按 model 细分的数据,并附带按 provider 的汇总(含 Active Days 列);`--json` 则为每个 model 输出一行聚合数据。
|
|
382
|
+
|
|
383
|
+
```text
|
|
384
|
+
Analysis Statistics
|
|
385
|
+
|
|
386
|
+
┌─────────────────┬────────────┬────────────┬─────────────┬──────┬──────┬──────┬───────────┬───────┐
|
|
387
|
+
│ Model ┆ Edit Lines ┆ Read Lines ┆ Write Lines ┆ Bash ┆ Edit ┆ Read ┆ TodoWrite ┆ Write │
|
|
388
|
+
╞═════════════════╪════════════╪════════════╪═════════════╪══════╪══════╪══════╪═══════════╪═══════╡
|
|
389
|
+
│ gpt-5.5 ┆ 0 ┆ 3,087 ┆ 0 ┆ 25 ┆ 0 ┆ 10 ┆ 0 ┆ 0 │
|
|
390
|
+
│ claude-opus-4-8 ┆ 1,493 ┆ 15,564 ┆ 970 ┆ 123 ┆ 134 ┆ 144 ┆ 0 ┆ 12 │
|
|
391
|
+
│ TOTAL ┆ 1,493 ┆ 18,651 ┆ 970 ┆ 148 ┆ 134 ┆ 154 ┆ 0 ┆ 12 │
|
|
392
|
+
└─────────────────┴────────────┴────────────┴─────────────┴──────┴──────┴──────┴───────────┴───────┘
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
// vct analysis --json (one model shown)
|
|
397
|
+
[
|
|
398
|
+
{
|
|
399
|
+
"model": "claude-opus-4-8",
|
|
400
|
+
"editLines": 1493,
|
|
401
|
+
"readLines": 15564,
|
|
402
|
+
"writeLines": 970,
|
|
403
|
+
"bashCount": 124,
|
|
404
|
+
"editCount": 134,
|
|
405
|
+
"readCount": 144,
|
|
406
|
+
"todoWriteCount": 0,
|
|
407
|
+
"writeCount": 12
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
```
|
|
411
|
+
|
|
331
412
|
---
|
|
332
413
|
|
|
333
414
|
## Update 命令
|
|
@@ -352,9 +433,9 @@ vct update --force
|
|
|
352
433
|
### 预览(`vct update --check`)
|
|
353
434
|
|
|
354
435
|
```
|
|
355
|
-
Current version:
|
|
436
|
+
Current version: v1.3.0
|
|
356
437
|
Checking for latest release...
|
|
357
|
-
Latest version:
|
|
438
|
+
Latest version: v1.3.0 — you are up to date!
|
|
358
439
|
```
|
|
359
440
|
|
|
360
441
|
---
|
|
@@ -369,6 +450,14 @@ vct version --text # 每行一个字段,适合脚本
|
|
|
369
450
|
vct version --json # 机读 JSON
|
|
370
451
|
```
|
|
371
452
|
|
|
453
|
+
```text
|
|
454
|
+
┌───────────────┬──────────┐
|
|
455
|
+
│ Version ┆ 1.3.0 │
|
|
456
|
+
│ Rust Version ┆ 1.96.0 │
|
|
457
|
+
│ Cargo Version ┆ 1.96.0 │
|
|
458
|
+
└───────────────┴──────────┘
|
|
459
|
+
```
|
|
460
|
+
|
|
372
461
|
Binary version 由 `build.rs` 在编译期通过 `git describe` 写入,开发版本会附带 commit 计数、short SHA 与 `dirty` 后缀。
|
|
373
462
|
|
|
374
463
|
---
|
|
@@ -392,6 +481,12 @@ Binary version 由 `build.rs` 在编译期通过 `git describe` 写入,开发
|
|
|
392
481
|
4. **模糊匹配(AI 驱动)**:使用 Jaro-Winkler 相似度算法(70% 阈值)
|
|
393
482
|
5. **兜底方案**:如果未找到匹配,显示 $0.00
|
|
394
483
|
|
|
484
|
+
### 费用细节
|
|
485
|
+
|
|
486
|
+
- **不止 token**:Claude 的 web-search 工具调用(`server_tool_use.web_search_requests`)会在 token 费用之外按每次查询计费;其他所有 model 的每次查询费用均为 $0。
|
|
487
|
+
- **OpenCode**:只有在 LiteLLM 上**精确**匹配时,才会根据 token 为一个全新的 model 名称定价;若没有精确匹配,vct 会信任该 assistant message 自身存储的费用,而不是从一个只是大致相似的名称去猜测。
|
|
488
|
+
- **缓存为原始数据**:每日缓存存储的是经过筛选的上游 LiteLLM JSON(而非派生后的结构),因此无需重新获取即可保留分层 / 批量定价;此外还有一个小型的进程内 LRU,让 TUI 刷新期间的重复查询保持低开销。
|
|
489
|
+
|
|
395
490
|
---
|
|
396
491
|
|
|
397
492
|
## Docker 支持
|
|
@@ -399,13 +494,4 @@ Binary version 由 `build.rs` 在编译期通过 `git describe` 写入,开发
|
|
|
399
494
|
```bash
|
|
400
495
|
# Build image
|
|
401
496
|
docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
|
|
402
|
-
|
|
403
|
-
# Run with your sessions
|
|
404
|
-
docker run --rm \
|
|
405
|
-
-v ~/.claude:/root/.claude \
|
|
406
|
-
-v ~/.codex:/root/.codex \
|
|
407
|
-
-v ~/.copilot:/root/.copilot \
|
|
408
|
-
-v ~/.gemini:/root/.gemini \
|
|
409
|
-
-v ~/.local/share/opencode:/root/.local/share/opencode \
|
|
410
|
-
vibe_coding_tracker:latest usage
|
|
411
497
|
```
|
package/README.zh-TW.md
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
# Vibe Coding Tracker — AI 程式設計助手使用量追蹤器
|
|
4
4
|
|
|
5
|
-
<img src="assets/social-preview.png" alt="Vibe Coding Tracker social preview" width="640">
|
|
6
|
-
|
|
7
5
|
[](https://crates.io/crates/vibe_coding_tracker)
|
|
8
6
|
[](https://crates.io/crates/vibe_coding_tracker)
|
|
9
7
|
[](https://www.npmjs.com/package/vibe-coding-tracker)
|
|
@@ -17,6 +15,8 @@
|
|
|
17
15
|
[](https://github.com/Mai0313/VibeCodingTracker)
|
|
18
16
|
[](https://github.com/Mai0313/VibeCodingTracker/pulls)
|
|
19
17
|
|
|
18
|
+
<img src="assets/social-preview.png" alt="Vibe Coding Tracker social preview" width="640">
|
|
19
|
+
|
|
20
20
|
</div>
|
|
21
21
|
|
|
22
22
|
**即時追蹤你的 AI 程式設計花費。** Vibe Coding Tracker 是一款以 Rust 打造的輕量、高效能 CLI 工具,能監控與分析你在 Claude Code、Codex、Copilot、Gemini 及 OpenCode 的使用狀況——提供詳細的費用明細、token 統計資料與程式碼操作分析,同時維持極低的記憶體使用量。
|
|
@@ -68,9 +68,9 @@
|
|
|
68
68
|
| **智慧定價** | 模糊模型比對 + 每日從 LiteLLM cache 更新 |
|
|
69
69
|
| **4 種顯示模式** | 互動式 TUI、靜態表格、純文字及 JSON |
|
|
70
70
|
| **雙重分析** | Token / 費用統計(`usage`)+ 程式碼操作統計(`analysis`) |
|
|
71
|
+
| **即時額度面板** | 即時顯示 Claude、Codex、Copilot 與 Cursor 的剩餘額度 |
|
|
71
72
|
| **超輕量** | TUI 常駐記憶體 ~50 MB 以內、串流 JSONL 解析——以 Rust 打造 |
|
|
72
|
-
| **即時更新** |
|
|
73
|
-
| **高效快取** | 智慧每日 cache 減少 API 呼叫次數 |
|
|
73
|
+
| **即時更新** | 每 10 秒自動刷新的儀表板並突顯變更 |
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -107,6 +107,9 @@ npm install -g @mai0313/vibe-coding-tracker
|
|
|
107
107
|
pip install vibe_coding_tracker
|
|
108
108
|
# Or with uv
|
|
109
109
|
uv pip install vibe_coding_tracker
|
|
110
|
+
|
|
111
|
+
# Run without installing, straight from PyPI (uv)
|
|
112
|
+
uvx vibe_coding_tracker usage
|
|
110
113
|
```
|
|
111
114
|
|
|
112
115
|
#### 方法三:透過 crates.io 安裝
|
|
@@ -205,24 +208,69 @@ vct usage --json --daily
|
|
|
205
208
|
|
|
206
209
|
```
|
|
207
210
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
208
|
-
│ Model Input Output
|
|
211
|
+
│ Model Input Output Cache Read Cache Write Total Cost (USD) │
|
|
209
212
|
│ │
|
|
210
|
-
│ gemini-3.1-pro-preview 129K 10.3K
|
|
211
|
-
│ claude-haiku-4-5-20251001 5.57K 19.8K
|
|
212
|
-
│ claude-opus-4-
|
|
213
|
+
│ gemini-3.1-pro-preview 129K 10.3K 67.4K 0 207K $0.40 │
|
|
214
|
+
│ claude-haiku-4-5-20251001 5.57K 19.8K 4.63M 620K 5.27M $1.34 │
|
|
215
|
+
│ claude-opus-4-8 25.7K 179K 40.8M 2.57M 43.6M $77.59 │
|
|
213
216
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
214
217
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
215
|
-
│ Provider
|
|
218
|
+
│ Provider Tokens Cost │
|
|
216
219
|
│ │
|
|
217
|
-
│ Claude Code
|
|
218
|
-
│ Gemini
|
|
220
|
+
│ Claude Code 48.9M $78.93 │
|
|
221
|
+
│ Gemini 207K $0.40 │
|
|
219
222
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
220
223
|
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
221
|
-
│
|
|
224
|
+
│ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB │
|
|
222
225
|
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
223
226
|
↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
|
|
224
227
|
```
|
|
225
228
|
|
|
229
|
+
### 預覽:表格與 JSON(`vct usage`)
|
|
230
|
+
|
|
231
|
+
`--table` 會以靜態報表印出相同的數字,並附上每個供應商的彙總;`--json` 則為每個 model 輸出一列富化資料(各自帶有 `cost_usd`),方便腳本處理。
|
|
232
|
+
|
|
233
|
+
```text
|
|
234
|
+
Token Usage Statistics
|
|
235
|
+
|
|
236
|
+
┌───────────────────────────┬─────────┬─────────┬─────────────┬─────────────┬──────────────┬────────────┐
|
|
237
|
+
│ Model ┆ Input ┆ Output ┆ Cache Read ┆ Cache Write ┆ Total Tokens ┆ Cost (USD) │
|
|
238
|
+
╞═══════════════════════════╪═════════╪═════════╪═════════════╪═════════════╪══════════════╪════════════╡
|
|
239
|
+
│ opencode/gemini-3.5-flash ┆ 19,421 ┆ 254 ┆ 0 ┆ 0 ┆ 19,675 ┆ $0.03 │
|
|
240
|
+
│ gpt-5.5 ┆ 242,227 ┆ 16,229 ┆ 2,406,912 ┆ 0 ┆ 2,665,368 ┆ $5.56 │
|
|
241
|
+
│ claude-opus-4-8 ┆ 401,937 ┆ 936,186 ┆ 138,099,926 ┆ 6,057,836 ┆ 145,495,885 ┆ $151.29 │
|
|
242
|
+
│ TOTAL ┆ 663,585 ┆ 952,669 ┆ 140,506,838 ┆ 6,057,836 ┆ 148,180,928 ┆ $156.88 │
|
|
243
|
+
└───────────────────────────┴─────────┴─────────┴─────────────┴─────────────┴──────────────┴────────────┘
|
|
244
|
+
|
|
245
|
+
Totals (by Provider)
|
|
246
|
+
|
|
247
|
+
┌───────────────┬─────────────┬─────────┐
|
|
248
|
+
│ Provider ┆ Tokens ┆ Cost │
|
|
249
|
+
╞═══════════════╪═════════════╪═════════╡
|
|
250
|
+
│ Claude Code ┆ 145,495,885 ┆ $151.29 │
|
|
251
|
+
│ OpenAI Codex ┆ 2,665,368 ┆ $5.56 │
|
|
252
|
+
│ OpenCode ┆ 19,675 ┆ $0.03 │
|
|
253
|
+
│ All Providers ┆ 148,180,928 ┆ $156.88 │
|
|
254
|
+
└───────────────┴─────────────┴─────────┘
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
```json
|
|
258
|
+
// vct usage --json (one model shown; rows are sorted by cost)
|
|
259
|
+
[
|
|
260
|
+
{
|
|
261
|
+
"model": "claude-opus-4-8",
|
|
262
|
+
"cost_usd": 151.29,
|
|
263
|
+
"usage": {
|
|
264
|
+
"input_tokens": 401937,
|
|
265
|
+
"output_tokens": 936186,
|
|
266
|
+
"cache_read_input_tokens": 138099926,
|
|
267
|
+
"cache_creation_input_tokens": 6057836,
|
|
268
|
+
"reasoning_output_tokens": 0
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
```
|
|
273
|
+
|
|
226
274
|
### 掃描範圍
|
|
227
275
|
|
|
228
276
|
此工具會自動掃描以下目錄:
|
|
@@ -240,17 +288,17 @@ vct usage --json --daily
|
|
|
240
288
|
```
|
|
241
289
|
┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
|
|
242
290
|
│ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
|
|
243
|
-
│ 5h ▰▱▱▱▱
|
|
244
|
-
│ 7d
|
|
245
|
-
│
|
|
291
|
+
│ 5h ▰▱▱▱▱ 13% ↻ 1h42m││ 5h ▰▰▱▱▱ 33% ↻ 12m ││ prem ▰▱▱▱▱ 3% ↻ 24d ││ total ▰▱▱▱▱ 6% ↻ 16d │
|
|
292
|
+
│ 7d ▰▰▰▱▱ 58% ↻ 1d23h││ 7d ▰▰▱▱▱ 36% ↻ 1h54m││ reqs ▰▱▱▱▱ 45/1500 ││ auto ▱▱▱▱▱ 0% ↻ 16d │
|
|
293
|
+
│ Fable ▰▰▰▰▱ 79% ↻ 1d23h││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 56% ↻ 16d │
|
|
246
294
|
│ Balance: - $0.00 used ││ updated just now ││ ││ updated just now │
|
|
247
295
|
└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
|
|
248
296
|
```
|
|
249
297
|
|
|
250
298
|
- **Claude** — 方案類型、5 小時、每週以及單模型每週用量,來自官方 OAuth 用量 API(`GET /api/oauth/usage`),從 `~/.claude/.credentials.json` 讀取,並顯示額度餘額。約每分鐘輪詢一次以避開該端點的速率限制;觸及上限時標題會出現紅色 `LIMIT` 標記。單模型每週那一行屬於盡力而為,未回傳該範圍時就自動隱藏。
|
|
251
299
|
- **Codex** — 方案類型、5 小時和每週用量以及額度餘額,使用 `~/.codex/auth.json` 從 ChatGPT 後端(`wham/usage`)取得(在適用時顯示大致剩餘訊息數 / 消費上限);API 無法使用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `Codex` 或 `Codex (session)`)。
|
|
252
|
-
- **Copilot** —
|
|
253
|
-
- **Cursor** — 方案類型、total / auto / API
|
|
300
|
+
- **Copilot** — 方案類型以及你的 premium 請求額度,以兩個進度條呈現:已用百分比,以及已用 / 總量請求數(例如 `45/1500`),來自 GitHub 的 Copilot API(`GET /copilot_internal/user`),從 `~/.copilot/config.json` 讀取。該請求會模擬 Copilot CLI。token 為長期有效,因此不需要刷新;遇到 `401` / `403` 時會顯示 `run: copilot login` 提示。
|
|
301
|
+
- **Cursor** — 方案類型、total / auto / API **已用**百分比,以及按需消費,來自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被動式的:vct 每次輪詢都會重新讀取該檔案,並在 token 有效期內使用它,因為官方 Cursor 用戶端會讓它保持最新。
|
|
254
302
|
|
|
255
303
|
**自動刷新 token。** 對 Claude 和 Codex,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式),因此 token 會在多次檢查之間重複使用,而不是每次都重新刷新。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。Copilot(長期有效的 token)和 Cursor(由其自身用戶端保持最新)為唯讀——vct 從不寫入它們的憑證檔案。
|
|
256
304
|
|
|
@@ -309,25 +357,58 @@ vct analysis --output today.json --daily
|
|
|
309
357
|
### 預覽:互動式儀表板(`vct analysis`)
|
|
310
358
|
|
|
311
359
|
```
|
|
312
|
-
|
|
313
|
-
│ Model
|
|
314
|
-
│
|
|
315
|
-
│ claude-haiku-4-5-20251001
|
|
316
|
-
│ claude-opus-4-
|
|
317
|
-
│ gemini-3.1-pro-preview
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
│ Provider
|
|
321
|
-
│
|
|
322
|
-
│ Claude Code
|
|
323
|
-
│ Gemini
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
│
|
|
327
|
-
|
|
360
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
361
|
+
│ Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write │
|
|
362
|
+
│ │
|
|
363
|
+
│ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 0 │
|
|
364
|
+
│ claude-opus-4-8 1.28K 13.3K 1.58K 82 146 209 18 62 │
|
|
365
|
+
│ gemini-3.1-pro-preview 0 0 0 0 0 0 0 0 │
|
|
366
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
367
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
368
|
+
│ Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
|
|
369
|
+
│ │
|
|
370
|
+
│ Claude Code 1.28K 13.3K 1.58K 125 146 268 18 62 3 │
|
|
371
|
+
│ Gemini 0 0 0 0 0 0 0 0 1 │
|
|
372
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
373
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
374
|
+
│ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB │
|
|
375
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
328
376
|
↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
|
|
329
377
|
```
|
|
330
378
|
|
|
379
|
+
### 預覽:表格與 JSON(`vct analysis`)
|
|
380
|
+
|
|
381
|
+
`--table` 會呈現每個 model 的明細以及每個供應商的彙總(含 Active Days 欄位);`--json` 則為每個 model 輸出一列聚合資料。
|
|
382
|
+
|
|
383
|
+
```text
|
|
384
|
+
Analysis Statistics
|
|
385
|
+
|
|
386
|
+
┌─────────────────┬────────────┬────────────┬─────────────┬──────┬──────┬──────┬───────────┬───────┐
|
|
387
|
+
│ Model ┆ Edit Lines ┆ Read Lines ┆ Write Lines ┆ Bash ┆ Edit ┆ Read ┆ TodoWrite ┆ Write │
|
|
388
|
+
╞═════════════════╪════════════╪════════════╪═════════════╪══════╪══════╪══════╪═══════════╪═══════╡
|
|
389
|
+
│ gpt-5.5 ┆ 0 ┆ 3,087 ┆ 0 ┆ 25 ┆ 0 ┆ 10 ┆ 0 ┆ 0 │
|
|
390
|
+
│ claude-opus-4-8 ┆ 1,493 ┆ 15,564 ┆ 970 ┆ 123 ┆ 134 ┆ 144 ┆ 0 ┆ 12 │
|
|
391
|
+
│ TOTAL ┆ 1,493 ┆ 18,651 ┆ 970 ┆ 148 ┆ 134 ┆ 154 ┆ 0 ┆ 12 │
|
|
392
|
+
└─────────────────┴────────────┴────────────┴─────────────┴──────┴──────┴──────┴───────────┴───────┘
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
// vct analysis --json (one model shown)
|
|
397
|
+
[
|
|
398
|
+
{
|
|
399
|
+
"model": "claude-opus-4-8",
|
|
400
|
+
"editLines": 1493,
|
|
401
|
+
"readLines": 15564,
|
|
402
|
+
"writeLines": 970,
|
|
403
|
+
"bashCount": 124,
|
|
404
|
+
"editCount": 134,
|
|
405
|
+
"readCount": 144,
|
|
406
|
+
"todoWriteCount": 0,
|
|
407
|
+
"writeCount": 12
|
|
408
|
+
}
|
|
409
|
+
]
|
|
410
|
+
```
|
|
411
|
+
|
|
331
412
|
---
|
|
332
413
|
|
|
333
414
|
## Update 指令
|
|
@@ -352,9 +433,9 @@ vct update --force
|
|
|
352
433
|
### 預覽(`vct update --check`)
|
|
353
434
|
|
|
354
435
|
```
|
|
355
|
-
Current version:
|
|
436
|
+
Current version: v1.3.0
|
|
356
437
|
Checking for latest release...
|
|
357
|
-
Latest version:
|
|
438
|
+
Latest version: v1.3.0 — you are up to date!
|
|
358
439
|
```
|
|
359
440
|
|
|
360
441
|
---
|
|
@@ -369,6 +450,14 @@ vct version --text # 每行一個欄位,適合腳本
|
|
|
369
450
|
vct version --json # 機器可讀的 JSON
|
|
370
451
|
```
|
|
371
452
|
|
|
453
|
+
```text
|
|
454
|
+
┌───────────────┬──────────┐
|
|
455
|
+
│ Version ┆ 1.3.0 │
|
|
456
|
+
│ Rust Version ┆ 1.96.0 │
|
|
457
|
+
│ Cargo Version ┆ 1.96.0 │
|
|
458
|
+
└───────────────┴──────────┘
|
|
459
|
+
```
|
|
460
|
+
|
|
372
461
|
Binary version 由 `build.rs` 在編譯期透過 `git describe` 寫入,開發版本會附上 commit 數、short SHA 與 `dirty` 後綴。
|
|
373
462
|
|
|
374
463
|
---
|
|
@@ -392,6 +481,12 @@ Binary version 由 `build.rs` 在編譯期透過 `git describe` 寫入,開發
|
|
|
392
481
|
4. **模糊比對(AI 驅動)**:使用 Jaro-Winkler 相似度(70% 門檻值)
|
|
393
482
|
5. **備援方案**:若無法配對則顯示 $0.00
|
|
394
483
|
|
|
484
|
+
### 費用細節
|
|
485
|
+
|
|
486
|
+
- **不只 token**:Claude 的網頁搜尋工具呼叫(`server_tool_use.web_search_requests`)會在 token 費用之外,按每次查詢計費;其他所有 model 的每次查詢費用皆為 $0。
|
|
487
|
+
- **OpenCode**:只有在 LiteLLM **完全比對**成功時,才會依 token 為新型 model 計價;若沒有完全比對,vct 會採信該 assistant 訊息本身儲存的費用,而不是從名稱相近的 model 去猜測。
|
|
488
|
+
- **原始 cache**:每日 cache 儲存的是經過篩選的上游 LiteLLM JSON(而非衍生後的結構),因此分層 / 批次定價無需重新抓取即可使用;另外一個小型的行內 LRU 會讓 TUI 刷新期間的重複查詢維持低成本。
|
|
489
|
+
|
|
395
490
|
---
|
|
396
491
|
|
|
397
492
|
## Docker 支援
|
|
@@ -399,13 +494,4 @@ Binary version 由 `build.rs` 在編譯期透過 `git describe` 寫入,開發
|
|
|
399
494
|
```bash
|
|
400
495
|
# Build image
|
|
401
496
|
docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
|
|
402
|
-
|
|
403
|
-
# Run with your sessions
|
|
404
|
-
docker run --rm \
|
|
405
|
-
-v ~/.claude:/root/.claude \
|
|
406
|
-
-v ~/.codex:/root/.codex \
|
|
407
|
-
-v ~/.copilot:/root/.copilot \
|
|
408
|
-
-v ~/.gemini:/root/.gemini \
|
|
409
|
-
-v ~/.local/share/opencode:/root/.local/share/opencode \
|
|
410
|
-
vibe_coding_tracker:latest usage
|
|
411
497
|
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED