@mai0313/vct 2.2.4 → 2.3.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 CHANGED
@@ -68,7 +68,7 @@ Automatically detects and processes logs from Claude Code, Codex, Copilot, Gemin
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
+ | **Live Quota Panels** | Live quota usage for Claude, Codex, Copilot, Cursor, and Grok |
72
72
  | **Ultra-Lightweight** | Under ~50 MB RSS in the TUI, compact incremental scans — built with Rust |
73
73
  | **Live Updates** | Responsive loading and background refreshes with change highlighting |
74
74
 
@@ -216,23 +216,24 @@ vct usage --table --merge-providers
216
216
  ### Preview: Interactive Dashboard (`vct usage`)
217
217
 
218
218
  ```
219
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
220
- │ Model Input Output Cache Read Cache Write Total Cost (USD) │
221
- │ │
222
- │ gemini-3.1-pro-preview 129K 10.3K 67.4K 0 207K $0.40 │
223
- │ claude-haiku-4-5-20251001 5.57K 19.8K 4.63M 620K 5.27M $1.34 │
224
- │ claude-opus-4-8 25.7K 179K 40.8M 2.57M 43.6M $77.59 │
225
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
226
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
227
- │ Provider Tokens Cost │
228
- │ │
229
- │ Claude 48.9M $78.93 │
230
- │ Gemini 207K $0.40 │
231
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
232
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
233
- │ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB | CPU: 17.9% │
234
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
235
- ↑/↓ scroll m merge r refresh q quit | Star on GitHub
219
+ ┌ Models · $79.33 · 49.1M tokens · 3 models ────────────────────────── −2 cols ┐┌ Providers ───────────────────────────┐
220
+ │Model Input Output Total Cost (USD) █│Provider Tokens Cost │
221
+ │ █│ │
222
+ │gemini-3.1-pro-preview 129K 10.3K 207K $0.40█│Claude 48.9M $78.93 │
223
+ │claude-haiku-4-5-20251001 5.57K 19.8K 5.28M $1.34█│Gemini 207K $0.40 │
224
+ │claude-opus-4-8 25.7K 179K 43.6M $77.59█│ │
225
+ │ █│ │
226
+ │ █│ │
227
+ └──────────────────────────────────────────────────────────────────────────────┘└──────────────────────────────────────┘
228
+ ┌ Claude ──────────────┐┌ Codex ───────────────┐┌ Copilot ─────────────┐┌ Cursor ────────LIMIT ┐┌ Grok ────────────────┐
229
+ │max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
230
+ │5h ▰▱▱▱▱ 13% 1h42m││5h ▰▰▱▱▱ 33% 12m ││prem ▰▱▱▱▱ 3% 24d0h││total ▰▰▰▰▰ 94% 16d0h││week ▰▰▱▱▱ 38% 3d4h │
231
+ │7d ▰▰▰▱▱ 58% 1d23h││7d ▰▰▱▱▱ 36% 1h54m││reqs ▰▱▱▱▱ 45/1500 ││auto ▰▰▰▰▰ 100% 16d0h││ondmd $4.20/$50.00 │
232
+ │Fable ▰▰▰▰▱ 79% 1d23h││credits 0 · +3 reset ││ ││api ▰▰▰▱▱ 44% 16d0h││balance $12.00 │
233
+ │bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
234
+ └──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
235
+ Total Cost: $79.33 | Total Tokens: 49.1M | Models: 3 | Memory: 4.7 MB | CPU: 0.0%
236
+ ↑/↓ scroll m merge p hide Q quota r refresh q quit | Star on GitHub
236
237
  ```
237
238
 
238
239
  Both interactive dashboards draw a centered `Loading sessions...` spinner as soon as terminal setup finishes. Loading stays responsive to `q`, Ctrl+C, and resize events. Later scans run in one background worker, keep the last successful data visible with a `Refreshing...` footer, and coalesce repeated refresh requests into at most one pending scan. A failed refresh keeps the last-known-good view and retries on the next scheduled or manual refresh.
@@ -290,7 +291,7 @@ Every row serializes the same flat token fields regardless of provider (Codex's
290
291
  The tool automatically scans these directories:
291
292
 
292
293
  - `~/.claude/projects/**/*.jsonl` (Claude Code — recursive, includes subagent logs)
293
- - `~/.codex/sessions/**/*.jsonl` (Codex — recursive, includes daily subdirectories)
294
+ - `~/.codex/sessions/**/*.jsonl` (Codex — recursive, includes daily subdirectories) plus `~/.codex/archived_sessions/*.jsonl`, the flat directory Codex moves a session's log into when you archive it (a session found in both is counted once)
294
295
  - `~/.copilot/session-state/<sessionId>/events.jsonl` (Copilot CLI)
295
296
  - `~/.gemini/tmp/<project_hash>/chats/*.jsonl` (Gemini CLI)
296
297
  - `~/.local/share/opencode/opencode.db` (OpenCode — SQLite database; honors `$XDG_DATA_HOME`)
@@ -298,33 +299,33 @@ The tool automatically scans these directories:
298
299
  - `~/.hermes/state.db` (Hermes — SQLite database, honors `$HERMES_HOME`; `usage` only)
299
300
  - `$GROK_HOME/sessions/*/*/signals.json` (Grok CLI — defaults to `~/.grok`; sibling `updates.jsonl` supplies `analysis` data)
300
301
 
301
- Grok `usage` is one point-in-time local context estimate: vct records `signals.json`'s `contextTokensUsed` as cache-read tokens and estimates cost at the model's cache-read price. It is not cumulative billed usage. `analysis` reconstructs completed Read / Write / Edit / Bash / TodoWrite operations from the sibling `updates.jsonl`. Grok does not support quota panels or `vct quota`.
302
+ Grok `usage` is one point-in-time local context estimate: vct records `signals.json`'s `contextTokensUsed` as cache-read tokens and estimates cost at the model's cache-read price. It is not cumulative billed usage. `analysis` reconstructs completed Read / Write / Edit / Bash / TodoWrite operations from the sibling `updates.jsonl`. For your actual billed allowance, see the Grok quota panel below.
302
303
 
303
304
  For noninteractive `usage` and `analysis` scans, vct exits with an error when every discovered source fails. If only some sources fail, it keeps the successful results and prints one diagnostic summary to stderr. The TUI stays best-effort and preserves its last successful payload instead.
304
305
 
305
306
  ### Live Quota Panels
306
307
 
307
- `vct usage` shows **live remaining quota for Claude Code, Codex, GitHub Copilot, and Cursor right in the dashboard — with zero setup.** No status-line hook, no credentials to enter: vct reads each provider's own credentials, calls its usage API on a background thread, and keeps the panels current while you work. (Prefer a quieter dashboard? Trim `panels` under `[usage.quota]` in [`config.toml`](#configuration), or set it to `[]` to hide the band.)
308
+ `vct usage` shows **live quota usage for Claude Code, Codex, GitHub Copilot, Cursor, and Grok right in the dashboard — with zero setup.** No status-line hook, no credentials to enter: vct reads each provider's own credentials, calls its usage API on a background thread, and keeps the panels current while you work. Every gauge is percent **used**, so a full bar means the window is spent, not untouched. (Prefer a quieter dashboard? Trim `panels` under `[usage.quota]` in [`config.toml`](#configuration), or set it to `[]` to hide the quota cards entirely. The Provider Usage pane is local scan data, not a quota panel, so it keeps its own `p` toggle.)
308
309
 
309
310
  ```
310
- ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
311
- │ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
312
- │ 5h ▰▱▱▱▱ 13% ↻ 1h42m││ 5h ▰▰▱▱▱ 33% ↻ 12m ││ prem ▰▱▱▱▱ 3% ↻ 24d ││ total ▰▰▰▰▰ 94% ↻ 16d │
313
- │ 7d ▰▰▰▱▱ 58% ↻ 1d23h││ 7d ▰▰▱▱▱ 36% ↻ 1h54m││ reqs ▰▱▱▱▱ 45/1500 ││ auto ▰▰▰▰▰ 100% ↻ 16d │
314
- │ Fable ▰▰▰▰▱ 79% ↻ 1d23h││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 44% ↻ 16d │
315
- │ Balance: - $0.00 used ││ reset expires 17d0h ││ ││ updated just now │
316
- │ updated just now ││ updated just now ││ ││ │
317
- └─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
311
+ ┌ Claude ──────────────┐┌ Codex ───────────────┐┌ Copilot ─────────────┐┌ Cursor ────────LIMIT ┐┌ Grok ────────────────┐
312
+ │max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
313
+ │5h ▰▱▱▱▱ 13% 1h42m││5h ▰▰▱▱▱ 33% 12m ││prem ▰▱▱▱▱ 3% 24d0h││total ▰▰▰▰▰ 94% 16d0h││week ▰▰▱▱▱ 38% 3d4h │
314
+ │7d ▰▰▰▱▱ 58% 1d23h││7d ▰▰▱▱▱ 36% 1h54m││reqs ▰▱▱▱▱ 45/1500 ││auto ▰▰▰▰▰ 100% 16d0h││ondmd $4.20/$50.00 │
315
+ │Fable ▰▰▰▰▱ 79% 1d23h││credits 0 · +3 reset ││ ││api ▰▰▰▱▱ 44% 16d0h││balance $12.00 │
316
+ │bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
317
+ └──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
318
318
  ```
319
319
 
320
320
  - **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.
321
321
  - **Codex** — plan tier, 5-hour and weekly usage, credit balance, and the earliest fetched available earned-reset expiry from the ChatGPT backend (`wham/usage` + `wham/rate-limit-reset-credits`) 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)`).
322
322
  - **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.
323
323
  - **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.
324
+ - **Grok** — plan tier plus your included-allowance usage for the current weekly or monthly period, from the Grok CLI's own billing endpoint (`GET /v1/billing?format=credits`), read from `~/.grok/auth.json`. A prepaid balance is shown only once it is non-zero, and pay-as-you-go spend once you have either spent something or set a cap. The request impersonates the Grok CLI; a `401` / `403` shows a `run: grok login` hint.
324
325
 
325
- **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.
326
+ **Automatic token refresh.** For Claude, Codex, and Grok, 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. Grok's token endpoint is resolved from its login issuer rather than hardcoded, the way its own CLI does it, and every other login in the file is preserved on write. 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.
326
327
 
327
- A panel appears only for a provider whose credentials are present. When four panels are shown the Provider Usage table folds out of the band, and at narrow widths the panels wrap to a 2×2 grid. Quota panels appear only in the interactive TUI; `--table`, `--text`, and `--json` are unchanged.
328
+ A panel appears only for a provider whose credentials are present. Panels are placed on a uniform grid that fits as many cards per row as the terminal allows and wraps the rest onto the next row, so a new provider costs a card and never a new layout rule. On a terminal too short to spend rows on the grid, it folds into a one-line digest showing the gauges that still fit and counting the rest; press `Q` for the full-detail overlay, where every card has room for every line whatever the terminal size, and `p` to toggle the Provider Usage side pane. Quota panels appear only in the interactive TUI; `--table`, `--text`, and `--json` are unchanged.
328
329
 
329
330
  > **Platform note:** on macOS, Claude Code stores its OAuth credentials in the system Keychain rather than `~/.claude/.credentials.json`, so the Claude panel is not shown on macOS. Cursor's `~/.config/cursor` credential path is Linux-oriented.
330
331
 
@@ -382,23 +383,22 @@ vct analysis --json --daily > today.json
382
383
  ### Preview: Interactive Dashboard (`vct analysis`)
383
384
 
384
385
  ```
