@mai0313/vibe-coding-tracker 0.16.0 → 1.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 CHANGED
@@ -143,7 +143,6 @@ vct <COMMAND> [OPTIONS]
143
143
  Commands:
144
144
  analysis Analyze JSONL conversation files (single file or all sessions)
145
145
  usage Display token usage statistics
146
- statusline Cache Claude Code rate limits from a statusLine hook (stdin JSON)
147
146
  version Display version information
148
147
  update Update to the latest version from GitHub releases
149
148
  help Print this message or the help of the given subcommand(s)
@@ -151,12 +150,12 @@ Commands:
151
150
 
152
151
  Time range flags (shared by `usage` and `analysis`, mutually exclusive, default `--all`):
153
152
 
154
- | Flag | Window |
155
- | ----------- | --------------------------------- |
156
- | `--daily` | Sessions modified today |
157
- | `--weekly` | Current ISO week (Monday → today) |
158
- | `--monthly` | Current calendar month |
159
- | `--all` | Every session on disk (default) |
153
+ | Flag | Window |
154
+ | ------------- | --------------------------------- |
155
+ | `--daily` | Sessions modified today |
156
+ | `--weekly` | Current ISO week (Monday → today) |
157
+ | `--monthly` | Current calendar month |
158
+ | `-a`, `--all` | Every session on disk (default) |
160
159
 
161
160
  ---
162
161
 
