@mai0313/vct 2.11.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -69
- package/README.zh-CN.md +122 -67
- package/README.zh-TW.md +122 -67
- 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
|
@@ -30,7 +30,7 @@ Built with Rust for minimal resource footprint. The interactive TUI dashboard ty
|
|
|
30
30
|
|
|
31
31
|
Choose your preferred view:
|
|
32
32
|
|
|
33
|
-
- **Interactive Dashboard**:
|
|
33
|
+
- **Interactive Dashboard**: One terminal app with Usage, Analysis, Quota and Settings tabs, an immediate loading spinner, background incremental refreshes, a scrollable, sortable model list (arrow keys), a live per-process CPU/memory readout, and compact K/M/B number formatting
|
|
34
34
|
- **Static Reports**: Professional tables for documentation
|
|
35
35
|
- **Script-Friendly**: Plain text and JSON for automation
|
|
36
36
|
- **Full Precision**: Export exact costs for accounting
|
|
@@ -110,13 +110,13 @@ cargo install vct-cli
|
|
|
110
110
|
### First Run
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
#
|
|
114
|
-
vct
|
|
113
|
+
# Open the interactive app on the Usage tab
|
|
114
|
+
vct
|
|
115
115
|
|
|
116
116
|
# Or run the binary built by Cargo/pip
|
|
117
|
-
vibe_coding_tracker
|
|
117
|
+
vibe_coding_tracker
|
|
118
118
|
|
|
119
|
-
#
|
|
119
|
+
# Open it on the Analysis tab (code operations across all sessions)
|
|
120
120
|
vct analysis
|
|
121
121
|
```
|
|
122
122
|
|
|
@@ -126,7 +126,26 @@ vct analysis
|
|
|
126
126
|
|
|
127
127
|
Run `vct --help` to list the commands, and `vct <command> --help` for a command's flags.
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
`vct` with no command opens the interactive app, one screen with four tabs: `1 Usage`, `2 Analysis`, `3 Quota` and `4 Settings`. `vct usage`, `vct analysis` and `vct quota` open the same app on their own tab, while `--json`, `--text` and `--table` print and never open it. Without a terminal (piped or redirected), a bare `vct` prints the help and exits with status 2.
|
|
130
|
+
|
|
131
|
+
| Key | Action |
|
|
132
|
+
| ------------------- | ------------------------------------------------------------------- |
|
|
133
|
+
| `1`-`4` | Jump to a tab |
|
|
134
|
+
| `Tab` / `Shift+Tab` | Next / previous tab |
|
|
135
|
+
| `↑` / `↓` | Move the selected row |
|
|
136
|
+
| `Enter` | Show the selected model's full numbers (Usage, Analysis) |
|
|
137
|
+
| `←` / `→` | Sort by the column to the left / right (Usage, Analysis) |
|
|
138
|
+
| `[` / `]` | Earlier / later time range: day, week, month, all (Usage, Analysis) |
|
|
139
|
+
| `r` | Refresh now (Usage, Analysis) |
|
|
140
|
+
| `m` | Merge / split provider prefixes, saved to the config file (Usage) |
|
|
141
|
+
| `p` | Open the Provider Usage panel (Usage) |
|
|
142
|
+
| `?` | List the current tab's keys |
|
|
143
|
+
| `Esc` | Close the open panel |
|
|
144
|
+
| `q` | Quit |
|
|
145
|
+
|
|
146
|
+
The Quota and Settings tabs scan no sessions. The first visit to Usage or Analysis starts that tab's scan, and only the tab on screen refreshes on its timer. The right side of the tab bar shows the time range and vct's own memory and CPU.
|
|
147
|
+
|
|
148
|
+
Time range flags (shared by `usage` and `analysis`, mutually exclusive, default `--all`; in the app they set the range it opens with):
|
|
130
149
|
|
|
131
150
|
| Flag | Window |
|
|
132
151
|
| ------------- | --------------------------------- |
|
|
@@ -144,7 +163,7 @@ Time range flags (shared by `usage` and `analysis`, mutually exclusive, default
|
|
|
144
163
|
### Basic Usage
|
|
145
164
|
|
|
146
165
|
```bash
|
|
147
|
-
#
|
|
166
|
+
# Open the app on the Usage tab (recommended)
|
|
148
167
|
vct usage
|
|
149
168
|
|
|
150
169
|
# Static table for reports
|
|
@@ -170,36 +189,36 @@ vct usage --table --merge-providers
|
|
|
170
189
|
```
|
|
171
190
|
|
|
172
191
|
> [!NOTE]
|
|
173
|
-
>
|
|
192
|
+
> `--table` and `--text` sort model rows by cost in ascending order, so the highest-spending model is listed last (right above the `TOTAL` row in `--table`); `--json` lists its rows in no fixed order. The app sorts by cost, highest first, and `←` / `→` move the sort to the column on that side, whose header is highlighted. The right side of the table title names the current sort (`sort: cost ▼`). The app also hides models with zero usage in the selected range.
|
|
174
193
|
|
|
175
194
|
> [!TIP]
|
|
176
|
-
> The same model can show up as several rows when it is routed under different provider prefixes (`openai/gpt-5.5`, `azure/gpt-5.5`, plain `gpt-5.5`). `--merge-providers` collapses rows that share the base name after the first `/` (versions like `gpt-5.5` vs `gpt-5.4` stay separate) and sums their already-priced cost.
|
|
195
|
+
> The same model can show up as several rows when it is routed under different provider prefixes (`openai/gpt-5.5`, `azure/gpt-5.5`, plain `gpt-5.5`). `--merge-providers` collapses rows that share the base name after the first `/` (versions like `gpt-5.5` vs `gpt-5.4` stay separate) and sums their already-priced cost. On the Usage tab, press `m` to toggle it live (the choice is saved to `~/.vct/config.toml`, so the next launch remembers it); `--merge-providers` opens the tab already merged. `--json` is left as the raw per-model export.
|
|
177
196
|
|
|
178
|
-
### Preview:
|
|
197
|
+
### Preview: Usage Tab (`vct usage`)
|
|
179
198
|
|
|
180
199
|
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
│
|
|
184
|
-
│
|
|
185
|
-
│claude-
|
|
186
|
-
│claude-
|
|
187
|
-
│
|
|
188
|
-
│
|
|
200
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings range day week month all 61.8 MB · CPU 0.1%
|
|
201
|
+
┌ Models · $79.33 · 49.1M tokens · 3 models ───────────────────────────────────────────────────────────── sort: cost ▼ ┐
|
|
202
|
+
│Model Input Output Cache Read Cache Write Total Cost (USD) Share│
|
|
203
|
+
│ │
|
|
204
|
+
│claude-opus-4-8 25.7K 179K 42.9M 496K 43.6M $77.59 ━━━━━━━━━ 88.8%│
|
|
205
|
+
│claude-haiku-4-5-20251001 5.57K 19.8K 5.20M 55.0K 5.28M $1.34 ━ 10.8%│
|
|
206
|
+
│gemini-3.1-pro-preview 129K 10.3K 66.0K 1.70K 207K $0.40 0.4%│
|
|
207
|
+
│ │
|
|
208
|
+
│ │
|
|
189
209
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
190
|
-
|
|
191
|
-
┌ Claude
|
|
210
|
+
● Claude $78.93 ● Gemini $0.40
|
|
211
|
+
┌ ● Claude ────────────┐┌ ● Codex ─────────────┐┌ ● Copilot ───────────┐┌ ● Cursor ──────LIMIT ┐┌ ● Grok ──────────────┐
|
|
192
212
|
│max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
|
|
193
|
-
│5h
|
|
194
|
-
│7d
|
|
195
|
-
│Fable
|
|
213
|
+
│5h ━──── 13% 1h42m││5h ━━─── 33% 12m ││prem ━──── 3% 24d0h││total ━━━━━ 94% 16d0h││week ━━─── 38% 3d4h │
|
|
214
|
+
│7d ━━━── 58% 1d23h││7d ━━─── 36% 1h54m││reqs ━──── 45/1500 ││auto ━━━━━ 100% 16d0h││ondmd $4.20/$50.00 │
|
|
215
|
+
│Fable ━━━━─ 79% 1d23h││credits 0 · +3 reset ││ ││api ━━━── 44% 16d0h││balance $12.00 │
|
|
196
216
|
│bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
|
|
197
217
|
└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
|
|
198
|
-
|
|
199
|
-
↑/↓ scroll m merge p providers Q quota r refresh q quit | Star on GitHub
|
|
218
|
+
↑↓ move ←→ sort [ ] range p providers m merge ⏎ details r refresh 1-4/tab view ? help q quit Star on GitHub
|
|
200
219
|
```
|
|
201
220
|
|
|
202
|
-
|
|
221
|
+
The Usage and Analysis tabs each start their scan on the first visit and draw a centered `Loading sessions...` spinner. Loading stays responsive to `q`, Ctrl+C, and resize events. Later scans keep the last successful data visible with a `Refreshing...` footer. A failed refresh keeps the last-known-good view and retries on the next scheduled or manual refresh. A range with no sessions shows an empty table.
|
|
203
222
|
|
|
204
223
|
### Preview: Table & JSON (`vct usage`)
|
|
205
224
|
|
|
@@ -287,8 +306,8 @@ hosts = ["devbox", "wei@laptop"]
|
|
|
287
306
|
|
|
288
307
|
vct then runs `vct ledger export` on each host over ssh and folds what comes back into every total. Only that machine's ledger crosses the connection, which is per-day token counts and tool counters: conversations, databases and credentials stay where they are. Each host needs vct installed, in a version that has `ledger export`, and a login that works without a prompt, because vct runs `ssh` in batch mode: a key, an agent, or whatever your `~/.ssh/config` sets up for that name.
|
|
289
308
|
|
|
290
|
-
- A one-shot command (`--json`, `--text`, `--table`) fetches first and waits up to 30 seconds per host. A host's first export parses its whole history and can outlast that wait; it finishes there anyway, so the next run gets it. The
|
|
291
|
-
- A host that cannot be reached keeps showing its last fetched data, with a warning on stderr for a one-shot command and in the log for
|
|
309
|
+
- A one-shot command (`--json`, `--text`, `--table`) fetches first and waits up to 30 seconds per host. A host's first export parses its whole history and can outlast that wait; it finishes there anyway, so the next run gets it. The app fetches in the background every `refresh_interval` seconds (default 300) and never waits.
|
|
310
|
+
- A host that cannot be reached keeps showing its last fetched data, with a warning on stderr for a one-shot command and in the log for the app. Taking a host out of `hosts` removes its data.
|
|
292
311
|
- A non-interactive ssh session has a bare `PATH`, so vct looks for the remote binary on `PATH`, in `~/.local/bin`, in `~/.cargo/bin` and under `~/.nvm`. If it is installed elsewhere, set `command` to how to start it.
|
|
293
312
|
- A session both machines hold, as with a shared home directory, counts once. Days are each machine's own local dates. Totals are merged, with no per-machine breakdown.
|
|
294
313
|
- `vct analysis --json`, `vct analysis FILE` and the quota panels stay local.
|
|
@@ -298,18 +317,18 @@ vct then runs `vct ledger export` on each host over ssh and folds what comes bac
|
|
|
298
317
|
`vct usage` shows **live quota usage for Claude Code, Codex, GitHub Copilot, Cursor, Grok, and Antigravity 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 (for Antigravity, asks the `agy` CLI) 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 per-provider cost line under the table is local scan data, not a quota panel, so it stays whatever you set here.)
|
|
299
318
|
|
|
300
319
|
```
|
|
301
|
-
┌ Claude
|
|
320
|
+
┌ ● Claude ────────────┐┌ ● Codex ─────────────┐┌ ● Copilot ───────────┐┌ ● Cursor ──────LIMIT ┐┌ ● Grok ──────────────┐
|
|
302
321
|
│max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
|
|
303
|
-
│5h
|
|
304
|
-
│7d
|
|
305
|
-
│Fable
|
|
322
|
+
│5h ━──── 13% 1h42m││5h ━━─── 33% 12m ││prem ━──── 3% 24d0h││total ━━━━━ 94% 16d0h││week ━━─── 38% 3d4h │
|
|
323
|
+
│7d ━━━── 58% 1d23h││7d ━━─── 36% 1h54m││reqs ━──── 45/1500 ││auto ━━━━━ 100% 16d0h││ondmd $4.20/$50.00 │
|
|
324
|
+
│Fable ━━━━─ 79% 1d23h││credits 0 · +3 reset ││ ││api ━━━── 44% 16d0h││balance $12.00 │
|
|
306
325
|
│bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
|
|
307
326
|
└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
|
|
308
|
-
┌ Antigravity
|
|
327
|
+
┌ ● Antigravity ────+2 ┐
|
|
309
328
|
│- just now│
|
|
310
329
|
│Gemini Models │
|
|
311
|
-
│5h
|
|
312
|
-
│weekly
|
|
330
|
+
│5h ━━─── 23% │
|
|
331
|
+
│weekly ━──── 8% │
|
|
313
332
|
│Claude and GPT models │
|
|
314
333
|
└──────────────────────┘
|
|
315
334
|
```
|
|
@@ -319,11 +338,11 @@ vct then runs `vct ledger export` on each host over ssh and folds what comes bac
|
|
|
319
338
|
- **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.
|
|
320
339
|
- **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`.
|
|
321
340
|
- **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.
|
|
322
|
-
- **Antigravity** — the limits of each shared model pool (for agy: Gemini, and Claude / GPT, each with a 5-hour and a weekly limit), from the `agy` CLI's own `/usage` command (`agy -p /usage --output-format json`). The card names each pool as agy does and labels each limit by agy's own window (`5h` first, then `weekly`); a card too short for every pool flags the rest with `+N
|
|
341
|
+
- **Antigravity** — the limits of each shared model pool (for agy: Gemini, and Claude / GPT, each with a 5-hour and a weekly limit), from the `agy` CLI's own `/usage` command (`agy -p /usage --output-format json`). The card names each pool as agy does and labels each limit by agy's own window (`5h` first, then `weekly`); a card too short for every pool flags the rest with `+N`. `/usage` reports no plan, so the first line shows only the age. vct runs `agy` from your `PATH`, or else from where agy installs (`~/.local/bin/agy`, `%LOCALAPPDATA%\agy\bin\agy.exe`) or where Google's internal Jetski build lives (`/google/bin/releases/jetski-devs/tools/cli` on gLinux, `/usr/local/bin/jetski` on macOS); an agy that has not signed in never hides a Jetski install. agy keeps its own sign-in fresh, so vct only checks that `~/.gemini/antigravity-cli/antigravity-oauth-token` exists and never reads or writes it; Jetski signs in its own way, so finding it is enough. Each poll starts agy (a few seconds and about 260 MB), so this card refreshes at most every 5 minutes. When agy cannot sign in, the card shows a `run: agy acp --login` hint and the dashboard does not run agy again until that file changes.
|
|
323
342
|
|
|
324
343
|
**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). For Grok, 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. Antigravity's token belongs to agy, which refreshes it whenever vct asks it for `/usage`.
|
|
325
344
|
|
|
326
|
-
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. 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
|
|
345
|
+
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. 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 as `+N more → 3`; press `3` for the [Quota tab](#quota-tab), which gives the cards the whole screen, and `p` for the Provider Usage panel with per-provider tokens and share. Quota panels appear only in the interactive TUI; `--table`, `--text`, and `--json` are unchanged.
|
|
327
346
|
|
|
328
347
|
> **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. agy keeps its sign-in in the Keychain there too, so on macOS the Antigravity panel is shown only for Google's internal Jetski build. Cursor's `~/.config/cursor` credential path is Linux-oriented.
|
|
329
348
|
|
|
@@ -338,7 +357,7 @@ See [`tests/fixtures/sessions/`](tests/fixtures/sessions/) for sample inputs and
|
|
|
338
357
|
### Basic Usage
|
|
339
358
|
|
|
340
359
|
```bash
|
|
341
|
-
#
|
|
360
|
+
# Open the app on the Analysis tab, all sessions (default)
|
|
342
361
|
vct analysis
|
|
343
362
|
|
|
344
363
|
# Static table output with per-provider totals
|
|
@@ -367,27 +386,29 @@ vct analysis --json --daily
|
|
|
367
386
|
vct analysis --json --daily > today.json
|
|
368
387
|
```
|
|
369
388
|
|
|
370
|
-
### Preview:
|
|
389
|
+
### Preview: Analysis Tab (`vct analysis`)
|
|
371
390
|
|
|
372
391
|
```
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
│
|
|
376
|
-
│
|
|
377
|
-
│
|
|
378
|
-
│
|
|
379
|
-
│
|
|
392
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings range day week month all 61.9 MB · CPU 0.1%
|
|
393
|
+
┌ Models · 135K lines · 1.80K tool calls · 3 models ─────────────────────────────────────────────── sort: edit lines ▼ ┐
|
|
394
|
+
│Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write│
|
|
395
|
+
│ │
|
|
396
|
+
│claude-opus-4-8 12.4K 88.1K 9.02K 412 231 604 96 88│
|
|
397
|
+
│gemini-3.1-pro-preview 2.10K 14.8K 1.62K 84 44 112 16 15│
|
|
398
|
+
│claude-haiku-4-5-20251001 840 5.40K 610 31 16 42 6 5│
|
|
399
|
+
│ │
|
|
380
400
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
381
401
|
┌ Providers ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
382
|
-
│Provider
|
|
402
|
+
│Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days│
|
|
383
403
|
│ │
|
|
384
|
-
|
|
385
|
-
|
|
404
|
+
│● Claude 13.2K 93.5K 9.63K 443 247 646 102 93 12│
|
|
405
|
+
│● Gemini 2.10K 14.8K 1.62K 84 44 112 16 15 3│
|
|
386
406
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
387
|
-
|
|
388
|
-
↑/↓ scroll r refresh q quit | Star on GitHub
|
|
407
|
+
↑↓ move ←→ sort [ ] range ⏎ details r refresh 1-4/tab view ? help q quit Star on GitHub
|
|
389
408
|
```
|
|
390
409
|
|
|
410
|
+
The table is sorted by edit lines, highest first; `←` / `→` move the sort to the column on that side, and the sorted column's header is highlighted.
|
|
411
|
+
|
|
391
412
|
### Preview: Table & JSON (`vct analysis`)
|
|
392
413
|
|
|
393
414
|
`--table` renders the per-model breakdown plus a per-provider summary (with an Active Days column). `--text` and `--table` are compact projections of the same normalized parser records. `--json` keeps the complete records, including per-operation details and token usage. With no `<FILE>`, the outer array contains one `CodeAnalysis` object per session; with `<FILE>`, stdout is that single object and matches the corresponding shape under [`tests/fixtures/sessions/`](tests/fixtures/sessions/).
|
|
@@ -498,41 +519,39 @@ vct version --json # Machine-readable JSON
|
|
|
498
519
|
|
|
499
520
|
---
|
|
500
521
|
|
|
501
|
-
##
|
|
522
|
+
## Quota Command
|
|
523
|
+
|
|
524
|
+
**The live quota panels full screen, or one provider's raw quota/usage API response.**
|
|
502
525
|
|
|
503
|
-
|
|
526
|
+
### Quota Tab
|
|
504
527
|
|
|
505
|
-
`vct
|
|
528
|
+
`vct quota` opens the app on the Quota tab. It shows the same quota cards as the Usage tab with wider gauge bars, as many as the terminal fits (a `+N hidden, enlarge the terminal` note counts the rest). It scans no session, so it opens at once and is light enough to leave running in a spare pane. It follows the same settings: `panels` and `refresh_interval` under `[usage.quota]` in [`config.toml`](#configuration).
|
|
506
529
|
|
|
507
530
|
```bash
|
|
508
|
-
vct
|
|
531
|
+
vct quota
|
|
509
532
|
```
|
|
510
533
|
|
|
511
534
|
```
|
|
512
|
-
Quota
|
|
535
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings 31.6 MB · CPU 0.0%
|
|
513
536
|
|
|
514
|
-
┌ Claude
|
|
537
|
+
┌ ● Claude ────────────────────────────┐┌ ● Codex ─────────────────────────────┐
|
|
515
538
|
│max 5x just now││plus just now│
|
|
516
|
-
│5h
|
|
517
|
-
│7d
|
|
518
|
-
│Fable
|
|
539
|
+
│5h ━━━━━━─────────── 30% ↻ 2h18m ││5h ───────────────── 0% ↻ 4h59m │
|
|
540
|
+
│7d ━━━━━──────────── 28% ↻ 6d3h ││7d ━──────────────── 1% ↻ 6d8h │
|
|
541
|
+
│Fable ━━━────────────── 14% ↻ 6d3h ││credits 0 · +3 reset │
|
|
519
542
|
│bal - · $0.00 used ││reset expires 17d11h │
|
|
520
543
|
└──────────────────────────────────────┘└──────────────────────────────────────┘
|
|
521
544
|
|
|
522
|
-
|
|
545
|
+
1-4/tab view ? help q quit Star on GitHub
|
|
523
546
|
```
|
|
524
547
|
|
|
525
|
-
|
|
548
|
+
> `vct monitor` and the hidden alias `vct fetch` are removed. Use `vct quota` for the cards and `vct quota <provider>` for a raw response.
|
|
526
549
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
**Print a provider's raw quota/usage API response — no parsing, no aggregation.**
|
|
530
|
-
|
|
531
|
-
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`). `vct quota antigravity` instead runs `agy -p /usage --output-format json` once (or Jetski, found the way the dashboard finds it) and prints what it printed; agy refreshes its own token as it does so.
|
|
550
|
+
### Raw Response (`vct quota <provider>`)
|
|
532
551
|
|
|
533
|
-
|
|
552
|
+
With a provider, `vct quota` prints that provider's raw response with no parsing or aggregation. It 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`). `vct quota antigravity` instead runs `agy -p /usage --output-format json` once (or Jetski, found the way the dashboard finds it) and prints what it printed; agy refreshes its own token as it does so.
|
|
534
553
|
|
|
535
|
-
|
|
554
|
+
`--json`, `--text` and `--table` print one provider's response, so `vct quota --json` without a provider is an error.
|
|
536
555
|
|
|
537
556
|
```bash
|
|
538
557
|
# Raw JSON (default)
|
|
@@ -567,6 +586,42 @@ Run `vct config show` to print the file; its comments explain every setting.
|
|
|
567
586
|
> [!NOTE]
|
|
568
587
|
> vct writes diagnostics to `~/.vct/logs/vct-YYYY-MM-DD.log` (plain text, file only — never shown in the dashboard). It stays quiet when healthy (default level `warn`) and the file is created lazily, so a healthy run leaves nothing behind. When a quota fetch fails or a session is skipped, that is where the reason is recorded — bump `logging.level` to `debug` for the full detail.
|
|
569
588
|
|
|
589
|
+
### Settings Tab
|
|
590
|
+
|
|
591
|
+
Press `4` in the app (or `Tab` over to it) to edit every `config.toml` setting as a form: one list of every setting grouped by section, the section list on the left marking where the selection is, and under them the selected field's description, config key and default. A `*` marks a field changed from its default.
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings 31.8 MB · CPU 0.0%
|
|
595
|
+
┌ Sections ──────┐┌ Settings ─────────────────────────────────────────────────────────────────────────────── 27 more ↓ ┐
|
|
596
|
+
│ General ││ General │
|
|
597
|
+
│ › Usage ││ Default time range ‹ all ›│
|
|
598
|
+
│ Analysis ││ Check for updates on start [x] on│
|
|
599
|
+
│ Providers ││ │
|
|
600
|
+
│ Remotes ││ Usage │
|
|
601
|
+
│ Performance ││ Merge models across providers [ ] off│
|
|
602
|
+
│ Logging ││ Redraw interval ‹ 10 s ›│
|
|
603
|
+
│ ││ Quota panel: Claude [x] on│
|
|
604
|
+
│ ││ Quota panel: Codex [x] on│
|
|
605
|
+
│ ││ Quota panel: Copilot [x] on│
|
|
606
|
+
│ ││ Quota panel: Cursor [x] on│
|
|
607
|
+
│ ││ Quota panel: Grok [x] on│
|
|
608
|
+
│ ││ Quota panel: Antigravity [x] on│
|
|
609
|
+
│ ││ Quota poll interval ‹ 60 s ›│
|
|
610
|
+
└────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
611
|
+
┌ Quota panel: Claude · usage.quota.panels ─────────────────────────────────────────────────────────── default: [x] on ┐
|
|
612
|
+
│Which live quota panels to show in the app (by provider name: `claude` / `codex` / `copilot` / `cursor` / `grok` / │
|
|
613
|
+
│`antigravity`). An empty list hides every quota card. │
|
|
614
|
+
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
615
|
+
↑↓ move ←→ change space toggle ⏎ edit x reset e editor 1-4/tab view ? help q quit Star on GitHub
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
- `↑` / `↓` move through every setting, `PgUp` / `PgDn` jump a section, `←` / `→` change a value (toggle, step a number, cycle a choice), `Space` toggles, `x` resets the field to its default, and `e` opens the file in `$VISUAL` / `$EDITOR` and reloads it when the editor exits.
|
|
619
|
+
- `Enter` opens an editor: a list to pick from, a number or text input, or the remote host list (`a` add, `Enter` edit, `d` delete).
|
|
620
|
+
- Each change is written to the file at once and keeps the file's comments.
|
|
621
|
+
- Changes to merge, the refresh intervals, the quota panels, the quota poll interval and the provider toggles show in the running app (quota panels when you leave the Settings tab). Default time range, auto update, scan threads, logging and remotes apply from the next start, and the form says so on those fields.
|
|
622
|
+
|
|
623
|
+
Editing the file by hand and the `vct config` commands below still work.
|
|
624
|
+
|
|
570
625
|
### Managing the file
|
|
571
626
|
|
|
572
627
|
```bash
|
package/README.zh-CN.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
选择你喜欢的查看方式:
|
|
32
32
|
|
|
33
|
-
- **交互式面板**: 可立即显示 loading spinner
|
|
33
|
+
- **交互式面板**: 一个终端 app, 包含 Usage, Analysis, Quota 与 Settings 四个标签页, 可立即显示 loading spinner, 支持后台 incremental refresh, 可滚动并可排序的模型列表 (方向键), 进程级 CPU/内存实时读数, 以及 K/M/B 精简数字格式
|
|
34
34
|
- **静态报表**:专业的表格,适合文档记录
|
|
35
35
|
- **脚本友好**:纯文本和 JSON 格式,方便自动化
|
|
36
36
|
- **完整精度**:导出精确费用,满足财务核算需求
|
|
@@ -110,13 +110,13 @@ cargo install vct-cli
|
|
|
110
110
|
### 首次运行
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
#
|
|
114
|
-
vct
|
|
113
|
+
# Open the interactive app on the Usage tab
|
|
114
|
+
vct
|
|
115
115
|
|
|
116
116
|
# Or run the binary built by Cargo/pip
|
|
117
|
-
vibe_coding_tracker
|
|
117
|
+
vibe_coding_tracker
|
|
118
118
|
|
|
119
|
-
#
|
|
119
|
+
# Open it on the Analysis tab (code operations across all sessions)
|
|
120
120
|
vct analysis
|
|
121
121
|
```
|
|
122
122
|
|
|
@@ -126,7 +126,26 @@ vct analysis
|
|
|
126
126
|
|
|
127
127
|
运行 `vct --help` 可列出所有命令,`vct <command> --help` 则会列出该命令的 flag。
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
不带任何命令运行 `vct` 会打开交互式界面,一个画面有四个标签页:`1 Usage`、`2 Analysis`、`3 Quota` 与 `4 Settings`。`vct usage`、`vct analysis` 与 `vct quota` 会打开同一个界面并停在各自的标签页,`--json`、`--text` 与 `--table` 则只输出结果,不会打开界面。没有终端时(输出被 pipe 或重定向),单独的 `vct` 会打印帮助并以状态码 2 退出。
|
|
130
|
+
|
|
131
|
+
| 按键 | 动作 |
|
|
132
|
+
| ------------------- | ----------------------------------------------------------------- |
|
|
133
|
+
| `1`-`4` | 跳到对应的标签页 |
|
|
134
|
+
| `Tab` / `Shift+Tab` | 下一个 / 上一个标签页 |
|
|
135
|
+
| `↑` / `↓` | 移动选中的行 |
|
|
136
|
+
| `Enter` | 显示选中 model 的完整数字(Usage、Analysis) |
|
|
137
|
+
| `←` / `→` | 改用左边 / 右边那一列排序(Usage、Analysis) |
|
|
138
|
+
| `[` / `]` | 上一个 / 下一个时间范围:day、week、month、all(Usage、Analysis) |
|
|
139
|
+
| `r` | 立即刷新(Usage、Analysis) |
|
|
140
|
+
| `m` | 合并 / 拆开 provider 前缀,会保存到配置文件(Usage) |
|
|
141
|
+
| `p` | 打开 Provider Usage 面板(Usage) |
|
|
142
|
+
| `?` | 列出当前标签页的按键 |
|
|
143
|
+
| `Esc` | 关闭打开的面板 |
|
|
144
|
+
| `q` | 退出 |
|
|
145
|
+
|
|
146
|
+
Quota 与 Settings 标签页不扫描任何 session。第一次切到 Usage 或 Analysis 时才开始该标签页的扫描,而且只有画面上的标签页会按定时器刷新。标签栏右侧显示时间范围,以及 vct 自己的内存与 CPU 用量。
|
|
147
|
+
|
|
148
|
+
时间范围 flag(`usage` 与 `analysis` 共用,互斥,默认 `--all`;在交互式界面中则决定打开时的范围):
|
|
130
149
|
|
|
131
150
|
| Flag | 范围 |
|
|
132
151
|
| ------------- | ---------------------------- |
|
|
@@ -144,7 +163,7 @@ vct analysis
|
|
|
144
163
|
### 基本用法
|
|
145
164
|
|
|
146
165
|
```bash
|
|
147
|
-
#
|
|
166
|
+
# Open the app on the Usage tab (recommended)
|
|
148
167
|
vct usage
|
|
149
168
|
|
|
150
169
|
# Static table for reports
|
|
@@ -170,36 +189,36 @@ vct usage --table --merge-providers
|
|
|
170
189
|
```
|
|
171
190
|
|
|
172
191
|
> [!NOTE]
|
|
173
|
-
>
|
|
192
|
+
> `--table` 与 `--text` 的 model 行会按 cost 升序排序,因此花费最高的 model 会排在最后(在 `--table` 中紧邻 `TOTAL` 行上方);`--json` 的行则没有固定顺序。交互式界面默认按 cost 降序排序,按 `←` / `→` 可改用左边或右边那一列排序,排序列的表头会高亮。表格标题右侧会标出当前的排序(`sort: cost ▼`)。交互式界面还会隐藏在所选范围内用量为 0 的模型。
|
|
174
193
|
|
|
175
194
|
> [!TIP]
|
|
176
|
-
> 同一个 model 在不同 provider 前缀下路由时会显示成多行(`openai/gpt-5.5`、`azure/gpt-5.5`、纯 `gpt-5.5`)。`--merge-providers` 会把第一个 `/` 之后 base 名称相同的行合并(`gpt-5.5` 与 `gpt-5.4` 这类版本不同的仍分开),并把它们已定价的 cost
|
|
195
|
+
> 同一个 model 在不同 provider 前缀下路由时会显示成多行(`openai/gpt-5.5`、`azure/gpt-5.5`、纯 `gpt-5.5`)。`--merge-providers` 会把第一个 `/` 之后 base 名称相同的行合并(`gpt-5.5` 与 `gpt-5.4` 这类版本不同的仍分开),并把它们已定价的 cost 相加。在 Usage 标签页按 `m` 可实时切换(该选择会保存到 `~/.vct/config.toml`,因此下次启动会记住它);`--merge-providers` 则让该标签页一打开就是合并状态。`--json` 保持为逐一 model 的原始导出。
|
|
177
196
|
|
|
178
|
-
###
|
|
197
|
+
### 预览:Usage 标签页(`vct usage`)
|
|
179
198
|
|
|
180
199
|
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
│
|
|
184
|
-
│
|
|
185
|
-
│claude-
|
|
186
|
-
│claude-
|
|
187
|
-
│
|
|
188
|
-
│
|
|
200
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings range day week month all 61.8 MB · CPU 0.1%
|
|
201
|
+
┌ Models · $79.33 · 49.1M tokens · 3 models ───────────────────────────────────────────────────────────── sort: cost ▼ ┐
|
|
202
|
+
│Model Input Output Cache Read Cache Write Total Cost (USD) Share│
|
|
203
|
+
│ │
|
|
204
|
+
│claude-opus-4-8 25.7K 179K 42.9M 496K 43.6M $77.59 ━━━━━━━━━ 88.8%│
|
|
205
|
+
│claude-haiku-4-5-20251001 5.57K 19.8K 5.20M 55.0K 5.28M $1.34 ━ 10.8%│
|
|
206
|
+
│gemini-3.1-pro-preview 129K 10.3K 66.0K 1.70K 207K $0.40 0.4%│
|
|
207
|
+
│ │
|
|
208
|
+
│ │
|
|
189
209
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
190
|
-
|
|
191
|
-
┌ Claude
|
|
210
|
+
● Claude $78.93 ● Gemini $0.40
|
|
211
|
+
┌ ● Claude ────────────┐┌ ● Codex ─────────────┐┌ ● Copilot ───────────┐┌ ● Cursor ──────LIMIT ┐┌ ● Grok ──────────────┐
|
|
192
212
|
│max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
|
|
193
|
-
│5h
|
|
194
|
-
│7d
|
|
195
|
-
│Fable
|
|
213
|
+
│5h ━──── 13% 1h42m││5h ━━─── 33% 12m ││prem ━──── 3% 24d0h││total ━━━━━ 94% 16d0h││week ━━─── 38% 3d4h │
|
|
214
|
+
│7d ━━━── 58% 1d23h││7d ━━─── 36% 1h54m││reqs ━──── 45/1500 ││auto ━━━━━ 100% 16d0h││ondmd $4.20/$50.00 │
|
|
215
|
+
│Fable ━━━━─ 79% 1d23h││credits 0 · +3 reset ││ ││api ━━━── 44% 16d0h││balance $12.00 │
|
|
196
216
|
│bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
|
|
197
217
|
└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
|
|
198
|
-
|
|
199
|
-
↑/↓ scroll m merge p providers Q quota r refresh q quit | Star on GitHub
|
|
218
|
+
↑↓ move ←→ sort [ ] range p providers m merge ⏎ details r refresh 1-4/tab view ? help q quit Star on GitHub
|
|
200
219
|
```
|
|
201
220
|
|
|
202
|
-
|
|
221
|
+
Usage 与 Analysis 标签页各自在第一次切到时开始扫描, 并绘制居中的 `Loading sessions...` spinner. Loading 期间仍可响应 `q`, Ctrl+C 与 resize event. 后续扫描会在 `Refreshing...` footer 下保留上一次成功的数据. 如果 refresh 失败, 标签页会保留 last-known-good view, 并在下次排程或手动刷新时重试. 所选范围内没有任何 session 时, 会显示空的表格.
|
|
203
222
|
|
|
204
223
|
### 预览:表格与 JSON(`vct usage`)
|
|
205
224
|
|
|
@@ -298,18 +317,18 @@ vct 会通过 ssh 在每台主机上运行 `vct ledger export`,并把返回的
|
|
|
298
317
|
`vct usage` 会**在仪表盘中直接显示 Claude Code、Codex、GitHub Copilot、Cursor、Grok 与 Antigravity 的实时额度用量——完全零配置。** 不需要 status-line hook,也无需手动输入任何凭证:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API(Antigravity 则是询问 `agy` CLI),并在你工作时保持面板持续更新。每个进度条都是**已用**百分比,所以进度条满格代表该额度周期已耗尽,而不是还没开始用。(想要更清爽的面板?在 [`config.toml`](#%E9%85%8D%E7%BD%AE) 中精简 `[usage.quota]` 下的 `panels`,或设为 `[]` 隐藏所有额度卡片。表格下方那行各 provider 成本是本机扫描数据而不是额度面板,所以不受这里的设置影响。)
|
|
299
318
|
|
|
300
319
|
```
|
|
301
|
-
┌ Claude
|
|
320
|
+
┌ ● Claude ────────────┐┌ ● Codex ─────────────┐┌ ● Copilot ───────────┐┌ ● Cursor ──────LIMIT ┐┌ ● Grok ──────────────┐
|
|
302
321
|
│max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
|
|
303
|
-
│5h
|
|
304
|
-
│7d
|
|
305
|
-
│Fable
|
|
322
|
+
│5h ━──── 13% 1h42m││5h ━━─── 33% 12m ││prem ━──── 3% 24d0h││total ━━━━━ 94% 16d0h││week ━━─── 38% 3d4h │
|
|
323
|
+
│7d ━━━── 58% 1d23h││7d ━━─── 36% 1h54m││reqs ━──── 45/1500 ││auto ━━━━━ 100% 16d0h││ondmd $4.20/$50.00 │
|
|
324
|
+
│Fable ━━━━─ 79% 1d23h││credits 0 · +3 reset ││ ││api ━━━── 44% 16d0h││balance $12.00 │
|
|
306
325
|
│bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
|
|
307
326
|
└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
|
|
308
|
-
┌ Antigravity
|
|
327
|
+
┌ ● Antigravity ────+2 ┐
|
|
309
328
|
│- just now│
|
|
310
329
|
│Gemini Models │
|
|
311
|
-
│5h
|
|
312
|
-
│weekly
|
|
330
|
+
│5h ━━─── 23% │
|
|
331
|
+
│weekly ━──── 8% │
|
|
313
332
|
│Claude and GPT models │
|
|
314
333
|
└──────────────────────┘
|
|
315
334
|
```
|
|
@@ -319,11 +338,11 @@ vct 会通过 ssh 在每台主机上运行 `vct ledger export`,并把返回的
|
|
|
319
338
|
- **Copilot** — 方案类型,以及你的 premium 请求额度,以两个进度条呈现:已用百分比,以及已用 / 总量的请求数(例如 `45/1500`),来自 GitHub 的 Copilot API(`GET /copilot_internal/user`),从 `~/.copilot/config.json` 读取。该请求会模拟 Copilot CLI。token 为长期有效,因此不需要刷新;遇到 `401` / `403` 时会显示 `run: copilot login` 提示。
|
|
320
339
|
- **Cursor** — 方案类型、total / auto / API **已用**百分比,以及按需消费,来自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。
|
|
321
340
|
- **Grok** — 方案类型,以及当前每周或每月周期内的方案内含额度用量,来自 Grok CLI 自己的计费端点(`GET /v1/billing?format=credits`),从 `~/.grok/auth.json` 读取。预付余额只有在非零时才会显示;按量付费的消费则在你有过消费、或设置了上限之后才会显示。该请求会模拟 Grok CLI;遇到 `401` / `403` 时会显示 `run: grok login` 提示。
|
|
322
|
-
- **Antigravity** — 每个共享模型池的额度(agy 的是 Gemini 以及 Claude / GPT,各有 5 小时与每周额度),来自 `agy` CLI 自己的 `/usage` 命令(`agy -p /usage --output-format json`)。卡片直接使用 agy 给出的模型池名称,每个额度则按 agy 的时间窗原样标示(`5h` 排在最前,然后是 `weekly`);卡片放不下所有模型池时,其余的以 `+N`
|
|
341
|
+
- **Antigravity** — 每个共享模型池的额度(agy 的是 Gemini 以及 Claude / GPT,各有 5 小时与每周额度),来自 `agy` CLI 自己的 `/usage` 命令(`agy -p /usage --output-format json`)。卡片直接使用 agy 给出的模型池名称,每个额度则按 agy 的时间窗原样标示(`5h` 排在最前,然后是 `weekly`);卡片放不下所有模型池时,其余的以 `+N` 标出。`/usage` 不提供方案名称,所以第一行只显示数据的新旧。vct 会运行 `PATH` 上的 `agy`,找不到时改找 agy 的安装位置(`~/.local/bin/agy`、`%LOCALAPPDATA%\agy\bin\agy.exe`),或 Google 内部版本 Jetski 的位置(gLinux 上的 `/google/bin/releases/jetski-devs/tools/cli`、macOS 上的 `/usr/local/bin/jetski`);尚未登录的 agy 不会挡掉 Jetski。agy 会自行维持登录状态,因此 vct 只检查 `~/.gemini/antigravity-cli/antigravity-oauth-token` 是否存在,从不读取或写入它;Jetski 有自己的登录方式,找到它就够了。每次轮询都会启动一次 agy(需要几秒、约 260 MB),所以这张卡片最多每 5 分钟更新一次。agy 无法登录时,卡片会显示 `run: agy acp --login` 提示,而且在该文件变动之前,仪表盘不会再运行 agy。
|
|
323
342
|
|
|
324
343
|
**自动刷新 token。** 对 Claude、Codex 和 Grok,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式)。写入 Grok 的凭证文件时,会保留文件中其他所有的登录信息。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。Copilot(长期有效的 token)和 Cursor(由其自身客户端保持最新)为只读——vct 从不写入它们的凭证文件。Antigravity 的 token 属于 agy,每当 vct 向它询问 `/usage` 时由 agy 自行刷新。
|
|
325
344
|
|
|
326
|
-
只有在某个 provider 的凭证存在时,才会显示对应的面板。面板排在一个统一网格上:一行放得下几张就放几张,放不下的自动折到下一行。当终端高度不足以留给网格时,它会收成一行摘要,显示放得下的 gauge
|
|
345
|
+
只有在某个 provider 的凭证存在时,才会显示对应的面板。面板排在一个统一网格上:一行放得下几张就放几张,放不下的自动折到下一行。当终端高度不足以留给网格时,它会收成一行摘要,显示放得下的 gauge,并把其余的记成 `+N more → 3`;按 `3` 切到 [Quota 标签页](#quota-%E6%A0%87%E7%AD%BE%E9%A1%B5),整个画面都留给卡片,按 `p` 打开 Provider Usage 面板,里面有各 provider 的 token 数与占比。额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
|
|
327
346
|
|
|
328
347
|
> **平台说明:** 在 macOS 上,Claude Code 会把 OAuth 凭证保存在系统 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不会显示 Claude 面板。agy 在 macOS 上同样把登录信息保存在 Keychain,所以 macOS 上只有 Google 内部版本 Jetski 会显示 Antigravity 面板。Cursor 的 `~/.config/cursor` 凭证路径偏向 Linux。
|
|
329
348
|
|
|
@@ -338,7 +357,7 @@ vct 会通过 ssh 在每台主机上运行 `vct ledger export`,并把返回的
|
|
|
338
357
|
### 基本用法
|
|
339
358
|
|
|
340
359
|
```bash
|
|
341
|
-
#
|
|
360
|
+
# Open the app on the Analysis tab, all sessions (default)
|
|
342
361
|
vct analysis
|
|
343
362
|
|
|
344
363
|
# Static table output with per-provider totals
|
|
@@ -367,27 +386,29 @@ vct analysis --json --daily
|
|
|
367
386
|
vct analysis --json --daily > today.json
|
|
368
387
|
```
|
|
369
388
|
|
|
370
|
-
###
|
|
389
|
+
### 预览:Analysis 标签页(`vct analysis`)
|
|
371
390
|
|
|
372
391
|
```
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
│
|
|
376
|
-
│
|
|
377
|
-
│
|
|
378
|
-
│
|
|
379
|
-
│
|
|
392
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings range day week month all 61.9 MB · CPU 0.1%
|
|
393
|
+
┌ Models · 135K lines · 1.80K tool calls · 3 models ─────────────────────────────────────────────── sort: edit lines ▼ ┐
|
|
394
|
+
│Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write│
|
|
395
|
+
│ │
|
|
396
|
+
│claude-opus-4-8 12.4K 88.1K 9.02K 412 231 604 96 88│
|
|
397
|
+
│gemini-3.1-pro-preview 2.10K 14.8K 1.62K 84 44 112 16 15│
|
|
398
|
+
│claude-haiku-4-5-20251001 840 5.40K 610 31 16 42 6 5│
|
|
399
|
+
│ │
|
|
380
400
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
381
401
|
┌ Providers ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
382
|
-
│Provider
|
|
402
|
+
│Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days│
|
|
383
403
|
│ │
|
|
384
|
-
|
|
385
|
-
|
|
404
|
+
│● Claude 13.2K 93.5K 9.63K 443 247 646 102 93 12│
|
|
405
|
+
│● Gemini 2.10K 14.8K 1.62K 84 44 112 16 15 3│
|
|
386
406
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
387
|
-
|
|
388
|
-
↑/↓ scroll r refresh q quit | Star on GitHub
|
|
407
|
+
↑↓ move ←→ sort [ ] range ⏎ details r refresh 1-4/tab view ? help q quit Star on GitHub
|
|
389
408
|
```
|
|
390
409
|
|
|
410
|
+
表格默认按 edit lines 降序排序;按 `←` / `→` 可改用左边或右边那一列排序,排序列的表头会高亮。
|
|
411
|
+
|
|
391
412
|
### 预览:表格与 JSON(`vct analysis`)
|
|
392
413
|
|
|
393
414
|
`--table` 会显示各 model 的明细, 并附上各 provider 的汇总, 包含 Active Days 列. `--text` 与 `--table` 都是相同 normalized parser records 的精简 projection. `--json` 会保留完整 records, 包括每次操作的 details 与 token usage. 未提供 `<FILE>` 时, 外层数组中的每个元素都是一个 session 的 `CodeAnalysis` object. 提供 `<FILE>` 时, stdout 只会输出该 object, shape 与 [`tests/fixtures/sessions/`](tests/fixtures/sessions/) 中对应的结果相同.
|
|
@@ -498,41 +519,39 @@ vct version --json # 机读 JSON
|
|
|
498
519
|
|
|
499
520
|
---
|
|
500
521
|
|
|
501
|
-
##
|
|
522
|
+
## Quota 命令
|
|
523
|
+
|
|
524
|
+
**全屏的实时 quota 面板,或某个供应商的原始 quota/usage API 响应。**
|
|
502
525
|
|
|
503
|
-
|
|
526
|
+
### Quota 标签页
|
|
504
527
|
|
|
505
|
-
`vct
|
|
528
|
+
`vct quota` 会打开交互式界面并停在 Quota 标签页。它显示与 Usage 标签页相同的 quota 卡片,进度条更宽,终端放得下几张就显示几张(其余的以 `+N hidden, enlarge the terminal` 标出数量)。它不扫描任何 session,所以立即打开,也足够轻量,适合放在空闲的 pane 里常驻。它沿用相同的设置:[`config.toml`](#%E9%85%8D%E7%BD%AE) 中 `[usage.quota]` 下的 `panels` 与 `refresh_interval`。
|
|
506
529
|
|
|
507
530
|
```bash
|
|
508
|
-
vct
|
|
531
|
+
vct quota
|
|
509
532
|
```
|
|
510
533
|
|
|
511
534
|
```
|
|
512
|
-
Quota
|
|
535
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings 31.6 MB · CPU 0.0%
|
|
513
536
|
|
|
514
|
-
┌ Claude
|
|
537
|
+
┌ ● Claude ────────────────────────────┐┌ ● Codex ─────────────────────────────┐
|
|
515
538
|
│max 5x just now││plus just now│
|
|
516
|
-
│5h
|
|
517
|
-
│7d
|
|
518
|
-
│Fable
|
|
539
|
+
│5h ━━━━━━─────────── 30% ↻ 2h18m ││5h ───────────────── 0% ↻ 4h59m │
|
|
540
|
+
│7d ━━━━━──────────── 28% ↻ 6d3h ││7d ━──────────────── 1% ↻ 6d8h │
|
|
541
|
+
│Fable ━━━────────────── 14% ↻ 6d3h ││credits 0 · +3 reset │
|
|
519
542
|
│bal - · $0.00 used ││reset expires 17d11h │
|
|
520
543
|
└──────────────────────────────────────┘└──────────────────────────────────────┘
|
|
521
544
|
|
|
522
|
-
|
|
545
|
+
1-4/tab view ? help q quit Star on GitHub
|
|
523
546
|
```
|
|
524
547
|
|
|
525
|
-
|
|
548
|
+
> `vct monitor` 与隐藏别名 `vct fetch` 已移除。要看卡片请用 `vct quota`,要看原始响应请用 `vct quota <provider>`。
|
|
526
549
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
**打印某个供应商的原始 quota/usage API 响应 — 不解析、不聚合。**
|
|
530
|
-
|
|
531
|
-
对 `usage` 面板使用的同一个 quota 端点(Claude / Codex / Copilot / Cursor / Grok)发一次请求,直接打印原始 body,方便你查看 API 的实际结构或检查凭证是否正常。它读取各供应商已保存的凭证,并且**不会**刷新 token:token 过期时,请用对应供应商自己的 CLI 重新登录(`claude` / `codex` / `copilot` / `cursor-agent` / `grok`)。`vct quota antigravity` 则是运行一次 `agy -p /usage --output-format json`(或按仪表盘相同的方式找到的 Jetski)并打印它的输出;agy 会在运行时自行刷新 token。
|
|
550
|
+
### 原始响应(`vct quota <provider>`)
|
|
532
551
|
|
|
533
|
-
|
|
552
|
+
带上供应商时,`vct quota` 会打印该供应商的原始响应,不解析、不聚合。它对 `usage` 面板使用的同一个 quota 端点(Claude / Codex / Copilot / Cursor / Grok)发一次请求,直接打印原始 body,方便你查看 API 的实际结构或检查凭证是否正常。它读取各供应商已保存的凭证,并且**不会**刷新 token:token 过期时,请用对应供应商自己的 CLI 重新登录(`claude` / `codex` / `copilot` / `cursor-agent` / `grok`)。`vct quota antigravity` 则是运行一次 `agy -p /usage --output-format json`(或按仪表盘相同的方式找到的 Jetski)并打印它的输出;agy 会在运行时自行刷新 token。
|
|
534
553
|
|
|
535
|
-
|
|
554
|
+
`--json`、`--text` 与 `--table` 打印的是单个供应商的响应,所以不带供应商的 `vct quota --json` 会报错。
|
|
536
555
|
|
|
537
556
|
```bash
|
|
538
557
|
# 原始 JSON(默认)
|
|
@@ -567,6 +586,42 @@ vct 会把用户设置保存在 `~/.vct/config.toml` 中。该文件会在**首
|
|
|
567
586
|
> [!NOTE]
|
|
568
587
|
> vct 会把诊断信息写入 `~/.vct/logs/vct-YYYY-MM-DD.log`(纯文本,仅写文件,绝不显示在面板上)。健康运行时保持安静(默认级别 `warn`),且文件是惰性创建的,所以一次正常运行不会留下任何文件。当额度获取失败或某个 session 被跳过时,原因就记录在这里——需要完整细节时把 `logging.level` 调到 `debug`。
|
|
569
588
|
|
|
589
|
+
### Settings 标签页
|
|
590
|
+
|
|
591
|
+
在交互式界面中按 `4`(或用 `Tab` 切过去),就能以表单编辑 `config.toml` 的每一项设置:所有设置按分区排成一个列表,左边的分区列表标出当前所在的分区,下方则是当前字段的说明、配置键与默认值。`*` 表示该字段已不是默认值。
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings 31.8 MB · CPU 0.0%
|
|
595
|
+
┌ Sections ──────┐┌ Settings ─────────────────────────────────────────────────────────────────────────────── 27 more ↓ ┐
|
|
596
|
+
│ General ││ General │
|
|
597
|
+
│ › Usage ││ Default time range ‹ all ›│
|
|
598
|
+
│ Analysis ││ Check for updates on start [x] on│
|
|
599
|
+
│ Providers ││ │
|
|
600
|
+
│ Remotes ││ Usage │
|
|
601
|
+
│ Performance ││ Merge models across providers [ ] off│
|
|
602
|
+
│ Logging ││ Redraw interval ‹ 10 s ›│
|
|
603
|
+
│ ││ Quota panel: Claude [x] on│
|
|
604
|
+
│ ││ Quota panel: Codex [x] on│
|
|
605
|
+
│ ││ Quota panel: Copilot [x] on│
|
|
606
|
+
│ ││ Quota panel: Cursor [x] on│
|
|
607
|
+
│ ││ Quota panel: Grok [x] on│
|
|
608
|
+
│ ││ Quota panel: Antigravity [x] on│
|
|
609
|
+
│ ││ Quota poll interval ‹ 60 s ›│
|
|
610
|
+
└────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
611
|
+
┌ Quota panel: Claude · usage.quota.panels ─────────────────────────────────────────────────────────── default: [x] on ┐
|
|
612
|
+
│Which live quota panels to show in the app (by provider name: `claude` / `codex` / `copilot` / `cursor` / `grok` / │
|
|
613
|
+
│`antigravity`). An empty list hides every quota card. │
|
|
614
|
+
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
615
|
+
↑↓ move ←→ change space toggle ⏎ edit x reset e editor 1-4/tab view ? help q quit Star on GitHub
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
- `↑` / `↓` 在所有设置之间移动,`PgUp` / `PgDn` 跳到上一个 / 下一个分区,`←` / `→` 修改数值(开关、增减数字、切换选项),`Space` 开关,`x` 把字段重置为默认值,`e` 用 `$VISUAL` / `$EDITOR` 打开配置文件,编辑器退出后重新加载。
|
|
619
|
+
- `Enter` 打开编辑器:可挑选的列表、数字或文本输入,或远程主机列表(`a` 新增、`Enter` 编辑、`d` 删除)。
|
|
620
|
+
- 每次修改都会立即写入文件,并保留文件里的注释。
|
|
621
|
+
- 合并、刷新间隔、quota 面板、quota 轮询间隔与 provider 开关的修改会直接反映在运行中的界面(quota 面板则在离开 Settings 标签页时生效)。默认时间范围、自动更新、扫描线程数、logging 与 remotes 要到下次启动才生效,表单会在这些字段上标明。
|
|
622
|
+
|
|
623
|
+
手动编辑文件与下方的 `vct config` 命令仍然可用。
|
|
624
|
+
|
|
570
625
|
### 管理配置文件
|
|
571
626
|
|
|
572
627
|
```bash
|
package/README.zh-TW.md
CHANGED
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
選擇你偏好的檢視方式:
|
|
32
32
|
|
|
33
|
-
- **互動式儀表板**: 可立即顯示 loading spinner
|
|
33
|
+
- **互動式儀表板**: 一個終端 app, 內含 Usage, Analysis, Quota 與 Settings 四個分頁, 可立即顯示 loading spinner, 支援背景 incremental refresh, 可捲動並可排序的 model 清單 (方向鍵), process 層級的 CPU/記憶體即時讀數, 以及 K/M/B 精簡數字格式
|
|
34
34
|
- **靜態報表**:專業的表格格式,適合撰寫文件
|
|
35
35
|
- **腳本友好**:純文字及 JSON 輸出,方便自動化處理
|
|
36
36
|
- **完整精度**:匯出精確費用供會計使用
|
|
@@ -110,13 +110,13 @@ cargo install vct-cli
|
|
|
110
110
|
### 首次執行
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
#
|
|
114
|
-
vct
|
|
113
|
+
# Open the interactive app on the Usage tab
|
|
114
|
+
vct
|
|
115
115
|
|
|
116
116
|
# Or run the binary built by Cargo/pip
|
|
117
|
-
vibe_coding_tracker
|
|
117
|
+
vibe_coding_tracker
|
|
118
118
|
|
|
119
|
-
#
|
|
119
|
+
# Open it on the Analysis tab (code operations across all sessions)
|
|
120
120
|
vct analysis
|
|
121
121
|
```
|
|
122
122
|
|
|
@@ -126,7 +126,26 @@ vct analysis
|
|
|
126
126
|
|
|
127
127
|
執行 `vct --help` 可列出所有指令,`vct <command> --help` 則會列出該指令的 flag。
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
不帶任何指令執行 `vct` 會開啟互動式介面,一個畫面有四個分頁:`1 Usage`、`2 Analysis`、`3 Quota` 與 `4 Settings`。`vct usage`、`vct analysis` 與 `vct quota` 會開啟同一個介面並停在各自的分頁,`--json`、`--text` 與 `--table` 則只輸出結果,不會開啟介面。沒有終端時(輸出被 pipe 或重新導向),單獨的 `vct` 會印出說明並以狀態碼 2 結束。
|
|
130
|
+
|
|
131
|
+
| 按鍵 | 動作 |
|
|
132
|
+
| ------------------- | ----------------------------------------------------------------- |
|
|
133
|
+
| `1`-`4` | 跳到對應的分頁 |
|
|
134
|
+
| `Tab` / `Shift+Tab` | 下一個 / 上一個分頁 |
|
|
135
|
+
| `↑` / `↓` | 移動選取的列 |
|
|
136
|
+
| `Enter` | 顯示選取 model 的完整數字(Usage、Analysis) |
|
|
137
|
+
| `←` / `→` | 改用左邊 / 右邊那一欄排序(Usage、Analysis) |
|
|
138
|
+
| `[` / `]` | 上一個 / 下一個時間範圍:day、week、month、all(Usage、Analysis) |
|
|
139
|
+
| `r` | 立即刷新(Usage、Analysis) |
|
|
140
|
+
| `m` | 合併 / 拆開 provider 前綴,會存進設定檔(Usage) |
|
|
141
|
+
| `p` | 開啟 Provider Usage 面板(Usage) |
|
|
142
|
+
| `?` | 列出目前分頁的按鍵 |
|
|
143
|
+
| `Esc` | 關閉開啟的面板 |
|
|
144
|
+
| `q` | 離開 |
|
|
145
|
+
|
|
146
|
+
Quota 與 Settings 分頁不掃描任何 session。第一次切到 Usage 或 Analysis 時才開始該分頁的掃描,而且只有畫面上的分頁會依計時器刷新。分頁列右側顯示時間範圍,以及 vct 自己的記憶體與 CPU 用量。
|
|
147
|
+
|
|
148
|
+
時間範圍 flag(`usage` 與 `analysis` 共用,互斥,預設 `--all`;在互動式介面中則決定開啟時的範圍):
|
|
130
149
|
|
|
131
150
|
| Flag | 範圍 |
|
|
132
151
|
| ------------- | -------------------------- |
|
|
@@ -144,7 +163,7 @@ vct analysis
|
|
|
144
163
|
### 基本用法
|
|
145
164
|
|
|
146
165
|
```bash
|
|
147
|
-
#
|
|
166
|
+
# Open the app on the Usage tab (recommended)
|
|
148
167
|
vct usage
|
|
149
168
|
|
|
150
169
|
# Static table for reports
|
|
@@ -170,36 +189,36 @@ vct usage --table --merge-providers
|
|
|
170
189
|
```
|
|
171
190
|
|
|
172
191
|
> [!NOTE]
|
|
173
|
-
>
|
|
192
|
+
> `--table` 與 `--text` 的 model 列會依 cost 由小到大排序,所以花費最高的 model 會排在最後(在 `--table` 中緊鄰 `TOTAL` 列上方);`--json` 的列則沒有固定順序。互動式介面預設依 cost 由大到小排序,按 `←` / `→` 可改用左邊或右邊那一欄排序,排序欄的表頭會標亮。表格標題右側會標出目前的排序(`sort: cost ▼`)。互動式介面也會隱藏在所選範圍內用量為 0 的 model。
|
|
174
193
|
|
|
175
194
|
> [!TIP]
|
|
176
|
-
> 同一個 model 在不同 provider 前綴下路由時會顯示成多列(`openai/gpt-5.5`、`azure/gpt-5.5`、純 `gpt-5.5`)。`--merge-providers` 會把第一個 `/` 之後 base 名稱相同的列合併(`gpt-5.5` 與 `gpt-5.4` 這類版本不同的仍分開),並把它們已定價的 cost
|
|
195
|
+
> 同一個 model 在不同 provider 前綴下路由時會顯示成多列(`openai/gpt-5.5`、`azure/gpt-5.5`、純 `gpt-5.5`)。`--merge-providers` 會把第一個 `/` 之後 base 名稱相同的列合併(`gpt-5.5` 與 `gpt-5.4` 這類版本不同的仍分開),並把它們已定價的 cost 相加。在 Usage 分頁按 `m` 可即時切換(這個選擇會存進 `~/.vct/config.toml`,所以下次啟動時會記住這個設定);`--merge-providers` 則讓該分頁一打開就是合併狀態。`--json` 保持為逐一 model 的原始輸出。
|
|
177
196
|
|
|
178
|
-
###
|
|
197
|
+
### 預覽:Usage 分頁(`vct usage`)
|
|
179
198
|
|
|
180
199
|
```
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
│
|
|
184
|
-
│
|
|
185
|
-
│claude-
|
|
186
|
-
│claude-
|
|
187
|
-
│
|
|
188
|
-
│
|
|
200
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings range day week month all 61.8 MB · CPU 0.1%
|
|
201
|
+
┌ Models · $79.33 · 49.1M tokens · 3 models ───────────────────────────────────────────────────────────── sort: cost ▼ ┐
|
|
202
|
+
│Model Input Output Cache Read Cache Write Total Cost (USD) Share│
|
|
203
|
+
│ │
|
|
204
|
+
│claude-opus-4-8 25.7K 179K 42.9M 496K 43.6M $77.59 ━━━━━━━━━ 88.8%│
|
|
205
|
+
│claude-haiku-4-5-20251001 5.57K 19.8K 5.20M 55.0K 5.28M $1.34 ━ 10.8%│
|
|
206
|
+
│gemini-3.1-pro-preview 129K 10.3K 66.0K 1.70K 207K $0.40 0.4%│
|
|
207
|
+
│ │
|
|
208
|
+
│ │
|
|
189
209
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
190
|
-
|
|
191
|
-
┌ Claude
|
|
210
|
+
● Claude $78.93 ● Gemini $0.40
|
|
211
|
+
┌ ● Claude ────────────┐┌ ● Codex ─────────────┐┌ ● Copilot ───────────┐┌ ● Cursor ──────LIMIT ┐┌ ● Grok ──────────────┐
|
|
192
212
|
│max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
|
|
193
|
-
│5h
|
|
194
|
-
│7d
|
|
195
|
-
│Fable
|
|
213
|
+
│5h ━──── 13% 1h42m││5h ━━─── 33% 12m ││prem ━──── 3% 24d0h││total ━━━━━ 94% 16d0h││week ━━─── 38% 3d4h │
|
|
214
|
+
│7d ━━━── 58% 1d23h││7d ━━─── 36% 1h54m││reqs ━──── 45/1500 ││auto ━━━━━ 100% 16d0h││ondmd $4.20/$50.00 │
|
|
215
|
+
│Fable ━━━━─ 79% 1d23h││credits 0 · +3 reset ││ ││api ━━━── 44% 16d0h││balance $12.00 │
|
|
196
216
|
│bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
|
|
197
217
|
└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
|
|
198
|
-
|
|
199
|
-
↑/↓ scroll m merge p providers Q quota r refresh q quit | Star on GitHub
|
|
218
|
+
↑↓ move ←→ sort [ ] range p providers m merge ⏎ details r refresh 1-4/tab view ? help q quit Star on GitHub
|
|
200
219
|
```
|
|
201
220
|
|
|
202
|
-
|
|
221
|
+
Usage 與 Analysis 分頁各自在第一次切到時開始掃描, 並繪製置中的 `Loading sessions...` spinner. Loading 期間仍可處理 `q`, Ctrl+C 與 resize event. 後續掃描會在 `Refreshing...` footer 下保留上一次成功的資料. 如果 refresh 失敗, 分頁會保留 last-known-good view, 並在下次排程或手動刷新時重試. 所選範圍內沒有任何 session 時, 會顯示空的表格.
|
|
203
222
|
|
|
204
223
|
### 預覽:表格與 JSON(`vct usage`)
|
|
205
224
|
|
|
@@ -298,18 +317,18 @@ vct 會透過 ssh 在每台主機上執行 `vct ledger export`,並把回傳的
|
|
|
298
317
|
`vct usage` 會**在儀表板中直接顯示 Claude Code、Codex、GitHub Copilot、Cursor、Grok 與 Antigravity 的即時額度用量——完全零設定。** 不需要 status-line hook,也不需要手動輸入憑證:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API(Antigravity 則是詢問 `agy` CLI),並在你工作時讓面板保持最新。每個進度條都是**已用**百分比,所以進度條滿格代表該額度週期已用盡,而不是還沒開始用。(想要更清爽的儀表板嗎?在 [`config.toml`](#%E8%A8%AD%E5%AE%9A) 中精簡 `[usage.quota]` 下的 `panels`,或設為 `[]` 隱藏所有額度卡片。表格下方那行各 provider 成本是本機掃描資料而不是額度面板,所以不受這裡的設定影響。)
|
|
299
318
|
|
|
300
319
|
```
|
|
301
|
-
┌ Claude
|
|
320
|
+
┌ ● Claude ────────────┐┌ ● Codex ─────────────┐┌ ● Copilot ───────────┐┌ ● Cursor ──────LIMIT ┐┌ ● Grok ──────────────┐
|
|
302
321
|
│max 20x just now││plus just now││individual just now││free just now││SuperGrok just now│
|
|
303
|
-
│5h
|
|
304
|
-
│7d
|
|
305
|
-
│Fable
|
|
322
|
+
│5h ━──── 13% 1h42m││5h ━━─── 33% 12m ││prem ━──── 3% 24d0h││total ━━━━━ 94% 16d0h││week ━━─── 38% 3d4h │
|
|
323
|
+
│7d ━━━── 58% 1d23h││7d ━━─── 36% 1h54m││reqs ━──── 45/1500 ││auto ━━━━━ 100% 16d0h││ondmd $4.20/$50.00 │
|
|
324
|
+
│Fable ━━━━─ 79% 1d23h││credits 0 · +3 reset ││ ││api ━━━── 44% 16d0h││balance $12.00 │
|
|
306
325
|
│bal - · $0.00 used ││reset expires 17d0h ││ ││ ││ │
|
|
307
326
|
└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘└──────────────────────┘
|
|
308
|
-
┌ Antigravity
|
|
327
|
+
┌ ● Antigravity ────+2 ┐
|
|
309
328
|
│- just now│
|
|
310
329
|
│Gemini Models │
|
|
311
|
-
│5h
|
|
312
|
-
│weekly
|
|
330
|
+
│5h ━━─── 23% │
|
|
331
|
+
│weekly ━──── 8% │
|
|
313
332
|
│Claude and GPT models │
|
|
314
333
|
└──────────────────────┘
|
|
315
334
|
```
|
|
@@ -319,11 +338,11 @@ vct 會透過 ssh 在每台主機上執行 `vct ledger export`,並把回傳的
|
|
|
319
338
|
- **Copilot** — 方案類型以及你的 premium 請求額度,以兩個進度條呈現:已用百分比,以及已用 / 總量請求數(例如 `45/1500`),來自 GitHub 的 Copilot API(`GET /copilot_internal/user`),從 `~/.copilot/config.json` 讀取。該請求會模擬 Copilot CLI。token 為長期有效,因此不需要刷新;遇到 `401` / `403` 時會顯示 `run: copilot login` 提示。
|
|
320
339
|
- **Cursor** — 方案類型、total / auto / API **已用**百分比,以及按需消費,來自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。
|
|
321
340
|
- **Grok** — 方案類型以及目前每週或每月週期的內含額度用量,來自 Grok CLI 自己的計費端點(`GET /v1/billing?format=credits`),從 `~/.grok/auth.json` 讀取。預付餘額只有在不為零時才會顯示;按量計費的消費則在你有過消費、或設定了上限之後才會顯示。該請求會模擬 Grok CLI;遇到 `401` / `403` 時會顯示 `run: grok login` 提示。
|
|
322
|
-
- **Antigravity** — 每個共用模型池的額度(agy 的是 Gemini 以及 Claude / GPT,各有 5 小時與每週額度),來自 `agy` CLI 自己的 `/usage` 指令(`agy -p /usage --output-format json`)。卡片直接用 agy 給的模型池名稱,每個額度則以 agy 的時間窗原樣標示(`5h` 排最前,接著是 `weekly`);卡片放不下所有模型池時,其餘的以 `+N`
|
|
341
|
+
- **Antigravity** — 每個共用模型池的額度(agy 的是 Gemini 以及 Claude / GPT,各有 5 小時與每週額度),來自 `agy` CLI 自己的 `/usage` 指令(`agy -p /usage --output-format json`)。卡片直接用 agy 給的模型池名稱,每個額度則以 agy 的時間窗原樣標示(`5h` 排最前,接著是 `weekly`);卡片放不下所有模型池時,其餘的以 `+N` 標出。`/usage` 不提供方案名稱,所以第一行只顯示資料的新舊。vct 會執行 `PATH` 上的 `agy`,找不到時改找 agy 的安裝位置(`~/.local/bin/agy`、`%LOCALAPPDATA%\agy\bin\agy.exe`),或 Google 內部版本 Jetski 的位置(gLinux 上的 `/google/bin/releases/jetski-devs/tools/cli`、macOS 上的 `/usr/local/bin/jetski`);尚未登入的 agy 不會擋掉 Jetski。agy 會自行維持登入狀態,因此 vct 只檢查 `~/.gemini/antigravity-cli/antigravity-oauth-token` 是否存在,從不讀取或寫入它;Jetski 有自己的登入方式,找到它就夠了。每次輪詢都會啟動一次 agy(需要幾秒、約 260 MB),所以這張卡片最多每 5 分鐘更新一次。agy 無法登入時,卡片會顯示 `run: agy acp --login` 提示,而且在該檔案變動之前,儀表板不會再執行 agy。
|
|
323
342
|
|
|
324
343
|
**自動刷新 token。** 對 Claude、Codex 和 Grok,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式)。寫入 Grok 的憑證檔案時,會保留該檔案中其他所有的登入資訊。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。Copilot(長期有效的 token)和 Cursor(由其自身用戶端保持最新)為唯讀——vct 從不寫入它們的憑證檔案。Antigravity 的 token 屬於 agy,每當 vct 向它詢問 `/usage` 時由 agy 自行刷新。
|
|
325
344
|
|
|
326
|
-
只有在某個 provider 的憑證存在時,才會顯示對應的面板。面板排在一個統一網格上:一列放得下幾張就放幾張,放不下的自動折到下一列。當終端高度不足以留給網格時,它會收成一行摘要,顯示放得下的 gauge
|
|
345
|
+
只有在某個 provider 的憑證存在時,才會顯示對應的面板。面板排在一個統一網格上:一列放得下幾張就放幾張,放不下的自動折到下一列。當終端高度不足以留給網格時,它會收成一行摘要,顯示放得下的 gauge,並把其餘的記成 `+N more → 3`;按 `3` 切到 [Quota 分頁](#quota-%E5%88%86%E9%A0%81),整個畫面都留給卡片,按 `p` 開啟 Provider Usage 面板,裡面有各 provider 的 token 數與佔比。額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
|
|
327
346
|
|
|
328
347
|
> **平台說明:** 在 macOS 上,Claude Code 會把 OAuth 憑證儲存在系統 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不會顯示 Claude 面板。agy 在 macOS 上同樣把登入資訊存在 Keychain,所以 macOS 上只有 Google 內部版本 Jetski 會顯示 Antigravity 面板。Cursor 的 `~/.config/cursor` 憑證路徑偏向 Linux。
|
|
329
348
|
|
|
@@ -338,7 +357,7 @@ vct 會透過 ssh 在每台主機上執行 `vct ledger export`,並把回傳的
|
|
|
338
357
|
### 基本用法
|
|
339
358
|
|
|
340
359
|
```bash
|
|
341
|
-
#
|
|
360
|
+
# Open the app on the Analysis tab, all sessions (default)
|
|
342
361
|
vct analysis
|
|
343
362
|
|
|
344
363
|
# Static table output with per-provider totals
|
|
@@ -367,27 +386,29 @@ vct analysis --json --daily
|
|
|
367
386
|
vct analysis --json --daily > today.json
|
|
368
387
|
```
|
|
369
388
|
|
|
370
|
-
###
|
|
389
|
+
### 預覽:Analysis 分頁(`vct analysis`)
|
|
371
390
|
|
|
372
391
|
```
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
│
|
|
376
|
-
│
|
|
377
|
-
│
|
|
378
|
-
│
|
|
379
|
-
│
|
|
392
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings range day week month all 61.9 MB · CPU 0.1%
|
|
393
|
+
┌ Models · 135K lines · 1.80K tool calls · 3 models ─────────────────────────────────────────────── sort: edit lines ▼ ┐
|
|
394
|
+
│Model Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write│
|
|
395
|
+
│ │
|
|
396
|
+
│claude-opus-4-8 12.4K 88.1K 9.02K 412 231 604 96 88│
|
|
397
|
+
│gemini-3.1-pro-preview 2.10K 14.8K 1.62K 84 44 112 16 15│
|
|
398
|
+
│claude-haiku-4-5-20251001 840 5.40K 610 31 16 42 6 5│
|
|
399
|
+
│ │
|
|
380
400
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
381
401
|
┌ Providers ───────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
382
|
-
│Provider
|
|
402
|
+
│Provider Edit Lines Read Lines Write Lines Bash Edit Read TodoWrite Write Days│
|
|
383
403
|
│ │
|
|
384
|
-
|
|
385
|
-
|
|
404
|
+
│● Claude 13.2K 93.5K 9.63K 443 247 646 102 93 12│
|
|
405
|
+
│● Gemini 2.10K 14.8K 1.62K 84 44 112 16 15 3│
|
|
386
406
|
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
387
|
-
|
|
388
|
-
↑/↓ scroll r refresh q quit | Star on GitHub
|
|
407
|
+
↑↓ move ←→ sort [ ] range ⏎ details r refresh 1-4/tab view ? help q quit Star on GitHub
|
|
389
408
|
```
|
|
390
409
|
|
|
410
|
+
表格預設依 edit lines 由大到小排序;按 `←` / `→` 可改用左邊或右邊那一欄排序,排序欄的表頭會標亮。
|
|
411
|
+
|
|
391
412
|
### 預覽:表格與 JSON(`vct analysis`)
|
|
392
413
|
|
|
393
414
|
`--table` 會顯示各 model 的明細, 並附上各 provider 的摘要, 包含 Active Days 欄位. `--text` 與 `--table` 都是相同 normalized parser records 的精簡 projection. `--json` 會保留完整 records, 包括每次操作的 details 與 token usage. 未提供 `<FILE>` 時, 外層陣列中的每個元素都是一個 session 的 `CodeAnalysis` object. 提供 `<FILE>` 時, stdout 只會輸出該 object, shape 與 [`tests/fixtures/sessions/`](tests/fixtures/sessions/) 中對應的結果相同.
|
|
@@ -498,41 +519,39 @@ vct version --json # 機器可讀的 JSON
|
|
|
498
519
|
|
|
499
520
|
---
|
|
500
521
|
|
|
501
|
-
##
|
|
522
|
+
## Quota 指令
|
|
523
|
+
|
|
524
|
+
**全螢幕的即時 quota 面板,或某個供應商的原始 quota/usage API 回應。**
|
|
502
525
|
|
|
503
|
-
|
|
526
|
+
### Quota 分頁
|
|
504
527
|
|
|
505
|
-
`vct
|
|
528
|
+
`vct quota` 會開啟互動式介面並停在 Quota 分頁。它顯示與 Usage 分頁相同的 quota 卡片,進度條更寬,終端放得下幾張就顯示幾張(其餘的以 `+N hidden, enlarge the terminal` 標出數量)。它不掃描任何 session,所以立即開啟,也夠輕量,適合放在閒置的 pane 裡常駐。它沿用相同的設定:[`config.toml`](#%E8%A8%AD%E5%AE%9A) 中 `[usage.quota]` 底下的 `panels` 與 `refresh_interval`。
|
|
506
529
|
|
|
507
530
|
```bash
|
|
508
|
-
vct
|
|
531
|
+
vct quota
|
|
509
532
|
```
|
|
510
533
|
|
|
511
534
|
```
|
|
512
|
-
Quota
|
|
535
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings 31.6 MB · CPU 0.0%
|
|
513
536
|
|
|
514
|
-
┌ Claude
|
|
537
|
+
┌ ● Claude ────────────────────────────┐┌ ● Codex ─────────────────────────────┐
|
|
515
538
|
│max 5x just now││plus just now│
|
|
516
|
-
│5h
|
|
517
|
-
│7d
|
|
518
|
-
│Fable
|
|
539
|
+
│5h ━━━━━━─────────── 30% ↻ 2h18m ││5h ───────────────── 0% ↻ 4h59m │
|
|
540
|
+
│7d ━━━━━──────────── 28% ↻ 6d3h ││7d ━──────────────── 1% ↻ 6d8h │
|
|
541
|
+
│Fable ━━━────────────── 14% ↻ 6d3h ││credits 0 · +3 reset │
|
|
519
542
|
│bal - · $0.00 used ││reset expires 17d11h │
|
|
520
543
|
└──────────────────────────────────────┘└──────────────────────────────────────┘
|
|
521
544
|
|
|
522
|
-
|
|
545
|
+
1-4/tab view ? help q quit Star on GitHub
|
|
523
546
|
```
|
|
524
547
|
|
|
525
|
-
|
|
548
|
+
> `vct monitor` 與隱藏別名 `vct fetch` 已移除。要看卡片請用 `vct quota`,要看原始回應請用 `vct quota <provider>`。
|
|
526
549
|
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
**印出某個供應商的原始 quota/usage API 回應 — 不解析、不彙整。**
|
|
530
|
-
|
|
531
|
-
對 `usage` 面板使用的同一個 quota 端點(Claude / Codex / Copilot / Cursor / Grok)發一次請求,直接印出原始 body,方便你檢視 API 的實際結構或確認憑證是否正常。它讀取各供應商已儲存的憑證,而且**不會**刷新 token:token 過期時,請用對應供應商自己的 CLI 重新登入(`claude` / `codex` / `copilot` / `cursor-agent` / `grok`)。`vct quota antigravity` 則是執行一次 `agy -p /usage --output-format json`(或用儀表板相同的方式找到的 Jetski)並印出它的輸出;agy 會在執行時自行刷新 token。
|
|
550
|
+
### 原始回應(`vct quota <provider>`)
|
|
532
551
|
|
|
533
|
-
|
|
552
|
+
帶上供應商時,`vct quota` 會印出該供應商的原始回應,不解析、不彙整。它對 `usage` 面板使用的同一個 quota 端點(Claude / Codex / Copilot / Cursor / Grok)發一次請求,直接印出原始 body,方便你檢視 API 的實際結構或確認憑證是否正常。它讀取各供應商已儲存的憑證,而且**不會**刷新 token:token 過期時,請用對應供應商自己的 CLI 重新登入(`claude` / `codex` / `copilot` / `cursor-agent` / `grok`)。`vct quota antigravity` 則是執行一次 `agy -p /usage --output-format json`(或用儀表板相同的方式找到的 Jetski)並印出它的輸出;agy 會在執行時自行刷新 token。
|
|
534
553
|
|
|
535
|
-
|
|
554
|
+
`--json`、`--text` 與 `--table` 印出的是單一供應商的回應,所以不帶供應商的 `vct quota --json` 會回報錯誤。
|
|
536
555
|
|
|
537
556
|
```bash
|
|
538
557
|
# 原始 JSON(預設)
|
|
@@ -567,6 +586,42 @@ vct 會把使用者設定存放在 `~/.vct/config.toml`。這個檔案會在**
|
|
|
567
586
|
> [!NOTE]
|
|
568
587
|
> vct 會把診斷訊息寫入 `~/.vct/logs/vct-YYYY-MM-DD.log`(純文字,只寫檔案,絕不顯示在儀表板上)。健康運行時保持安靜(預設等級 `warn`),而且檔案是延遲建立的,所以一次正常執行不會留下任何檔案。當額度抓取失敗或某個 session 被略過時,原因就記錄在這裡——需要完整細節時把 `logging.level` 調到 `debug`。
|
|
569
588
|
|
|
589
|
+
### Settings 分頁
|
|
590
|
+
|
|
591
|
+
在互動式介面中按 `4`(或用 `Tab` 切過去),就能以表單編輯 `config.toml` 的每一項設定:所有設定依區段排成一份清單,左邊的區段清單標出目前所在的區段,下方則是目前欄位的說明、設定鍵與預設值。`*` 表示該欄位已不是預設值。
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
vct 1 Usage 2 Analysis 3 Quota 4 Settings 31.8 MB · CPU 0.0%
|
|
595
|
+
┌ Sections ──────┐┌ Settings ─────────────────────────────────────────────────────────────────────────────── 27 more ↓ ┐
|
|
596
|
+
│ General ││ General │
|
|
597
|
+
│ › Usage ││ Default time range ‹ all ›│
|
|
598
|
+
│ Analysis ││ Check for updates on start [x] on│
|
|
599
|
+
│ Providers ││ │
|
|
600
|
+
│ Remotes ││ Usage │
|
|
601
|
+
│ Performance ││ Merge models across providers [ ] off│
|
|
602
|
+
│ Logging ││ Redraw interval ‹ 10 s ›│
|
|
603
|
+
│ ││ Quota panel: Claude [x] on│
|
|
604
|
+
│ ││ Quota panel: Codex [x] on│
|
|
605
|
+
│ ││ Quota panel: Copilot [x] on│
|
|
606
|
+
│ ││ Quota panel: Cursor [x] on│
|
|
607
|
+
│ ││ Quota panel: Grok [x] on│
|
|
608
|
+
│ ││ Quota panel: Antigravity [x] on│
|
|
609
|
+
│ ││ Quota poll interval ‹ 60 s ›│
|
|
610
|
+
└────────────────┘└────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
611
|
+
┌ Quota panel: Claude · usage.quota.panels ─────────────────────────────────────────────────────────── default: [x] on ┐
|
|
612
|
+
│Which live quota panels to show in the app (by provider name: `claude` / `codex` / `copilot` / `cursor` / `grok` / │
|
|
613
|
+
│`antigravity`). An empty list hides every quota card. │
|
|
614
|
+
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
615
|
+
↑↓ move ←→ change space toggle ⏎ edit x reset e editor 1-4/tab view ? help q quit Star on GitHub
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
- `↑` / `↓` 在所有設定之間移動,`PgUp` / `PgDn` 跳到上一個 / 下一個區段,`←` / `→` 變更數值(開關、增減數字、切換選項),`Space` 開關,`x` 把欄位重設為預設值,`e` 用 `$VISUAL` / `$EDITOR` 開啟設定檔,編輯器結束後重新載入。
|
|
619
|
+
- `Enter` 開啟編輯器:可挑選的清單、數字或文字輸入,或遠端主機清單(`a` 新增、`Enter` 編輯、`d` 刪除)。
|
|
620
|
+
- 每次變更都會立即寫入檔案,並保留檔案裡的註解。
|
|
621
|
+
- 合併、刷新間隔、quota 面板、quota 輪詢間隔與 provider 開關的變更會直接反映在執行中的介面(quota 面板則在離開 Settings 分頁時生效)。預設時間範圍、自動更新、掃描執行緒數、logging 與 remotes 要到下次啟動才生效,表單會在這些欄位上標明。
|
|
622
|
+
|
|
623
|
+
手動編輯檔案與下方的 `vct config` 指令仍然可用。
|
|
624
|
+
|
|
570
625
|
### 管理設定檔
|
|
571
626
|
|
|
572
627
|
```bash
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mai0313/vct",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
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",
|