385
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
386
- │ Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write │
387
- │ │
388
- │ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 0 │
389
- │ claude-opus-4-8 1.28K 13.3K 1.58K 82 146 209 18 62 │
390
- │ gemini-3.1-pro-preview 0 0 0 0 0 0 0 0 │
391
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
392
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
393
- │ Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
394
- │ │
395
- │ Claude 1.28K 13.3K 1.58K 125 146 268 18 62 3 │
396
- │ Gemini 0 0 0 0 0 0 0 0 1 │
397
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
398
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
399
- │ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB | CPU: 17.9% │
400
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
401
- ↑/↓ scroll r refresh q quit | Star on GitHub
386
+ ┌ Models · 135K lines · 1.80K tool calls · 3 models ───────────────────────────────────────────────────────────────────┐
387
+ │Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write █
388
+ │ █
389
+ │claude-opus-4-8 12.4K 88.1K 9.02K 412 231 604 96 88█
390
+ │gemini-3.1-pro-preview 2.10K 14.8K 1.62K 84 44 112 16 15█
391
+ │claude-haiku-4-5-20251001 840 5.40K 610 31 16 42 6 5█
392
+ │ █
393
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
394
+ ┌ Providers ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
395
+ │Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
396
+ │ │
397
+ │Claude 13.2K 93.5K 9.63K 443 247 646 102 93 12 │
398
+ │Gemini 2.10K 14.8K 1.62K 84 44 112 16 15 3 │
399
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
400
+ Total Lines: 135K | Total Tools: 1.80K | Models: 3 | Memory: 4.8 MB | CPU: 0.0%
401
+ ↑/↓ scroll r refresh q quit | Star on GitHub
402
402
  ```
403
403
 
404
404
  ### Preview: Table & JSON (`vct analysis`)
@@ -513,7 +513,7 @@ The binary version is produced at build time by `build.rs` from `git describe`,
513
513
 
514
514
  **Print a provider's raw quota/usage API response — no parsing, no aggregation.**
515
515
 
516
- Calls the same quota endpoint the `usage` dashboard uses (Claude / Codex / Copilot / Cursor) exactly once and prints the raw body, so you can inspect the exact API shape or sanity-check your credentials. It reads each provider's stored credentials and does **not** refresh tokens: if a token is expired, re-auth with that provider's own CLI (`claude` / `codex` / `copilot` / `cursor-agent`).
516
+ Calls the same quota endpoint the `usage` dashboard uses (Claude / Codex / Copilot / Cursor / Grok) exactly once and prints the raw body, so you can inspect the exact API shape or sanity-check your credentials. It reads each provider's stored credentials and does **not** refresh tokens: if a token is expired, re-auth with that provider's own CLI (`claude` / `codex` / `copilot` / `cursor-agent` / `grok`).
517
517
 
518
518
  > The previous name `vct fetch` is kept as a hidden alias, so existing scripts keep working.
519
519
 
@@ -534,6 +534,7 @@ vct quota claude
534
534
  vct quota codex
535
535
  vct quota copilot
536
536
  vct quota cursor
537
+ vct quota grok
537
538
 
538
539
  # Flattened plain text
539
540
  vct quota codex --text
@@ -549,7 +550,7 @@ vct quota copilot --table
549
550
 
550
551
  ## Configuration
551
552
 
552
- vct keeps its user settings in `~/.vct/config.toml`. The file is **created with defaults on first run**, so you never have to write it by hand — edit it only when you want to change a default. It is generated from vct's typed settings and carries a `#:schema` directive on the first line, so a schema-aware TOML editor (taplo / VS Code "Even Better TOML") gives you autocomplete and validation. Print the schema yourself with `vct config schema`. A file written by an older vct is upgraded to the current layout in place the next time vct reads it (or on demand with `vct config migrate`), so an upgrade never leaves you on a stale format.
553
+ vct keeps its user settings in `~/.vct/config.toml`. The file is **created with defaults on first run**, so you never have to write it by hand — edit it only when you want to change a default. It is generated from vct's typed settings and carries a `#:schema` directive on the first line, so a schema-aware TOML editor (taplo / VS Code "Even Better TOML") gives you autocomplete and validation. Print the schema yourself with `vct config schema`. A file written by an older vct is upgraded to the current layout in place the next time vct reads it (or on demand with `vct config migrate`), so an upgrade never leaves you on a stale format. That upgrade also adds a quota panel released after your file was written — once. Remove the name again and it stays removed, and a panel you had already dropped is never brought back.
553
554
 
