@mai0313/vct 1.7.1 → 1.8.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
@@ -48,7 +48,7 @@ Choose your preferred view:
48
48
 
49
49
  ### Zero Configuration
50
50
 
51
- Automatically detects and processes logs from Claude Code, Codex, Copilot, Gemini, OpenCode, and Cursor. No setup required — just run and analyze.
51
+ Automatically detects and processes logs from Claude Code, Codex, Copilot, Gemini, OpenCode, and Cursor. No setup required — just run and analyze. A `~/.vct/config.toml` is created with sensible defaults on first run if you ever want to tweak behavior (see [Configuration](#configuration)).
52
52
 
53
53
  ### Rich Insights
54
54
 
@@ -149,6 +149,7 @@ Commands:
149
149
  version Display version information
150
150
  update Update to the latest version from GitHub releases
151
151
  fetch Fetch a provider's raw quota/usage API response
152
+ config Show or edit the persistent settings file (~/.vct/config.toml)
152
153
  help Print this message or the help of the given subcommand(s)
153
154
  ```
154
155
 
@@ -211,7 +212,7 @@ vct usage --table --merge-providers
211
212
  > Model rows are sorted by cost in ascending order, so the highest-spending model is listed last (right above the `TOTAL` row in `--table`). This applies to the interactive dashboard, `--table`, and `--text` output; `--json` preserves the same order. The interactive dashboard also hides models with zero usage in the selected range.
212
213
 
213
214
  > [!TIP]
214
- > 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. In the interactive dashboard, press `m` to toggle it live; `--merge-providers` opens the dashboard already merged. `--json` is left as the raw per-model export.
215
+ > 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. In the interactive dashboard, press `m` to toggle it live (the choice is saved to `~/.vct/config.toml`, so the next launch remembers it); `--merge-providers` opens the dashboard already merged. `--json` is left as the raw per-model export.
215
216
 
216
217
  ### Preview: Interactive Dashboard (`vct usage`)
217
218
 
@@ -232,7 +233,7 @@ vct usage --table --merge-providers
232
233
  ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
233
234
  │ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB │
234
235
  └─────────────────────────────────────────────────────────────────────────────────────────────┘
235
- ↑/↓ scroll PgUp/PgDn page g/G top/end m merge r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
236
+ ↑/↓ scroll m merge r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
236
237
  ```
237
238
 
238
239
  ### Preview: Table & JSON (`vct usage`)
@@ -289,11 +290,11 @@ The tool automatically scans these directories:
289
290
  - `~/.copilot/session-state/<sessionId>/events.jsonl` (Copilot CLI)
290
291
  - `~/.gemini/tmp/<project_hash>/chats/*.jsonl` (Gemini CLI)
291
292
  - `~/.local/share/opencode/opencode.db` (OpenCode — SQLite database; honors `$XDG_DATA_HOME`)
292
- - `~/.cursor/chats/*/*/store.db` (Cursor — SQLite chat stores, for `analysis`) and Cursor's dashboard usage API (for `usage` tokens + cost, via the local session token; approximated from local context data when offline)
293
+ - `~/.cursor/chats/*/*/store.db` (Cursor — SQLite chat stores, used for `analysis` and a local `usage` estimate consistent with the other providers)
293
294
 
294
295
  ### Live Quota Panels
295
296
 
296
- `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 config file: vct reads each provider's own credentials, calls its usage API on a background thread, and keeps the panels current while you work.
297
+ `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 `quota_panels` in [`config.toml`](#configuration), or set it to `[]` to hide the band.)
297
298
 
298
299
  ```
299
300
  ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
@@ -383,7 +384,7 @@ vct analysis --output today.json --daily
383
384
  ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
384
385
  │ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB │
385
386
  └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
386
- ↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
387
+ ↑/↓ scroll r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
387
388
  ```
388
389
 
389
390
  ### Preview: Table & JSON (`vct analysis`)
@@ -508,6 +509,68 @@ vct fetch copilot --table
508
509
 
509
510
  ---
510
511
 
512
+ ## Configuration
513
+
514
+ 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.
515
+
516
+ ```toml
517
+ [general]
518
+ # Default time range when no --daily/--weekly/--monthly/--all flag is given.
519
+ # one of: "daily" | "weekly" | "monthly" | "all"
520
+ default_time_range = "all"
521
+
522
+ [usage]
523
+ # Start the usage dashboard with models merged across provider prefixes.
524
+ # Toggled live with `m`; the last state is saved back here.
525
+ merge_models = false
526
+ # Which live quota panels to show in the usage TUI. Remove a name to hide that
527
+ # panel; use an empty list ([]) to hide the whole band.
528
+ quota_panels = ["claude", "codex", "copilot", "cursor"]
529
+ # Seconds between automatic refreshes of the usage TUI (minimum 1).
530
+ refresh_interval_secs = 10
531
+
532
+ [analysis]
533
+ # Seconds between automatic refreshes of the analysis TUI (minimum 1).
534
+ refresh_interval_secs = 10
535
+
536
+ [providers]
537
+ # Include each provider's sessions in usage / analysis. Set a provider to false
538
+ # to skip it entirely (no directory scan, no API).
539
+ claude = true
540
+ codex = true
541
+ copilot = true
542
+ gemini = true
543
+ opencode = true
544
+ cursor = true
545
+ ```
546
+
547
+ | Setting | Effect |
548
+ | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
549
+ | `general.default_time_range` | Period used when you pass no `--daily/--weekly/--monthly/--all`. An explicit flag always wins. |
550
+ | `usage.merge_models` | Seeds the dashboard merged; the `m` toggle saves your last choice back here. `--merge-providers` forces on. |
551
+ | `usage.quota_panels` | Which quota panels to show (`claude` / `codex` / `copilot` / `cursor`); drop a name to hide it, `[]` to hide the whole band. |
552
+ | `usage.refresh_interval_secs` | Auto-refresh cadence of the `usage` dashboard (seconds). |
553
+ | `analysis.refresh_interval_secs` | Auto-refresh cadence of the `analysis` dashboard (seconds). |
554
+ | `providers.*` | Skip a provider entirely (no scan, no API) when `false` — handy if you don't use one. |
555
+
556
+ > [!NOTE]
557
+ > 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.
558
+
559
+ ### Managing the file
560
+
561
+ ```bash
562
+ # Print the config file path
563
+ vct config path
564
+
565
+ # Print the current settings
566
+ vct config show
567
+
568
+ # Open the file in $VISUAL / $EDITOR (falls back to vi / notepad)
569
+ vct config edit
570
+ ```
571
+
572
+ ---
573
+
511
574
  ## Smart Pricing System
512
575
 
513
576
  ### How It Works
package/README.zh-CN.md CHANGED
@@ -48,7 +48,7 @@
48
48
 
49
49
  ### 零配置
50
50
 
51
- 自动检测并处理来自 Claude Code、Codex、Copilot、Gemini、OpenCode 和 Cursor 的日志。无需任何设置——直接运行即可分析。
51
+ 自动检测并处理来自 Claude Code、Codex、Copilot、Gemini、OpenCode 和 Cursor 的日志。无需任何设置——直接运行即可分析。首次运行时会自动生成一个带有合理默认值的 `~/.vct/config.toml`,方便你日后想调整行为时使用(参见 [配置](#%E9%85%8D%E7%BD%AE))。
52
52
 
53
53
  ### 丰富的洞察
54
54
 
@@ -149,6 +149,7 @@ Commands:
149
149
  version Display version information
150
150
  update Update to the latest version from GitHub releases
151
151
  fetch Fetch a provider's raw quota/usage API response
152
+ config Show or edit the persistent settings file (~/.vct/config.toml)
152
153
  help Print this message or the help of the given subcommand(s)
153
154
  ```
154
155
 
@@ -211,7 +212,7 @@ vct usage --table --merge-providers
211
212
  > Model 行会按 cost 升序排序,因此花费最高的 model 会排在最后(在 `--table` 中紧邻 `TOTAL` 行上方)。该排序适用于交互式面板、`--table` 与 `--text` 三种输出;`--json` 也会保持相同顺序。交互式面板还会隐藏在所选范围内用量为 0 的模型。
212
213
 
213
214
  > [!TIP]
214
- > 同一个 model 在不同 provider 前缀下路由时会显示成多行(`openai/gpt-5.5`、`azure/gpt-5.5`、纯 `gpt-5.5`)。`--merge-providers` 会把第一个 `/` 之后 base 名称相同的行合并(`gpt-5.5` 与 `gpt-5.4` 这类版本不同的仍分开),并把它们已定价的 cost 相加。在交互式面板中按 `m` 可实时切换;`--merge-providers` 则让面板一打开就是合并状态。`--json` 保持为逐一 model 的原始导出。
215
+ > 同一个 model 在不同 provider 前缀下路由时会显示成多行(`openai/gpt-5.5`、`azure/gpt-5.5`、纯 `gpt-5.5`)。`--merge-providers` 会把第一个 `/` 之后 base 名称相同的行合并(`gpt-5.5` 与 `gpt-5.4` 这类版本不同的仍分开),并把它们已定价的 cost 相加。在交互式面板中按 `m` 可实时切换(该选择会保存到 `~/.vct/config.toml`,因此下次启动会记住它);`--merge-providers` 则让面板一打开就是合并状态。`--json` 保持为逐一 model 的原始导出。
215
216
 
216
217
  ### 预览:交互式面板(`vct usage`)
217
218
 
@@ -232,7 +233,7 @@ vct usage --table --merge-providers
232
233
  ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
233
234
  │ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB │
234
235
  └─────────────────────────────────────────────────────────────────────────────────────────────┘
235
- ↑/↓ scroll PgUp/PgDn page g/G top/end m merge r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
236
+ ↑/↓ scroll m merge r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
236
237
  ```
237
238
 
238
239
  ### 预览:表格与 JSON(`vct usage`)
@@ -289,11 +290,11 @@ Totals (by Provider)
289
290
  - `~/.copilot/session-state/<sessionId>/events.jsonl`(Copilot CLI)
290
291
  - `~/.gemini/tmp/<project_hash>/chats/*.jsonl`(Gemini CLI)
291
292
  - `~/.local/share/opencode/opencode.db`(OpenCode,SQLite 数据库;遵循 `$XDG_DATA_HOME`)
292
- - `~/.cursor/chats/*/*/store.db`(Cursor,SQLite 会话库,用于 `analysis`)以及 Cursor 官方 dashboard 用量 API(用于 `usage` 的 token 与费用,凭本地 session token 读取;离线时改用本地 context 数据估算)
293
+ - `~/.cursor/chats/*/*/store.db`(Cursor,SQLite 会话库,用于 `analysis`,并给出一个与其他 provider 一致的本地 `usage` 估算)
293
294
 
294
295
  ### 实时额度面板
295
296
 
296
- `vct usage` 会**在仪表盘中直接显示 Claude Code、Codex、GitHub Copilot 与 Cursor 的实时剩余额度——完全零配置。** 不需要 status-line hook,也不需要配置文件:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。
297
+ `vct usage` 会**在仪表盘中直接显示 Claude Code、Codex、GitHub Copilot 与 Cursor 的实时剩余额度——完全零配置。** 不需要 status-line hook,也无需手动输入任何凭证:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。(想要更清爽的面板?在 [`config.toml`](#%E9%85%8D%E7%BD%AE) 中精简 `quota_panels`,或设为 `[]` 隐藏整栏。)
297
298
 
298
299
  ```
299
300
  ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
@@ -383,7 +384,7 @@ vct analysis --output today.json --daily
383
384
  ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
384
385
  │ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB │
385
386
  └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
386
- ↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
387
+ ↑/↓ scroll r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
387
388
  ```
388
389
 
389
390
  ### 预览:表格与 JSON(`vct analysis`)
@@ -508,6 +509,67 @@ vct fetch copilot --table
508
509
 
509
510
  ---
510
511
 
512
+ ## 配置
513
+
514
+ vct 会把用户设置保存在 `~/.vct/config.toml` 中。该文件会在**首次运行时以默认值自动生成**,因此你完全不必手动编写——只有想修改某个默认值时才编辑它。
515
+
516
+ ```toml
517
+ [general]
518
+ # 未指定 --daily/--weekly/--monthly/--all flag 时使用的默认时间范围
519
+ # 取值之一: "daily" | "weekly" | "monthly" | "all"
520
+ default_time_range = "all"
521
+
522
+ [usage]
523
+ # 启动 usage 面板时就把跨 provider 前缀的 model 合并显示
524
+ # 可用 `m` 实时切换, 最后一次的状态会保存回这里
525
+ merge_models = false
526
+ # 在 usage TUI 中显示哪些实时额度面板; 删除某个名称即可隐藏该面板, 用空列表 ([]) 隐藏整栏
527
+ quota_panels = ["claude", "codex", "copilot", "cursor"]
528
+ # usage TUI 自动刷新的间隔秒数 (最小为 1)
529
+ refresh_interval_secs = 10
530
+
531
+ [analysis]
532
+ # analysis TUI 自动刷新的间隔秒数 (最小为 1)
533
+ refresh_interval_secs = 10
534
+
535
+ [providers]
536
+ # 是否把各 provider 的 session 纳入 usage / analysis, 设为 false
537
+ # 就会完全跳过它 (不扫描目录, 也不调用 API)
538
+ claude = true
539
+ codex = true
540
+ copilot = true
541
+ gemini = true
542
+ opencode = true
543
+ cursor = true
544
+ ```
545
+
546
+ | 设置项 | 作用 |
547
+ | -------------------------------- | ------------------------------------------------------------------------------------------------ |
548
+ | `general.default_time_range` | 当你没有传入 `--daily/--weekly/--monthly/--all` 时使用的时间范围。显式传入的 flag 始终优先。 |
549
+ | `usage.merge_models` | 让面板启动时就处于合并状态;`m` 切换会把你上次的选择保存回这里。`--merge-providers` 会强制开启。 |
550
+ | `usage.quota_panels` | 显示哪些额度面板(`claude` / `codex` / `copilot` / `cursor`);删除名称即可隐藏,`[]` 隐藏整栏。 |
551
+ | `usage.refresh_interval_secs` | `usage` 面板的自动刷新间隔(秒)。 |
552
+ | `analysis.refresh_interval_secs` | `analysis` 面板的自动刷新间隔(秒)。 |
553
+ | `providers.*` | 设为 `false` 时完全跳过某个 provider(不扫描、不调用 API)——如果你不用某个 provider 会很方便。 |
554
+
555
+ > [!NOTE]
556
+ > Cursor 的 `usage` 是从聊天库得出的**本地估算**,因此它会像 Claude Code / Codex / Copilot / Gemini 一样(都是从本地 session 文件计算得出)无需联网。该估算会低估 Cursor 的真实花费,因为其中很大一部分是以 Cursor 内部的 model 名称计费,本地数据无法为这些名称定价,所以请把 Cursor 费用视为近似值。
557
+
558
+ ### 管理配置文件
559
+
560
+ ```bash
561
+ # 打印配置文件路径
562
+ vct config path
563
+
564
+ # 打印当前设置
565
+ vct config show
566
+
567
+ # 在 $VISUAL / $EDITOR 中打开文件 (回退到 vi / notepad)
568
+ vct config edit
569
+ ```
570
+
571
+ ---
572
+
511
573
  ## 智能定价系统
512
574
 
513
575
  ### 工作原理
package/README.zh-TW.md CHANGED
@@ -48,7 +48,7 @@
48
48
 
49
49
  ### 零設定
50
50
 
51
- 自動偵測並處理 Claude Code、Codex、Copilot、Gemini、OpenCode 及 Cursor 的日誌檔。不需要任何設定——直接執行就能分析。
51
+ 自動偵測並處理 Claude Code、Codex、Copilot、Gemini、OpenCode 及 Cursor 的日誌檔。不需要任何設定——直接執行就能分析。首次執行時會以合理的預設值建立 `~/.vct/config.toml`,日後若想微調行為即可編輯它(見 [設定](#%E8%A8%AD%E5%AE%9A))。
52
52
 
53
53
  ### 豐富洞察
54
54
 
@@ -149,6 +149,7 @@ Commands:
149
149
  version Display version information
150
150
  update Update to the latest version from GitHub releases
151
151
  fetch Fetch a provider's raw quota/usage API response
152
+ config Show or edit the persistent settings file (~/.vct/config.toml)
152
153
  help Print this message or the help of the given subcommand(s)
153
154
  ```
154
155
 
@@ -211,7 +212,7 @@ vct usage --table --merge-providers
211
212
  > Model 列會依 cost 由小到大排序,所以花費最高的 model 會排在最後(在 `--table` 中緊鄰 `TOTAL` 列上方)。這個排序會套用到互動式儀表板、`--table` 與 `--text` 三種輸出;`--json` 也會保持相同順序。互動式儀表板也會隱藏在所選範圍內用量為 0 的 model。
212
213
 
213
214
  > [!TIP]
214
- > 同一個 model 在不同 provider 前綴下路由時會顯示成多列(`openai/gpt-5.5`、`azure/gpt-5.5`、純 `gpt-5.5`)。`--merge-providers` 會把第一個 `/` 之後 base 名稱相同的列合併(`gpt-5.5` 與 `gpt-5.4` 這類版本不同的仍分開),並把它們已定價的 cost 相加。在互動式儀表板中按 `m` 可即時切換;`--merge-providers` 則讓儀表板一打開就是合併狀態。`--json` 保持為逐一 model 的原始輸出。
215
+ > 同一個 model 在不同 provider 前綴下路由時會顯示成多列(`openai/gpt-5.5`、`azure/gpt-5.5`、純 `gpt-5.5`)。`--merge-providers` 會把第一個 `/` 之後 base 名稱相同的列合併(`gpt-5.5` 與 `gpt-5.4` 這類版本不同的仍分開),並把它們已定價的 cost 相加。在互動式儀表板中按 `m` 可即時切換(這個選擇會存進 `~/.vct/config.toml`,所以下次啟動時會記住這個設定);`--merge-providers` 則讓儀表板一打開就是合併狀態。`--json` 保持為逐一 model 的原始輸出。
215
216
 
216
217
  ### 預覽:互動式儀表板(`vct usage`)
217
218
 
@@ -232,7 +233,7 @@ vct usage --table --merge-providers
232
233
  ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
233
234
  │ Total Cost: $79.33 | Total Tokens: 49.3M | Models: 3 | Memory: 42.8 MB │
234
235
  └─────────────────────────────────────────────────────────────────────────────────────────────┘
235
- ↑/↓ scroll PgUp/PgDn page g/G top/end m merge r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
236
+ ↑/↓ scroll m merge r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
236
237
  ```
237
238
 
238
239
  ### 預覽:表格與 JSON(`vct usage`)
@@ -289,11 +290,11 @@ Totals (by Provider)
289
290
  - `~/.copilot/session-state/<sessionId>/events.jsonl`(Copilot CLI)
290
291
  - `~/.gemini/tmp/<project_hash>/chats/*.jsonl`(Gemini CLI)
291
292
  - `~/.local/share/opencode/opencode.db`(OpenCode,SQLite 資料庫;遵循 `$XDG_DATA_HOME`)
292
- - `~/.cursor/chats/*/*/store.db`(Cursor,SQLite 對話庫,用於 `analysis`)以及 Cursor 官方 dashboard 用量 API(用於 `usage` 的 token 與費用,以本地 session token 讀取;離線時改用本地 context 資料估算)
293
+ - `~/.cursor/chats/*/*/store.db`(Cursor,SQLite 對話庫,用於 `analysis`,並產生與其他 provider 一致的本地 `usage` 估算)
293
294
 
294
295
  ### 即時額度面板
295
296
 
296
- `vct usage` 會**在儀表板中直接顯示 Claude Code、Codex、GitHub Copilot 與 Cursor 的即時剩餘額度——完全零設定。** 不需要 status-line hook,也不需要設定檔:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。
297
+ `vct usage` 會**在儀表板中直接顯示 Claude Code、Codex、GitHub Copilot 與 Cursor 的即時剩餘額度——完全零設定。** 不需要 status-line hook,也不需要手動輸入憑證:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。(想要更清爽的儀表板嗎?在 [`config.toml`](#%E8%A8%AD%E5%AE%9A) 中精簡 `quota_panels`,或設為 `[]` 隱藏整條。)
297
298
 
298
299
  ```
299
300
  ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
@@ -383,7 +384,7 @@ vct analysis --output today.json --daily
383
384
  ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
384
385
  │ Total Lines: 16.1K | Total Tools: 619 | Models: 3 | Memory: 41.2 MB │
385
386
  └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
386
- ↑/↓ scroll PgUp/PgDn page g/G top/end r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
387
+ ↑/↓ scroll r refresh q quit | ★ github.com/Mai0313/VibeCodingTracker
387
388
  ```
388
389
 
389
390
  ### 預覽:表格與 JSON(`vct analysis`)
@@ -508,6 +509,67 @@ vct fetch copilot --table
508
509
 
509
510
  ---
510
511
 
512
+ ## 設定
513
+
514
+ vct 會把使用者設定存放在 `~/.vct/config.toml`。這個檔案會在**首次執行時以預設值自動建立**,所以你完全不必手動撰寫,只有想更改某個預設值時才需要編輯它。
515
+
516
+ ```toml
517
+ [general]
518
+ # 未指定 --daily/--weekly/--monthly/--all flag 時使用的預設時間範圍。
519
+ # 可選值:"daily" | "weekly" | "monthly" | "all"
520
+ default_time_range = "all"
521
+
522
+ [usage]
523
+ # 啟動 usage 儀表板時,是否先把不同 provider 前綴的 model 合併。
524
+ # 可用 `m` 即時切換;最後的狀態會存回這裡。
525
+ merge_models = false
526
+ # 在 usage TUI 中顯示哪些即時額度面板;移除某個名稱即可隱藏該面板,用空列表 ([]) 隱藏整條。
527
+ quota_panels = ["claude", "codex", "copilot", "cursor"]
528
+ # usage TUI 自動刷新的間隔秒數(最少 1)。
529
+ refresh_interval_secs = 10
530
+
531
+ [analysis]
532
+ # analysis TUI 自動刷新的間隔秒數(最少 1)。
533
+ refresh_interval_secs = 10
534
+
535
+ [providers]
536
+ # 是否把各 provider 的 session 納入 usage / analysis。把某個 provider 設為 false
537
+ # 就會完全略過它(不掃描目錄,也不呼叫 API)。
538
+ claude = true
539
+ codex = true
540
+ copilot = true
541
+ gemini = true
542
+ opencode = true
543
+ cursor = true
544
+ ```
545
+
546
+ | 設定項 | 效果 |
547
+ | -------------------------------- | ----------------------------------------------------------------------------------------------- |
548
+ | `general.default_time_range` | 未指定 `--daily/--weekly/--monthly/--all` 時使用的時間範圍。明確指定的 flag 一律優先。 |
549
+ | `usage.merge_models` | 讓儀表板一開始就是合併狀態;`m` 切換會把你最後的選擇存回這裡。`--merge-providers` 會強制開啟。 |
550
+ | `usage.quota_panels` | 顯示哪些額度面板(`claude` / `codex` / `copilot` / `cursor`);移除名稱即可隱藏,`[]` 隱藏整條。 |
551
+ | `usage.refresh_interval_secs` | `usage` 儀表板自動刷新的間隔(秒)。 |
552
+ | `analysis.refresh_interval_secs` | `analysis` 儀表板自動刷新的間隔(秒)。 |
553
+ | `providers.*` | 設為 `false` 時完全略過某個 provider(不掃描、不呼叫 API),沒在用的話很方便。 |
554
+
555
+ > [!NOTE]
556
+ > Cursor 的 `usage` 是從對話庫產生的**本地估算**,因此行為與 Claude Code / Codex / Copilot / Gemini 一致(全都是從本地 session 檔案計算),而且不需要連網。這個估算會低估 Cursor 的真實花費,因為其中有很大一部分是以 Cursor 內部的 model 名稱計費,而本地資料無法為這些名稱定價,所以請把 Cursor 的費用視為概估值。
557
+
558
+ ### 管理設定檔
559
+
560
+ ```bash
561
+ # 印出設定檔路徑
562
+ vct config path
563
+
564
+ # 印出目前的設定
565
+ vct config show
566
+
567
+ # 用 $VISUAL / $EDITOR 開啟檔案(找不到時回退到 vi / notepad)
568
+ vct config edit
569
+ ```
570
+
571
+ ---
572
+
511
573
  ## 智慧定價系統
512
574
 
513
575
  ### 運作方式
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/vct",
3
- "version": "1.7.1",
3
+ "version": "1.8.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",