@@ -172,6 +171,7 @@ Time range flags (shared by `usage` and `analysis`, mutually exclusive, default
172
171
  | `--table` | Static table, no TUI |
173
172
  | `--text` | Plain text, script-friendly |
174
173
  | `--json` | JSON with enriched pricing metadata |
174
+ | `--output <FILE>` | Save enriched JSON to a file |
175
175
  | `--daily` / `--weekly` / `--monthly` / `--all` | Time range filter (see table above) |
176
176
 
177
177
  ### Basic Usage
@@ -189,6 +189,9 @@ vct usage --text
189
189
  # JSON for data processing (includes cost_usd and matched_model fields)
190
190
  vct usage --json
191
191
 
192
+ # Save enriched JSON straight to a file
193
+ vct usage --output report.json
194
+
192
195
  # Combine time range with output format
193
196
  vct usage --weekly
194
197
  vct usage --table --monthly
@@ -232,7 +235,7 @@ The tool automatically scans these directories:
232
235
 
233
236
  ### Live Quota Panels
234
237
 
235
- At the bottom of the interactive dashboard, the per-provider stats sit on the left and two live quota panels sit on the right:
238
+ `vct usage` shows **live remaining quota for Claude Code and Codex right in the dashboard — with zero setup.** No status-line hook, no config file: vct reads each provider's own OAuth credentials, calls its usage API on a background thread, and keeps the panels current while you work.
236
239
 
237
240
  ```
238
241
  ┌ Provider/Tokens/Cost/Days ┬ Claude ────────┬ Codex ──────────┐
@@ -243,10 +246,14 @@ At the bottom of the interactive dashboard, the per-provider stats sit on the le
243
246
  └───────────────────────────┴────────────────┴─────────────────┘
244
247
  ```
245
248
 
246
- - **Claude** — 5-hour and weekly rate-limit usage. Claude Code only exposes these limits through its `statusLine` hook, so wire `vct statusline ingest` into your statusLine (see [Statusline Command](#statusline-command)) for this panel to populate.
247
- - **Codex** — plan tier, 5-hour and weekly usage, and credit balance. Pulled live from the ChatGPT backend (`wham/usage`) using the token in `~/.codex/auth.json` on a background thread; when unavailable it falls back to the newest `rate_limits` in your Codex session logs (the title shows `(API)` vs `(session)`).
249
+ - **Claude** — 5-hour and weekly usage from the official OAuth usage API (`GET /api/oauth/usage`), read from `~/.claude/.credentials.json`.
250
+ - **Codex** — plan tier, 5-hour and weekly usage, and credit balance from the ChatGPT backend (`wham/usage`) using `~/.codex/auth.json`; falls back to the newest `rate_limits` in your Codex session logs when the API is unavailable (the title shows `Codex` vs `Codex (session)`).
251
+
252
+ **Automatic token refresh.** For both providers, 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.
253
+
254
+ A panel appears only for a provider whose credentials are present. Quota panels appear only in the interactive TUI; `--table`, `--text`, and `--json` are unchanged.
248
255
 
249
- Quota panels appear only in the interactive TUI; `--table`, `--text`, and `--json` are unchanged.
256
+ > **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.
250
257
 
251
258
  ---
252
259
 
@@ -320,35 +327,6 @@ vct analysis --output today.json --daily
320
327
 
321
328
  ---
322
329
 
323
- ## Statusline Command
324
-
325
- **Feed Claude Code rate limits into the `usage` dashboard.**
326
-
327
- Claude Code only exposes its 5-hour / weekly rate limits through the `statusLine` hook's stdin JSON, so `vct` captures them from there and caches them to `~/.vibe_coding_tracker/claude_rate_limits.json` for the Claude quota panel.
328
-
329
- ### If you already have a statusLine
330
-
331
- Add one backgrounded line to your existing statusLine script. It has zero impact on your current display and is isolated, so a vct error can never disturb the statusLine:
332
-
333
- ```bash
334
- printf '%s' "$input" | vct statusline ingest >/dev/null 2>&1 &
335
- ```
336
-
337
- ### If you do not have a statusLine yet
338
-
339
- Point Claude Code's `~/.claude/settings.json` straight at vct, which caches the limits and prints a compact one-line status:
340
-
341
- ```json
342
- {
343
- "statusLine": {
344
- "type": "command",
345
- "command": "vct statusline"
346
- }
347
- }
348
- ```
349
-
350
- ---
351
-
352
330
  ## Update Command
353
331
 
354
332
  **Keep your installation up-to-date automatically.**
package/README.zh-CN.md CHANGED
@@ -143,7 +143,6 @@ vct <COMMAND> [OPTIONS]
143
143
  Commands:
144
144
  analysis Analyze JSONL conversation files (single file or all sessions)
145
145
  usage Display token usage statistics
146
- statusline Cache Claude Code rate limits from a statusLine hook (stdin JSON)
147
146
  version Display version information
148
147
  update Update to the latest version from GitHub releases
149
148
  help Print this message or the help of the given subcommand(s)
@@ -151,12 +150,12 @@ Commands:
151
150
 
152
151
  时间范围 flag(`usage` 与 `analysis` 共用,互斥,默认 `--all`):
153
152
 
154
- | Flag | 范围 |
155
- | ----------- | ---------------------------- |
156
- | `--daily` | 今天更新过的 session |
157
- | `--weekly` | 本 ISO 周(周一 → 今天) |
158
- | `--monthly` | 本自然月 |
159
- | `--all` | 磁盘上所有 session(默认值) |
153
+ | Flag | 范围 |
154
+ | ------------- | ---------------------------- |
155
+ | `--daily` | 今天更新过的 session |
156
+ | `--weekly` | 本 ISO 周(周一 → 今天) |
157
+ | `--monthly` | 本自然月 |
158
+ | `-a`, `--all` | 磁盘上所有 session(默认值) |
160
159
 
161
160
  ---
162
161
 
@@ -172,6 +171,7 @@ Commands:
172
171
  | `--table` | 静态表格,不启动 TUI |
173
172
  | `--text` | 纯文本,适合脚本处理 |
174
173
  | `--json` | JSON 输出,附带定价信息 |
174
+ | `--output <FILE>` | 将富化 JSON 保存到文件 |
175
175
  | `--daily` / `--weekly` / `--monthly` / `--all` | 时间范围筛选(见上方表格) |
176
176
 
177
177
  ### 基本用法
@@ -189,6 +189,9 @@ vct usage --text
189
189
  # JSON 输出,包含 cost_usd 与 matched_model 字段
190
190
  vct usage --json
191
191
 
192
+ # 直接把富化 JSON 保存到文件
193
+ vct usage --output report.json
194
+
192
195
  # 时间范围与输出格式可自由组合
193
196
  vct usage --weekly
194
197
  vct usage --table --monthly
@@ -232,7 +235,7 @@ vct usage --json --daily
232
235
 
233
236
  ### 实时额度面板
234
237
 
235
- 在交互式仪表盘底部,左侧是各 provider 统计,右侧是两个实时额度面板:
238
+ `vct usage` 会**在仪表盘中直接显示 Claude Code 与 Codex 的实时剩余额度——完全零配置。** 不需要 status-line hook,也不需要配置文件:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。
236
239
 
237
240
  ```
238
241
  ┌ Provider/Tokens/Cost/Days ┬ Claude ────────┬ Codex ──────────┐
@@ -243,10 +246,14 @@ vct usage --json --daily
243
246
  └───────────────────────────┴────────────────┴─────────────────┘
244
247
  ```
245
248
 
246
- - **Claude** — 5 小时和每周的额度用量。Claude Code 仅通过 `statusLine` hook 暴露这些额度,需将 `vct statusline ingest` 接入你的 statusLine(见 [Statusline 命令](#statusline-%E5%91%BD%E4%BB%A4))此面板才会有数据。
247
- - **Codex** — 套餐类型、5 小时和每周用量、额度余额。后台线程使用 `~/.codex/auth.json` 中的 token 从 ChatGPT 后端(`wham/usage`)实时拉取;不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `(API)` 或 `(session)`)。
249
+ - **Claude** — 5 小时和每周用量,来自官方 OAuth 用量 API(`GET /api/oauth/usage`),从 `~/.claude/.credentials.json` 读取。
250
+ - **Codex** — 套餐类型、5 小时和每周用量以及额度余额,使用 `~/.codex/auth.json` 从 ChatGPT 后端(`wham/usage`)获取;API 不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `Codex` 或 `Codex (session)`)。
251
+
252
+ **自动刷新 token。** 对这两个 provider,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式),因此 token 会在多次检查之间复用,而不是每次都重新刷新。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。
253
+
254
+ 只有在某个 provider 的凭证存在时,才会显示对应的面板。额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
248
255
 
249
- 额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
256
+ > **平台说明:** 在 macOS 上,Claude Code 会把 OAuth 凭证保存在系统 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不会显示 Claude 面板。
250
257
 
251
258
  ---
252
259
 
@@ -320,35 +327,6 @@ vct analysis --output today.json --daily
320
327
 
321
328
  ---
322
329
 
323
- ## Statusline 命令
324
-
325
- **将 Claude Code 的额度信息接入 `usage` 仪表盘。**
326
-
327
- Claude Code 仅通过 `statusLine` hook 的 stdin JSON 暴露其 5 小时 / 每周额度,因此 `vct` 从那里捕获并缓存到 `~/.vibe_coding_tracker/claude_rate_limits.json`,供 Claude 额度面板读取。
328
-
329
- ### 如果你已有 statusLine
330
-
331
- 在现有 statusLine 脚本中加一行后台命令。它对当前显示零影响,且相互隔离,vct 出错也绝不会干扰 statusLine:
332
-
333
- ```bash
334
- printf '%s' "$input" | vct statusline ingest >/dev/null 2>&1 &
335
- ```
336
-
337
- ### 如果你还没有 statusLine
338
-
339
- 让 Claude Code 的 `~/.claude/settings.json` 直接指向 vct,它会缓存额度并打印一行简洁状态:
340
-
341
- ```json
342
- {
343
- "statusLine": {
344
- "type": "command",
345
- "command": "vct statusline"
346
- }
347
- }
348
- ```
349
-
350
- ---
351
-
352
330
  ## Update 命令
353
331
 
354
332
  **自动保持安装版本为最新。**
package/README.zh-TW.md CHANGED
@@ -143,7 +143,6 @@ vct <COMMAND> [OPTIONS]
143
143
  Commands:
144
144
  analysis Analyze JSONL conversation files (single file or all sessions)
145
145
  usage Display token usage statistics
146
- statusline Cache Claude Code rate limits from a statusLine hook (stdin JSON)
147
146
  version Display version information
148
147
  update Update to the latest version from GitHub releases
149
148
  help Print this message or the help of the given subcommand(s)
@@ -151,12 +150,12 @@ Commands:
151
150
 
152
151
  時間範圍 flag(`usage` 與 `analysis` 共用,互斥,預設 `--all`):
153
152
 
154
- | Flag | 範圍 |
155
- | ----------- | -------------------------- |
156
- | `--daily` | 今天更新過的 session |
157
- | `--weekly` | 本 ISO 週(週一 → 今天) |
158
- | `--monthly` | 本自然月 |
159
- | `--all` | 磁碟上所有 session(預設) |
153
+ | Flag | 範圍 |
154
+ | ------------- | -------------------------- |
155
+ | `--daily` | 今天更新過的 session |
156
+ | `--weekly` | 本 ISO 週(週一 → 今天) |
157
+ | `--monthly` | 本自然月 |
158
+ | `-a`, `--all` | 磁碟上所有 session(預設) |
160
159
 
161
160
  ---
162
161
 
@@ -172,6 +171,7 @@ Commands:
172
171
  | `--table` | 靜態表格,不啟動 TUI |
173
172
  | `--text` | 純文字,適合腳本處理 |
174
173
  | `--json` | JSON 輸出,附帶 pricing 資訊 |
174
+ | `--output <FILE>` | 將富化 JSON 存成檔案 |
175
175
  | `--daily` / `--weekly` / `--monthly` / `--all` | 時間範圍篩選(見上方表格) |
176
176
 
177
177
  ### 基本用法
@@ -189,6 +189,9 @@ vct usage --text
189
189
  # JSON 輸出,包含 cost_usd 與 matched_model 欄位
190
190
  vct usage --json
191
191
 
192
+ # 直接把富化 JSON 存成檔案
193
+ vct usage --output report.json
194
+
192
195
  # 時間範圍與輸出格式可自由組合
193
196
  vct usage --weekly
194
197
  vct usage --table --monthly
@@ -232,7 +235,7 @@ vct usage --json --daily
232
235
 
233
236
  ### 即時額度面板
234
237
 
235
- 在互動式儀表板底部,左側是各 provider 統計,右側是兩個即時額度面板:
238
+ `vct usage` 會**在儀表板中直接顯示 Claude Code 與 Codex 的即時剩餘額度——完全零設定。** 不需要 status-line hook,也不需要設定檔:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。
236
239
 
237
240
  ```
238
241
  ┌ Provider/Tokens/Cost/Days ┬ Claude ────────┬ Codex ──────────┐
@@ -243,10 +246,14 @@ vct usage --json --daily
243
246
  └───────────────────────────┴────────────────┴─────────────────┘
244
247
  ```
245
248
 
246
- - **Claude** — 5 小時和每週的額度用量。Claude Code 僅透過 `statusLine` hook 暴露這些額度,需將 `vct statusline ingest` 接入你的 statusLine(見 [Statusline 指令](#statusline-%E6%8C%87%E4%BB%A4))此面板才會有資料。
247
- - **Codex** — 方案類型、5 小時和每週用量、額度餘額。背景執行緒使用 `~/.codex/auth.json` 中的 token 從 ChatGPT 後端(`wham/usage`)即時拉取;不可用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `(API)` 或 `(session)`)。
249
+ - **Claude** — 5 小時和每週用量,來自官方 OAuth 用量 API(`GET /api/oauth/usage`),從 `~/.claude/.credentials.json` 讀取。
250
+ - **Codex** — 方案類型、5 小時和每週用量以及額度餘額,使用 `~/.codex/auth.json` 從 ChatGPT 後端(`wham/usage`)取得;API 無法使用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `Codex` 或 `Codex (session)`)。
251
+
252
+ **自動刷新 token。** 對這兩個 provider,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式),因此 token 會在多次檢查之間重複使用,而不是每次都重新刷新。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。
253
+
254
+ 只有在某個 provider 的憑證存在時,才會顯示對應的面板。額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
248
255
 
249
- 額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
256
+ > **平台說明:** 在 macOS 上,Claude Code 會把 OAuth 憑證儲存在系統 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不會顯示 Claude 面板。
250
257
 
251
258
  ---
252
259
 
@@ -320,35 +327,6 @@ vct analysis --output today.json --daily
320
327
 
321
328
  ---
322
329
 
323
- ## Statusline 指令
324
-
325
- **將 Claude Code 的額度資訊接入 `usage` 儀表板。**
326
-
327
- Claude Code 僅透過 `statusLine` hook 的 stdin JSON 暴露其 5 小時 / 每週額度,因此 `vct` 從那裡擷取並快取到 `~/.vibe_coding_tracker/claude_rate_limits.json`,供 Claude 額度面板讀取。
328
-
329
- ### 如果你已有 statusLine
330
-
331
- 在現有 statusLine 腳本中加一行背景指令。它對目前顯示零影響,且相互隔離,vct 出錯也絕不會干擾 statusLine:
332
-
333
- ```bash
334
- printf '%s' "$input" | vct statusline ingest >/dev/null 2>&1 &
335
- ```
336
-
337
- ### 如果你還沒有 statusLine
338
-
339
- 讓 Claude Code 的 `~/.claude/settings.json` 直接指向 vct,它會快取額度並印出一行精簡狀態:
340
-
341
- ```json
342
- {
343
- "statusLine": {
344
- "type": "command",
345
- "command": "vct statusline"
346
- }
347
- }
348
- ```
349
-
350
- ---
351
-
352
330
  ## Update 指令
353
331
 
354
332
  **自動保持安裝為最新版本。**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/vibe-coding-tracker",
3
- "version": "0.16.0",
3
+ "version": "1.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",