554
555
  ```toml
555
556
  #:schema https://raw.githubusercontent.com/Mai0313/VibeCodingTracker/main/vct.schema.json
@@ -558,6 +559,9 @@ vct keeps its user settings in `~/.vct/config.toml`. The file is **created with
558
559
  # Default time range when no --daily/--weekly/--monthly/--all flag is given.
559
560
  # One of: "daily" | "weekly" | "monthly" | "all".
560
561
  default_time_range = "all"
562
+ # Layout version of this file, stamped by vct. Only the upgrade pass reads it;
563
+ # leave it alone unless you want a past upgrade to run again.
564
+ version = 2
561
565
 
562
566
  [usage]
563
567
  # Start the usage dashboard with models merged across provider prefixes.
@@ -568,8 +572,8 @@ refresh_interval = 10
568
572
 
569
573
  [usage.quota]
570
574
  # Which live quota panels to show. Remove a name to hide that panel; use an
571
- # empty list ([]) to hide the whole band.
572
- panels = ["claude", "codex", "copilot", "cursor"]
575
+ # empty list ([]) to hide them all.
576
+ panels = ["claude", "codex", "copilot", "cursor", "grok"]
573
577
  # Seconds between live quota-panel polls, shared by every provider (minimum 1).
574
578
  refresh_interval = 60
575
579
 
@@ -602,18 +606,19 @@ level = "warn"
602
606
  retention_days = 7
603
607
  ```
604
608
 
605
- | Setting | Effect |
606
- | ------------------------------ | ---------------------------------------------------------------------------------------------------------------------------- |
607
- | `general.default_time_range` | Period used when you pass no `--daily/--weekly/--monthly/--all`. An explicit flag always wins. |
608
- | `usage.merge_models` | Seeds the dashboard merged; the `m` toggle saves your last choice back here. `--merge-providers` forces on. |
609
- | `usage.refresh_interval` | Redraw cadence of the `usage` dashboard (seconds). |
610
- | `usage.quota.panels` | Which quota panels to show (`claude` / `codex` / `copilot` / `cursor`); drop a name to hide it, `[]` to hide the whole band. |
611
- | `usage.quota.refresh_interval` | Poll cadence for every live quota panel (seconds); higher is safer against a provider's rate limits. |
612
- | `analysis.refresh_interval` | Redraw cadence of the `analysis` dashboard (seconds). |
613
- | `performance.scan_threads` | CLI scan workers. `0` uses `RAYON_NUM_THREADS` when positive, otherwise at most two workers; every value is CPU-capped. |
614
- | `providers.*` | Skip a provider entirely (no scan, no API) when `false` — handy if you don't use one. |
615
- | `logging.level` | Minimum severity written to the log file (`off`..`trace`); never printed to the terminal. |
616
- | `logging.retention_days` | Days of daily log files to keep; older `vct-*.log` are pruned on startup (`0` keeps all). |
609
+ | Setting | Effect |
610
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
611
+ | `general.default_time_range` | Period used when you pass no `--daily/--weekly/--monthly/--all`. An explicit flag always wins. |
612
+ | `general.version` | Layout version vct stamps on the file, so a panel added by a later release is offered to you exactly once. |
613
+ | `usage.merge_models` | Seeds the dashboard merged; the `m` toggle saves your last choice back here. `--merge-providers` forces on. |
614
+ | `usage.refresh_interval` | Redraw cadence of the `usage` dashboard (seconds). |
615
+ | `usage.quota.panels` | Which quota panels to show (`claude` / `codex` / `copilot` / `cursor` / `grok`); drop a name to hide it, `[]` to hide them all. |
616
+ | `usage.quota.refresh_interval` | Poll cadence for every live quota panel (seconds); higher is safer against a provider's rate limits. |
617
+ | `analysis.refresh_interval` | Redraw cadence of the `analysis` dashboard (seconds). |
618
+ | `performance.scan_threads` | CLI scan workers. `0` uses `RAYON_NUM_THREADS` when positive, otherwise at most two workers; every value is CPU-capped. |
619
+ | `providers.*` | Skip a provider entirely (no scan, no API) when `false` — handy if you don't use one. |
620
+ | `logging.level` | Minimum severity written to the log file (`off`..`trace`); never printed to the terminal. |
621
+ | `logging.retention_days` | Days of daily log files to keep; older `vct-*.log` are pruned on startup (`0` keeps all). |
617
622
 
618
623
  > [!NOTE]
619
624
  > Cursor `usage` is a **local estimate** from the chat stores, so it behaves like Claude Code / Codex / Copilot / Gemini (all computed from local session files) and needs no network. It undercounts Cursor's real spend, because much of it is billed under Cursor-internal model names the local data cannot price — treat Cursor cost as approximate.
package/README.zh-CN.md CHANGED
@@ -68,7 +68,7 @@
68
68
  | **智能定价** | 模糊模型匹配 + 从 LiteLLM 每日缓存更新 |
69
69
  | **4 种显示模式** | 交互式 TUI、静态表格、纯文本和 JSON |
70
70
  | **双维度分析** | token/费用统计(`usage`)+ 代码操作统计(`analysis`) |
71
- | **实时额度面板** | Claude、Codex、Copilot 和 Cursor 的实时剩余额度 |
71
+ | **实时额度面板** | Claude、Codex、Copilot、Cursor 和 Grok 的实时额度用量 |
72
72
  | **超轻量级** | TUI 常驻内存 50 MB 以内、精简的 incremental scan, 基于 Rust 构建 |
73
73
  | **实时更新** | 响应式 loading 与后台 refresh, 并高亮变化 |
74
74
 
@@ -216,23 +216,24 @@ vct usage --table --merge-providers
216
216
  ### 预览:交互式面板(`vct usage`)
217
217
 
218
218
  ```
219
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
220
- │ Model Input Output Cache Read Cache Write Total Cost (USD) │
221
- │ │
222
- │ gemini-3.1-pro-preview 129K 10.3K 67.4K 0 207K $0.40 │
223
- │ claude-haiku-4-5-20251001 5.57K 19.8K 4.63M 620K 5.27M $1.34 │
224
- │ claude-opus-4-8 25.7K 179K 40.8M 2.57M 43.6M $77.59 │
225
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
226
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
227
- │ Provider Tokens Cost │
228
- │ │
229
- │ Claude 48.9M $78.93 │
230
- │ Gemini 207K $0.40 │
231
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
232
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
233
- │ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB | CPU: 17.9% │
234
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
235
- ↑/↓ scroll m merge r refresh q quit | Star on GitHub
219
+ ┌ Models · $79.33 · 49.1M tokens · 3 models ────────────────────────── −2 cols ┐┌ Providers ───────────────────────────┐
220
+ │Model Input Output Total Cost (USD) █│Provider Tokens Cost │
221
+ │ █│ │
222
+ │gemini-3.1-pro-preview 129K 10.3K 207K $0.40█│Claude 48.9M $78.93 │
223
+ │claude-haiku-4-5-20251001 5.57K 19.8K 5.28M $1.34█│Gemini 207K $0.40 │
224
+ │claude-opus-4-8 25.7K 179K 43.6M $77.59█│ │
225
+ │ █│ │
226
+ │ █│ │
227
+ └──────────────────────────────────────────────────────────────────────────────┘└──────────────────────────────────────┘
228
+ ┌ Claude ──────────────┐┌ Codex ───────────────┐┌ Copilot ─────────────┐┌ Cursor ────────LIMIT ┐┌ Grok ────────────────┐
229
+ │max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
230
+ │5h ▰▱▱▱▱ 13% 1h42m││5h ▰▰▱▱▱ 33% 12m ││prem ▰▱▱▱▱ 3% 24d0h││total ▰▰▰▰▰ 94% 16d0h││week ▰▰▱▱▱ 38% 3d4h │
231
+ │7d ▰▰▰▱▱ 58% 1d23h││7d ▰▰▱▱▱ 36% 1h54m││reqs ▰▱▱▱▱ 45/1500 ││auto ▰▰▰▰▰ 100% 16d0h││ondmd $4.20/$50.00 │
232
+ │Fable ▰▰▰▰▱ 79% 1d23h││credits 0 · +3 reset ││ ││api ▰▰▰▱▱ 44% 16d0h││balance $12.00 │
233
+ │bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
234
+ └──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
235
+ Total Cost: $79.33 | Total Tokens: 49.1M | Models: 3 | Memory: 4.7 MB | CPU: 0.0%
236
+ ↑/↓ scroll m merge p hide Q quota r refresh q quit | Star on GitHub
236
237
  ```
237
238
 
238
239
  两个交互式面板都会在 terminal setup 完成后立即绘制居中的 `Loading sessions...` spinner. Loading 期间仍可响应 `q`, Ctrl+C 与 resize event. 后续扫描由单一 background worker 执行, 并在 `Refreshing...` footer 下保留上一次成功的数据. 重复的 refresh 请求最多只会合并为一个 pending scan. 如果 refresh 失败, 面板会保留 last-known-good view, 并在下次排程或手动刷新时重试.
@@ -290,7 +291,7 @@ Totals (by Provider)
290
291
  该工具会自动扫描以下目录:
291
292
 
292
293
  - `~/.claude/projects/**/*.jsonl`(Claude Code,递归包含 subagent 日志)
293
- - `~/.codex/sessions/**/*.jsonl`(Codex,递归包含每日子目录)
294
+ - `~/.codex/sessions/**/*.jsonl`(Codex,递归包含每日子目录),以及 `~/.codex/archived_sessions/*.jsonl`——归档会话时 Codex 会把日志移进这个扁平目录(同时存在于两处的会话只会计入一次)
294
295
  - `~/.copilot/session-state/<sessionId>/events.jsonl`(Copilot CLI)
295
296
  - `~/.gemini/tmp/<project_hash>/chats/*.jsonl`(Gemini CLI)
296
297
  - `~/.local/share/opencode/opencode.db`(OpenCode,SQLite 数据库;遵循 `$XDG_DATA_HOME`)
@@ -298,33 +299,33 @@ Totals (by Provider)
298
299
  - `~/.hermes/state.db`(Hermes,SQLite 数据库,遵循 `$HERMES_HOME`;仅 `usage`)
299
300
  - `$GROK_HOME/sessions/*/*/signals.json`(Grok CLI,默认使用 `~/.grok`;同层的 `updates.jsonl` 提供 `analysis` 数据)
300
301
 
301
- Grok 的 `usage` 是单一时点的本地 context 估算:vct 会把 `signals.json` 的 `contextTokensUsed` 记为 cache-read token,并按该 model 的 cache-read 费率估算费用。这不是累计的 billed usage。`analysis` 会从同层的 `updates.jsonl` 还原已完成的 Read / Write / Edit / Bash / TodoWrite 操作。Grok 不支持 quota panel 或 `vct quota`。
302
+ Grok 的 `usage` 是单一时点的本地 context 估算:vct 会把 `signals.json` 的 `contextTokensUsed` 记为 cache-read token,并按该 model 的 cache-read 费率估算费用。这不是累计的 billed usage。`analysis` 会从同层的 `updates.jsonl` 还原已完成的 Read / Write / Edit / Bash / TodoWrite 操作。至于你实际计费的额度,请参见下方的 Grok 额度面板。
302
303
 
303
304
  对于非交互式 `usage` 与 `analysis` 扫描, 如果所有找到的 source 都失败, vct 会以错误结束. 如果只有部分 source 失败, vct 会保留成功的结果, 并向 stderr 打印一则诊断摘要. TUI 则保持 best-effort, 并保留上一次成功的 payload.
304
305
 
305
306
  ### 实时额度面板
306
307
 
307
- `vct usage` 会**在仪表盘中直接显示 Claude Code、Codex、GitHub Copilot 与 Cursor 的实时剩余额度——完全零配置。** 不需要 status-line hook,也无需手动输入任何凭证:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。(想要更清爽的面板?在 [`config.toml`](#%E9%85%8D%E7%BD%AE) 中精简 `[usage.quota]` 下的 `panels`,或设为 `[]` 隐藏整栏。)
308
+ `vct usage` 会**在仪表盘中直接显示 Claude Code、Codex、GitHub Copilot、Cursor 与 Grok 的实时额度用量——完全零配置。** 不需要 status-line hook,也无需手动输入任何凭证:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。每个进度条都是**已用**百分比,所以进度条满格代表该额度周期已耗尽,而不是还没开始用。(想要更清爽的面板?在 [`config.toml`](#%E9%85%8D%E7%BD%AE) 中精简 `[usage.quota]` 下的 `panels`,或设为 `[]` 隐藏所有额度卡片。Provider Usage 侧栏是本机扫描数据而不是额度面板,所以它有自己的 `p` 开关。)
308
309
 
309
310
  ```
310
- ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
311
- │ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
312
- │ 5h ▰▱▱▱▱ 13% ↻ 1h42m││ 5h ▰▰▱▱▱ 33% ↻ 12m ││ prem ▰▱▱▱▱ 3% ↻ 24d ││ total ▰▰▰▰▰ 94% ↻ 16d │
313
- │ 7d ▰▰▰▱▱ 58% ↻ 1d23h││ 7d ▰▰▱▱▱ 36% ↻ 1h54m││ reqs ▰▱▱▱▱ 45/1500 ││ auto ▰▰▰▰▰ 100% ↻ 16d │
314
- │ Fable ▰▰▰▰▱ 79% ↻ 1d23h││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 44% ↻ 16d │
315
- │ Balance: - $0.00 used ││ reset expires 17d0h ││ ││ updated just now │
316
- │ updated just now ││ updated just now ││ ││ │
317
- └─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
311
+ ┌ Claude ──────────────┐┌ Codex ───────────────┐┌ Copilot ─────────────┐┌ Cursor ────────LIMIT ┐┌ Grok ────────────────┐
312
+ │max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
313
+ │5h ▰▱▱▱▱ 13% 1h42m││5h ▰▰▱▱▱ 33% 12m ││prem ▰▱▱▱▱ 3% 24d0h││total ▰▰▰▰▰ 94% 16d0h││week ▰▰▱▱▱ 38% 3d4h │
314
+ │7d ▰▰▰▱▱ 58% 1d23h││7d ▰▰▱▱▱ 36% 1h54m││reqs ▰▱▱▱▱ 45/1500 ││auto ▰▰▰▰▰ 100% 16d0h││ondmd $4.20/$50.00 │
315
+ │Fable ▰▰▰▰▱ 79% 1d23h││credits 0 · +3 reset ││ ││api ▰▰▰▱▱ 44% 16d0h││balance $12.00 │
316
+ │bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
317
+ └──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
318
318
  ```
319
319
 
320
320
  - **Claude** — 方案类型、5 小时、每周以及单模型每周用量,来自官方 OAuth 用量 API(`GET /api/oauth/usage`),从 `~/.claude/.credentials.json` 读取,并显示额度余额。约每分钟轮询一次以避开该端点的速率限制;触及上限时标题会出现红色 `LIMIT` 标记。单模型每周那一行属于尽力而为,未返回该范围时就自动隐藏。
321
321
  - **Codex** — 套餐类型、5 小时和每周用量、额度余额以及已获取的可用 reset credit 中最早的到期时间,使用 `~/.codex/auth.json` 从 ChatGPT 后端(`wham/usage` + `wham/rate-limit-reset-credits`)获取(在适用时显示大致剩余讯息数 / 消费上限);API 不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `Codex` 或 `Codex (session)`)。
322
322
  - **Copilot** — 方案类型,以及你的 premium 请求额度,以两个进度条呈现:已用百分比,以及已用 / 总量的请求数(例如 `45/1500`),来自 GitHub 的 Copilot API(`GET /copilot_internal/user`),从 `~/.copilot/config.json` 读取。该请求会模拟 Copilot CLI。token 为长期有效,因此不需要刷新;遇到 `401` / `403` 时会显示 `run: copilot login` 提示。
323
323
  - **Cursor** — 方案类型、total / auto / API **已用**百分比,以及按需消费,来自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被动式的:vct 每次轮询都会重新读取该文件,并在 token 有效期内使用它,因为官方 Cursor 客户端会让它保持最新。
324
+ - **Grok** — 方案类型,以及当前每周或每月周期内的方案内含额度用量,来自 Grok CLI 自己的计费端点(`GET /v1/billing?format=credits`),从 `~/.grok/auth.json` 读取。预付余额只有在非零时才会显示;按量付费的消费则在你有过消费、或设置了上限之后才会显示。该请求会模拟 Grok CLI;遇到 `401` / `403` 时会显示 `run: grok login` 提示。
324
325
 
325
- **自动刷新 token。** 对 Claude 和 Codex,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式),因此 token 会在多次检查之间复用,而不是每次都重新刷新。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。Copilot(长期有效的 token)和 Cursor(由其自身客户端保持最新)为只读——vct 从不写入它们的凭证文件。
326
+ **自动刷新 token。** 对 Claude、Codex 和 Grok,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式),因此 token 会在多次检查之间复用,而不是每次都重新刷新。Grok 的 token 端点会像它自己的 CLI 那样,从登录时的 issuer 解析得出,而不是写死在代码里;写入时也会保留文件中其他所有的登录信息。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。Copilot(长期有效的 token)和 Cursor(由其自身客户端保持最新)为只读——vct 从不写入它们的凭证文件。
326
327
 
327
- 只有在某个 provider 的凭证存在时,才会显示对应的面板。当四个面板都显示时,Provider Usage 表格会从这一栏中折叠隐藏;在较窄的宽度下,面板会折行成 2×2 网格。额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
328
+ 只有在某个 provider 的凭证存在时,才会显示对应的面板。面板排在一个统一网格上:一行放得下几张就放几张,放不下的自动折到下一行,因此新增一个 provider 只是多一张卡片,不会多一条排版规则。当终端高度不足以留给网格时,它会收成一行摘要,显示放得下的 gauge,并把其余的记成数量;按 `Q` 打开完整的额度浮层,无论终端多大,每张卡片都放得下全部内容,按 `p` 可切换 Provider Usage 侧栏。额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
328
329
 
329
330
  > **平台说明:** 在 macOS 上,Claude Code 会把 OAuth 凭证保存在系统 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不会显示 Claude 面板。Cursor 的 `~/.config/cursor` 凭证路径偏向 Linux。
330
331
 
@@ -382,23 +383,22 @@ vct analysis --json --daily > today.json
382
383
  ### 预览:交互式面板(`vct analysis`)
383
384
 
384
385
  ```
385
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
386
- │ Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write │
387
- │ │
388
- │ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 0 │
389
- │ claude-opus-4-8 1.28K 13.3K 1.58K 82 146 209 18 62 │
390
- │ gemini-3.1-pro-preview 0 0 0 0 0 0 0 0 │
391
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
392
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
393
- │ Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
394
- │ │
395
- │ Claude 1.28K 13.3K 1.58K 125 146 268 18 62 3 │
396
- │ Gemini 0 0 0 0 0 0 0 0 1 │
397
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
398
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
399
- │ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB | CPU: 17.9% │
400
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
401
- ↑/↓ scroll r refresh q quit | Star on GitHub
386
+ ┌ Models · 135K lines · 1.80K tool calls · 3 models ───────────────────────────────────────────────────────────────────┐
387
+ │Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write █
388
+ │ █
389
+ │claude-opus-4-8 12.4K 88.1K 9.02K 412 231 604 96 88█
390
+ │gemini-3.1-pro-preview 2.10K 14.8K 1.62K 84 44 112 16 15█
391
+ │claude-haiku-4-5-20251001 840 5.40K 610 31 16 42 6 5█
392
+ │ █
393
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
394
+ ┌ Providers ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
395
+ │Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
396
+ │ │
397
+ │Claude 13.2K 93.5K 9.63K 443 247 646 102 93 12 │
398
+ │Gemini 2.10K 14.8K 1.62K 84 44 112 16 15 3 │
399
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
400
+ Total Lines: 135K | Total Tools: 1.80K | Models: 3 | Memory: 4.8 MB | CPU: 0.0%
401
+ ↑/↓ scroll r refresh q quit | Star on GitHub
402
402
  ```
403
403
 
404
404
  ### 预览:表格与 JSON(`vct analysis`)
@@ -513,7 +513,7 @@ Binary version 由 `build.rs` 在编译期通过 `git describe` 写入,开发
513
513
 
514
514
  **打印某个供应商的原始 quota/usage API 响应 — 不解析、不聚合。**
515
515
 
516
- 对 `usage` 面板使用的同一个 quota 端点(Claude / Codex / Copilot / Cursor)发一次请求,直接打印原始 body,方便你查看 API 的实际结构或检查凭证是否正常。它读取各供应商已保存的凭证,并且**不会**刷新 token:token 过期时,请用对应供应商自己的 CLI 重新登录(`claude` / `codex` / `copilot` / `cursor-agent`)。
516
+ 对 `usage` 面板使用的同一个 quota 端点(Claude / Codex / Copilot / Cursor / Grok)发一次请求,直接打印原始 body,方便你查看 API 的实际结构或检查凭证是否正常。它读取各供应商已保存的凭证,并且**不会**刷新 token:token 过期时,请用对应供应商自己的 CLI 重新登录(`claude` / `codex` / `copilot` / `cursor-agent` / `grok`)。
517
517
 
518
518
  > 旧名称 `vct fetch` 保留为隐藏别名,现有脚本仍可继续使用。
519
519
 
@@ -534,6 +534,7 @@ vct quota claude
534
534
  vct quota codex
535
535
  vct quota copilot
536
536
  vct quota cursor
537
+ vct quota grok
537
538
 
538
539
  # 摊平成纯文本
539
540
  vct quota codex --text
@@ -549,7 +550,7 @@ vct quota copilot --table
549
550
 
550
551
  ## 配置
551
552
 
552
- vct 会把用户设置保存在 `~/.vct/config.toml` 中。该文件会在**首次运行时以默认值自动生成**,因此你完全不必手动编写——只有想修改某个默认值时才编辑它。它由 vct 的类型化设置生成,并在第一行带有 `#:schema` 指令,因此支持 schema 的 TOML 编辑器(taplo / VS Code 的 "Even Better TOML")会提供自动补全与校验。你也可以用 `vct config schema` 自行打印该 schema。由旧版 vct 生成的文件会在下次被 vct 读取时就地升级到当前布局(也可用 `vct config migrate` 手动触发),因此升级后绝不会停留在过时的格式上。
553
+ vct 会把用户设置保存在 `~/.vct/config.toml` 中。该文件会在**首次运行时以默认值自动生成**,因此你完全不必手动编写——只有想修改某个默认值时才编辑它。它由 vct 的类型化设置生成,并在第一行带有 `#:schema` 指令,因此支持 schema 的 TOML 编辑器(taplo / VS Code 的 "Even Better TOML")会提供自动补全与校验。你也可以用 `vct config schema` 自行打印该 schema。由旧版 vct 生成的文件会在下次被 vct 读取时就地升级到当前布局(也可用 `vct config migrate` 手动触发),因此升级后绝不会停留在过时的格式上。该升级也会把你的文件写入之后才发布的额度面板补进来——但只补一次。你再次删除该名称后它就不会回来,而你先前已经移除的面板也绝不会被重新加回。
553
554
 
554
555
  ```toml
555
556
  #:schema https://raw.githubusercontent.com/Mai0313/VibeCodingTracker/main/vct.schema.json
@@ -558,6 +559,9 @@ vct 会把用户设置保存在 `~/.vct/config.toml` 中。该文件会在**首
558
559
  # 未指定 --daily/--weekly/--monthly/--all flag 时使用的默认时间范围
559
560
  # 取值之一: "daily" | "weekly" | "monthly" | "all"
560
561
  default_time_range = "all"
562
+ # 该文件的布局版本, 由 vct 标记. 只有升级流程会读取它;
563
+ # 除非你想让某次过去的升级再跑一遍, 否则不要动它.
564
+ version = 2
561
565
 
562
566
  [usage]
563
567
  # 启动 usage 面板时就把跨 provider 前缀的 model 合并显示
@@ -567,8 +571,8 @@ merge_models = false
567
571
  refresh_interval = 10
568
572
 
569
573
  [usage.quota]
570
- # 显示哪些实时额度面板; 删除某个名称即可隐藏该面板, 用空列表 ([]) 隐藏整栏
571
- panels = ["claude", "codex", "copilot", "cursor"]
574
+ # 显示哪些实时额度面板; 删除某个名称即可隐藏该面板, 用空列表 ([]) 全部隐藏
575
+ panels = ["claude", "codex", "copilot", "cursor", "grok"]
572
576
  # 每个 provider 共用的实时额度面板轮询间隔秒数 (最小为 1)
573
577
  refresh_interval = 60
574
578
 
@@ -604,9 +608,10 @@ retention_days = 7
604
608
  | 设置项 | 作用 |
605
609
  | ------------------------------ | --------------------------------------------------------------------------------------------------------------- |
606
610
  | `general.default_time_range` | 当你没有传入 `--daily/--weekly/--monthly/--all` 时使用的时间范围。显式传入的 flag 始终优先。 |
611
+ | `general.version` | vct 标记在文件上的布局版本,让后续版本新增的面板只会向你提供一次。 |
607
612
  | `usage.merge_models` | 让面板启动时就处于合并状态;`m` 切换会把你上次的选择保存回这里。`--merge-providers` 会强制开启。 |
608
613
  | `usage.refresh_interval` | `usage` 面板的自动刷新间隔(秒)。 |
609
- | `usage.quota.panels` | 显示哪些额度面板(`claude` / `codex` / `copilot` / `cursor`);删除名称即可隐藏,`[]` 隐藏整栏。 |
614
+ | `usage.quota.panels` | 显示哪些额度面板(`claude` / `codex` / `copilot` / `cursor` / `grok`);删除名称即可隐藏,`[]` 全部隐藏。 |
610
615
  | `usage.quota.refresh_interval` | 每个实时额度面板的轮询间隔(秒);数值越大越不容易触发 provider 的速率限制。 |
611
616
  | `analysis.refresh_interval` | `analysis` 面板的自动刷新间隔(秒)。 |
612
617
  | `performance.scan_threads` | CLI scan worker 数. `0` 优先采用正数的 `RAYON_NUM_THREADS`, 否则最多使用两个 worker; 所有值都会受 CPU 数量限制. |
package/README.zh-TW.md CHANGED
@@ -68,7 +68,7 @@
68
68
  | **智慧定價** | 模糊模型比對 + 每日從 LiteLLM cache 更新 |
69
69
  | **4 種顯示模式** | 互動式 TUI、靜態表格、純文字及 JSON |
70
70
  | **雙重分析** | Token / 費用統計(`usage`)+ 程式碼操作統計(`analysis`) |
71
- | **即時額度面板** | 即時顯示 Claude、Codex、Copilot 與 Cursor 的剩餘額度 |
71
+ | **即時額度面板** | 即時顯示 Claude、Codex、Copilot、Cursor 與 Grok 的額度用量 |
72
72
  | **超輕量** | TUI 常駐記憶體 ~50 MB 以內、精簡的 incremental scan, 以 Rust 打造 |
73
73
  | **即時更新** | 響應式 loading 與背景 refresh, 並突顯變更 |
74
74
 
@@ -216,23 +216,24 @@ vct usage --table --merge-providers
216
216
  ### 預覽:互動式儀表板(`vct usage`)
217
217
 
218
218
  ```
219
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
220
- │ Model Input Output Cache Read Cache Write Total Cost (USD) │
221
- │ │
222
- │ gemini-3.1-pro-preview 129K 10.3K 67.4K 0 207K $0.40 │
223
- │ claude-haiku-4-5-20251001 5.57K 19.8K 4.63M 620K 5.27M $1.34 │
224
- │ claude-opus-4-8 25.7K 179K 40.8M 2.57M 43.6M $77.59 │
225
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
226
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
227
- │ Provider Tokens Cost │
228
- │ │
229
- │ Claude 48.9M $78.93 │
230
- │ Gemini 207K $0.40 │
231
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
232
- ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
233
- │ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB | CPU: 17.9% │
234
- └─────────────────────────────────────────────────────────────────────────────────────────────┘
235
- ↑/↓ scroll m merge r refresh q quit | Star on GitHub
219
+ ┌ Models · $79.33 · 49.1M tokens · 3 models ────────────────────────── −2 cols ┐┌ Providers ───────────────────────────┐
220
+ │Model Input Output Total Cost (USD) █│Provider Tokens Cost │
221
+ │ █│ │
222
+ │gemini-3.1-pro-preview 129K 10.3K 207K $0.40█│Claude 48.9M $78.93 │
223
+ │claude-haiku-4-5-20251001 5.57K 19.8K 5.28M $1.34█│Gemini 207K $0.40 │
224
+ │claude-opus-4-8 25.7K 179K 43.6M $77.59█│ │
225
+ │ █│ │
226
+ │ █│ │
227
+ └──────────────────────────────────────────────────────────────────────────────┘└──────────────────────────────────────┘
228
+ ┌ Claude ──────────────┐┌ Codex ───────────────┐┌ Copilot ─────────────┐┌ Cursor ────────LIMIT ┐┌ Grok ────────────────┐
229
+ │max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
230
+ │5h ▰▱▱▱▱ 13% 1h42m││5h ▰▰▱▱▱ 33% 12m ││prem ▰▱▱▱▱ 3% 24d0h││total ▰▰▰▰▰ 94% 16d0h││week ▰▰▱▱▱ 38% 3d4h │
231
+ │7d ▰▰▰▱▱ 58% 1d23h││7d ▰▰▱▱▱ 36% 1h54m││reqs ▰▱▱▱▱ 45/1500 ││auto ▰▰▰▰▰ 100% 16d0h││ondmd $4.20/$50.00 │
232
+ │Fable ▰▰▰▰▱ 79% 1d23h││credits 0 · +3 reset ││ ││api ▰▰▰▱▱ 44% 16d0h││balance $12.00 │
233
+ │bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
234
+ └──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
235
+ Total Cost: $79.33 | Total Tokens: 49.1M | Models: 3 | Memory: 4.7 MB | CPU: 0.0%
236
+ ↑/↓ scroll m merge p hide Q quota r refresh q quit | Star on GitHub
236
237
  ```
237
238
 
238
239
  兩個互動式儀表板都會在 terminal setup 完成後立即繪製置中的 `Loading sessions...` spinner. Loading 期間仍可處理 `q`, Ctrl+C 與 resize event. 後續掃描由單一 background worker 執行, 並在 `Refreshing...` footer 下保留上一次成功的資料. 重複的 refresh 要求最多只會合併為一個 pending scan. 如果 refresh 失敗, 儀表板會保留 last-known-good view, 並在下次排程或手動刷新時重試.
@@ -290,7 +291,7 @@ Totals (by Provider)
290
291
  此工具會自動掃描以下目錄:
291
292
 
292
293
  - `~/.claude/projects/**/*.jsonl`(Claude Code,遞迴包含 subagent 日誌)
293
- - `~/.codex/sessions/**/*.jsonl`(Codex,遞迴包含每日子目錄)
294
+ - `~/.codex/sessions/**/*.jsonl`(Codex,遞迴包含每日子目錄),以及 `~/.codex/archived_sessions/*.jsonl`——封存工作階段時 Codex 會把日誌移進這個扁平目錄(同時存在於兩處的工作階段只會計入一次)
294
295
  - `~/.copilot/session-state/<sessionId>/events.jsonl`(Copilot CLI)
295
296
  - `~/.gemini/tmp/<project_hash>/chats/*.jsonl`(Gemini CLI)
296
297
  - `~/.local/share/opencode/opencode.db`(OpenCode,SQLite 資料庫;遵循 `$XDG_DATA_HOME`)
@@ -298,33 +299,33 @@ Totals (by Provider)
298
299
  - `~/.hermes/state.db`(Hermes,SQLite 資料庫,遵循 `$HERMES_HOME`;僅 `usage`)
299
300
  - `$GROK_HOME/sessions/*/*/signals.json`(Grok CLI,預設使用 `~/.grok`;同層的 `updates.jsonl` 提供 `analysis` 資料)
300
301
 
301
- Grok 的 `usage` 是單一當下的本地 context 估算:vct 會把 `signals.json` 的 `contextTokensUsed` 記為 cache-read token,並以該 model 的 cache-read 費率估算費用。這不是累計的 billed usage。`analysis` 會從同層的 `updates.jsonl` 還原已完成的 Read / Write / Edit / Bash / TodoWrite 操作。Grok 不支援 quota panel 或 `vct quota`。
302
+ Grok 的 `usage` 是單一當下的本地 context 估算:vct 會把 `signals.json` 的 `contextTokensUsed` 記為 cache-read token,並以該 model 的 cache-read 費率估算費用。這不是累計的 billed usage。`analysis` 會從同層的 `updates.jsonl` 還原已完成的 Read / Write / Edit / Bash / TodoWrite 操作。想知道實際計費的額度用量,請參考下方的 Grok 額度面板。
302
303
 
303
304
  對於非互動式 `usage` 與 `analysis` 掃描, 如果所有找到的 source 都失敗, vct 會回傳錯誤. 如果只有部分 source 失敗, vct 會保留成功的結果, 並向 stderr 印出一則診斷摘要. TUI 則保持 best-effort, 並保留上一次成功的 payload.
304
305
 
305
306
  ### 即時額度面板
306
307
 
307
- `vct usage` 會**在儀表板中直接顯示 Claude Code、Codex、GitHub Copilot 與 Cursor 的即時剩餘額度——完全零設定。** 不需要 status-line hook,也不需要手動輸入憑證:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。(想要更清爽的儀表板嗎?在 [`config.toml`](#%E8%A8%AD%E5%AE%9A) 中精簡 `[usage.quota]` 下的 `panels`,或設為 `[]` 隱藏整條。)
308
+ `vct usage` 會**在儀表板中直接顯示 Claude Code、Codex、GitHub Copilot、Cursor 與 Grok 的即時額度用量——完全零設定。** 不需要 status-line hook,也不需要手動輸入憑證:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。每個進度條都是**已用**百分比,所以進度條滿格代表該額度週期已用盡,而不是還沒開始用。(想要更清爽的儀表板嗎?在 [`config.toml`](#%E8%A8%AD%E5%AE%9A) 中精簡 `[usage.quota]` 下的 `panels`,或設為 `[]` 隱藏所有額度卡片。Provider Usage 側欄是本機掃描資料而不是額度面板,所以它有自己的 `p` 開關。)
308
309
 
309
310
  ```
310
- ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
311
- │ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
312
- │ 5h ▰▱▱▱▱ 13% ↻ 1h42m││ 5h ▰▰▱▱▱ 33% ↻ 12m ││ prem ▰▱▱▱▱ 3% ↻ 24d ││ total ▰▰▰▰▰ 94% ↻ 16d │
313
- │ 7d ▰▰▰▱▱ 58% ↻ 1d23h││ 7d ▰▰▱▱▱ 36% ↻ 1h54m││ reqs ▰▱▱▱▱ 45/1500 ││ auto ▰▰▰▰▰ 100% ↻ 16d │
314
- │ Fable ▰▰▰▰▱ 79% ↻ 1d23h││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 44% ↻ 16d │
315
- │ Balance: - $0.00 used ││ reset expires 17d0h ││ ││ updated just now │
316
- │ updated just now ││ updated just now ││ ││ │
317
- └─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
311
+ ┌ Claude ──────────────┐┌ Codex ───────────────┐┌ Copilot ─────────────┐┌ Cursor ────────LIMIT ┐┌ Grok ────────────────┐
312
+ │max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
313
+ │5h ▰▱▱▱▱ 13% 1h42m││5h ▰▰▱▱▱ 33% 12m ││prem ▰▱▱▱▱ 3% 24d0h││total ▰▰▰▰▰ 94% 16d0h││week ▰▰▱▱▱ 38% 3d4h │
314
+ │7d ▰▰▰▱▱ 58% 1d23h││7d ▰▰▱▱▱ 36% 1h54m││reqs ▰▱▱▱▱ 45/1500 ││auto ▰▰▰▰▰ 100% 16d0h││ondmd $4.20/$50.00 │
315
+ │Fable ▰▰▰▰▱ 79% 1d23h││credits 0 · +3 reset ││ ││api ▰▰▰▱▱ 44% 16d0h││balance $12.00 │
316
+ │bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
317
+ └──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
318
318
  ```
319
319
 
320
320
  - **Claude** — 方案類型、5 小時、每週以及單模型每週用量,來自官方 OAuth 用量 API(`GET /api/oauth/usage`),從 `~/.claude/.credentials.json` 讀取,並顯示額度餘額。約每分鐘輪詢一次以避開該端點的速率限制;觸及上限時標題會出現紅色 `LIMIT` 標記。單模型每週那一行屬於盡力而為,未回傳該範圍時就自動隱藏。
321
321
  - **Codex** — 方案類型、5 小時和每週用量、額度餘額以及已取得的可用 reset credit 中最早的到期時間,使用 `~/.codex/auth.json` 從 ChatGPT 後端(`wham/usage` + `wham/rate-limit-reset-credits`)取得(在適用時顯示大致剩餘訊息數 / 消費上限);API 無法使用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `Codex` 或 `Codex (session)`)。
322
322
  - **Copilot** — 方案類型以及你的 premium 請求額度,以兩個進度條呈現:已用百分比,以及已用 / 總量請求數(例如 `45/1500`),來自 GitHub 的 Copilot API(`GET /copilot_internal/user`),從 `~/.copilot/config.json` 讀取。該請求會模擬 Copilot CLI。token 為長期有效,因此不需要刷新;遇到 `401` / `403` 時會顯示 `run: copilot login` 提示。
323
323
  - **Cursor** — 方案類型、total / auto / API **已用**百分比,以及按需消費,來自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被動式的:vct 每次輪詢都會重新讀取該檔案,並在 token 有效期內使用它,因為官方 Cursor 用戶端會讓它保持最新。
324
+ - **Grok** — 方案類型以及目前每週或每月週期的內含額度用量,來自 Grok CLI 自己的計費端點(`GET /v1/billing?format=credits`),從 `~/.grok/auth.json` 讀取。預付餘額只有在不為零時才會顯示;按量計費的消費則在你有過消費、或設定了上限之後才會顯示。該請求會模擬 Grok CLI;遇到 `401` / `403` 時會顯示 `run: grok login` 提示。
324
325
 
325
- **自動刷新 token。** 對 Claude 和 Codex,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式),因此 token 會在多次檢查之間重複使用,而不是每次都重新刷新。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。Copilot(長期有效的 token)和 Cursor(由其自身用戶端保持最新)為唯讀——vct 從不寫入它們的憑證檔案。
326
+ **自動刷新 token。** 對 Claude、Codex 和 Grok,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式),因此 token 會在多次檢查之間重複使用,而不是每次都重新刷新。Grok 的 token 端點會如同它自己的 CLI 一樣,從登入的 issuer 解析出來,而不是寫死在程式裡;寫入時也會保留該檔案中其他所有的登入資訊。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。Copilot(長期有效的 token)和 Cursor(由其自身用戶端保持最新)為唯讀——vct 從不寫入它們的憑證檔案。
326
327
 
327
- 只有在某個 provider 的憑證存在時,才會顯示對應的面板。當四個面板都顯示時,Provider Usage 表格會從這一列中折疊隱藏;在較窄的寬度下,面板會折行成 2×2 網格。額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
328
+ 只有在某個 provider 的憑證存在時,才會顯示對應的面板。面板排在一個統一網格上:一列放得下幾張就放幾張,放不下的自動折到下一列,因此新增一個 provider 只是多一張卡片,不會多一條排版規則。當終端高度不足以留給網格時,它會收成一行摘要,顯示放得下的 gauge,並把其餘的記成數量;按 `Q` 開啟完整的額度浮層,無論終端多大,每張卡片都放得下全部內容,按 `p` 可切換 Provider Usage 側欄。額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
328
329
 
329
330
  > **平台說明:** 在 macOS 上,Claude Code 會把 OAuth 憑證儲存在系統 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不會顯示 Claude 面板。Cursor 的 `~/.config/cursor` 憑證路徑偏向 Linux。
330
331
 
@@ -382,23 +383,22 @@ vct analysis --json --daily > today.json
382
383
  ### 預覽:互動式儀表板(`vct analysis`)
383
384
 
384
385
  ```
385
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
386
- │ Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write │
387
- │ │
388
- │ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 0 │
389
- │ claude-opus-4-8 1.28K 13.3K 1.58K 82 146 209 18 62 │
390
- │ gemini-3.1-pro-preview 0 0 0 0 0 0 0 0 │
391
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
392
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
393
- │ Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
394
- │ │
395
- │ Claude 1.28K 13.3K 1.58K 125 146 268 18 62 3 │
396
- │ Gemini 0 0 0 0 0 0 0 0 1 │
397
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
398
- ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
399
- │ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB | CPU: 17.9% │
400
- └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
401
- ↑/↓ scroll r refresh q quit | Star on GitHub
386
+ ┌ Models · 135K lines · 1.80K tool calls · 3 models ───────────────────────────────────────────────────────────────────┐
387
+ │Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write █
388
+ │ █
389
+ │claude-opus-4-8 12.4K 88.1K 9.02K 412 231 604 96 88█
390
+ │gemini-3.1-pro-preview 2.10K 14.8K 1.62K 84 44 112 16 15█
391
+ │claude-haiku-4-5-20251001 840 5.40K 610 31 16 42 6 5█
392
+ │ █
393
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
394
+ ┌ Providers ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
395
+ │Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days │
396
+ │ │
397
+ │Claude 13.2K 93.5K 9.63K 443 247 646 102 93 12 │
398
+ │Gemini 2.10K 14.8K 1.62K 84 44 112 16 15 3 │
399
+ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
400
+ Total Lines: 135K | Total Tools: 1.80K | Models: 3 | Memory: 4.8 MB | CPU: 0.0%
401
+ ↑/↓ scroll r refresh q quit | Star on GitHub
402
402
  ```
403
403
 
404
404
  ### 預覽:表格與 JSON(`vct analysis`)
@@ -513,7 +513,7 @@ Binary version 由 `build.rs` 在編譯期透過 `git describe` 寫入,開發
513
513
 
514
514
  **印出某個供應商的原始 quota/usage API 回應 — 不解析、不彙整。**
515
515
 
516
- 對 `usage` 面板使用的同一個 quota 端點(Claude / Codex / Copilot / Cursor)發一次請求,直接印出原始 body,方便你檢視 API 的實際結構或確認憑證是否正常。它讀取各供應商已儲存的憑證,而且**不會**刷新 token:token 過期時,請用對應供應商自己的 CLI 重新登入(`claude` / `codex` / `copilot` / `cursor-agent`)。
516
+ 對 `usage` 面板使用的同一個 quota 端點(Claude / Codex / Copilot / Cursor / Grok)發一次請求,直接印出原始 body,方便你檢視 API 的實際結構或確認憑證是否正常。它讀取各供應商已儲存的憑證,而且**不會**刷新 token:token 過期時,請用對應供應商自己的 CLI 重新登入(`claude` / `codex` / `copilot` / `cursor-agent` / `grok`)。
517
517
 
518
518
  > 舊名稱 `vct fetch` 保留為隱藏別名,現有 script 仍可繼續使用。
519
519
 
@@ -534,6 +534,7 @@ vct quota claude
534
534
  vct quota codex
535
535
  vct quota copilot
536
536
  vct quota cursor
537
+ vct quota grok
537
538
 
538
539
  # 攤平成純文字
539
540
  vct quota codex --text
@@ -549,7 +550,7 @@ vct quota copilot --table
549
550
 
550
551
  ## 設定
551
552
 
552
- vct 會把使用者設定存放在 `~/.vct/config.toml`。這個檔案會在**首次執行時以預設值自動建立**,所以你完全不必手動撰寫,只有想更改某個預設值時才需要編輯它。它由 vct 的型別化設定產生,並在第一行帶有 `#:schema` 指令,因此支援 schema 的 TOML 編輯器(taplo / VS Code 的 "Even Better TOML")會提供自動補全與驗證。你也可以用 `vct config schema` 自行印出該 schema。由舊版 vct 產生的檔案會在下次被 vct 讀取時就地升級到目前的版面(也可用 `vct config migrate` 手動觸發),因此升級後絕不會停留在過時的格式上。
553
+ vct 會把使用者設定存放在 `~/.vct/config.toml`。這個檔案會在**首次執行時以預設值自動建立**,所以你完全不必手動撰寫,只有想更改某個預設值時才需要編輯它。它由 vct 的型別化設定產生,並在第一行帶有 `#:schema` 指令,因此支援 schema 的 TOML 編輯器(taplo / VS Code 的 "Even Better TOML")會提供自動補全與驗證。你也可以用 `vct config schema` 自行印出該 schema。由舊版 vct 產生的檔案會在下次被 vct 讀取時就地升級到目前的版面(也可用 `vct config migrate` 手動觸發),因此升級後絕不會停留在過時的格式上。這個升級也會把你的檔案寫入之後才推出的額度面板補上——但只補一次。你再次移除那個名稱後它就會一直保持移除,而你先前已經拿掉的面板也絕不會被加回來。
553
554
 
554
555
  ```toml
555
556
  #:schema https://raw.githubusercontent.com/Mai0313/VibeCodingTracker/main/vct.schema.json
@@ -558,6 +559,9 @@ vct 會把使用者設定存放在 `~/.vct/config.toml`。這個檔案會在**
558
559
  # 未指定 --daily/--weekly/--monthly/--all flag 時使用的預設時間範圍。
559
560
  # 可選值:"daily" | "weekly" | "monthly" | "all"
560
561
  default_time_range = "all"
562
+ # 這個檔案的版面版本,由 vct 標記。只有升級流程會讀取它;
563
+ # 除非你想讓過去的升級再跑一次,否則別去動它。
564
+ version = 2
561
565
 
562
566
  [usage]
563
567
  # 啟動 usage 儀表板時,是否先把不同 provider 前綴的 model 合併。
@@ -567,8 +571,8 @@ merge_models = false
567
571
  refresh_interval = 10
568
572
 
569
573
  [usage.quota]
570
- # 顯示哪些即時額度面板;移除某個名稱即可隱藏該面板,用空列表 ([]) 隱藏整條。
571
- panels = ["claude", "codex", "copilot", "cursor"]
574
+ # 顯示哪些即時額度面板;移除某個名稱即可隱藏該面板,用空列表 ([]) 全部隱藏。
575
+ panels = ["claude", "codex", "copilot", "cursor", "grok"]
572
576
  # 每個 provider 共用的即時額度面板輪詢間隔秒數(最少 1)。
573
577
  refresh_interval = 60
574
578
 
@@ -604,9 +608,10 @@ retention_days = 7
604
608
  | 設定項 | 效果 |
605
609
  | ------------------------------ | ------------------------------------------------------------------------------------------------------------- |
606
610
  | `general.default_time_range` | 未指定 `--daily/--weekly/--monthly/--all` 時使用的時間範圍。明確指定的 flag 一律優先。 |
611
+ | `general.version` | vct 標記在檔案上的版面版本,讓後續版本新增的面板只會向你提議一次。 |
607
612
  | `usage.merge_models` | 讓儀表板一開始就是合併狀態;`m` 切換會把你最後的選擇存回這裡。`--merge-providers` 會強制開啟。 |
608
613
  | `usage.refresh_interval` | `usage` 儀表板自動刷新的間隔(秒)。 |
609
- | `usage.quota.panels` | 顯示哪些額度面板(`claude` / `codex` / `copilot` / `cursor`);移除名稱即可隱藏,`[]` 隱藏整條。 |
614
+ | `usage.quota.panels` | 顯示哪些額度面板(`claude` / `codex` / `copilot` / `cursor` / `grok`);移除名稱即可隱藏,`[]` 全部隱藏。 |
610
615
  | `usage.quota.refresh_interval` | 每個即時額度面板的輪詢間隔(秒);數值越大越不容易觸發 provider 的速率限制。 |
611
616
  | `analysis.refresh_interval` | `analysis` 儀表板自動刷新的間隔(秒)。 |
612
617
  | `performance.scan_threads` | CLI scan worker 數. `0` 優先採用正數的 `RAYON_NUM_THREADS`, 否則最多使用兩個 worker; 所有值都受 CPU 數量限制. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/vct",
3
- "version": "2.2.4",
3
+ "version": "2.3.1",
4
4
  "description": "Vibe Coding Tracker - AI coding assistant telemetry/usage parser, aggregate JSONL events into CodeAnalysis results",
5
5
  "author": "Wei Lee <mai@mai0313.com>",
6
6
  "license": "MIT",