@mai0313/vibe-coding-tracker 1.1.0 → 1.3.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
@@ -235,27 +235,28 @@ The tool automatically scans these directories:
235
235
 
236
236
  ### Live Quota Panels
237
237
 
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.
238
+ `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.
239
239
 
240
240
  ```
241
- ┌ Provider/Tokens/Cost/Days ┬ Claude ───────────────────┬ Codex ────────────────────┐
242
- │ Claude 1.2M $3.00 4d │ Plan: max 20x │ Plan: plus │
243
- │ Codex 800K $0.00 6d │ 5h ▰▱▱▱▱ 16% ↻ 2h0m │ 5h ▰▰▱▱▱ 37% ↻ 2h33m │
244
- │ ... │ 7d ▰▰▱▱▱ 41% ↻ 5d │ 7d ▰▰▱▱▱ 24% ↻ 3d16h │
245
- │ │ Opus ▰▰▰▱▱ 61% ↻ 5d │ Credits: 0 +3 reset │
246
- │ │ Balance: - $0.00 used │ updated just now │
247
- │ │ updated just now │ │
248
- └───────────────────────────┴────────────────────────────┴────────────────────────────┘
241
+ ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
242
+ │ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
243
+ │ 5h ▰▱▱▱▱ 16% ↻ 2h0m ││ 5h ▰▰▱▱▱ 37% ↻ 2h33m││ prem ▰▱▱▱▱ 2% ↻ 25d ││ total ▰▰▰▰▰ 94% ↻ 17d │
244
+ │ 7d ▰▰▱▱▱ 41% ↻ 5d ││ 7d ▰▰▱▱▱ 24% ↻ 3d16h││ 1464/1500 · chat/compl ∞││ auto ▰▰▰▰▰ 100% ↻ 17d │
245
+ │ Opus ▰▰▰▱▱ 61% ↻ 5d ││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 44% ↻ 17d │
246
+ │ Balance: - $0.00 used ││ updated just now ││ ││ updated just now │
247
+ └─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
249
248
  ```
250
249
 
251
250
  - **Claude** — plan tier, 5-hour, weekly, and per-model weekly usage from the official OAuth usage API (`GET /api/oauth/usage`), read from `~/.claude/.credentials.json`, plus your credit balance. Polled about once a minute to stay under the endpoint's rate limit; a red `LIMIT` flag appears in the title when a cap is hit. The per-model weekly row is best-effort and simply hides when that scope is not returned.
252
251
  - **Codex** — plan tier, 5-hour and weekly usage, and credit balance from the ChatGPT backend (`wham/usage`) using `~/.codex/auth.json` (with approximate remaining messages / spend cap when applicable); falls back to the newest `rate_limits` in your Codex session logs when the API is unavailable (the title shows `Codex` vs `Codex (session)`).
252
+ - **Copilot** — plan tier, premium-request quota (remaining / entitlement plus a gauge), and unlimited chat / completions 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.
253
+ - **Cursor** — plan tier, total / auto / API usage percentages, and on-demand spend from cursor.com (`GET /api/usage-summary`), using the session token in `~/.config/cursor/auth.json`. Refresh is reactive: vct re-reads the file each poll and uses the token while it is valid, since the official Cursor client keeps it fresh.
253
254
 
254
- **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.
255
+ **Automatic token refresh.** For Claude and Codex, when a token is near expiry or rejected, vct refreshes it and writes the new token back to the provider's own credential file (in that CLI's exact format), so a token is reused across checks rather than refreshed every time. If a refresh cannot proceed, the panel shows a `run: <provider> auth login` hint instead of breaking. Copilot (long-lived token) and Cursor (kept fresh by its own client) are read-only — vct never writes their credential files.
255
256
 
256
- 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.
257
+ A panel appears only for a provider whose credentials are present. When four panels are shown the Provider Usage table folds out of the band, and at narrow widths the panels wrap to a 2×2 grid. Quota panels appear only in the interactive TUI; `--table`, `--text`, and `--json` are unchanged.
257
258
 
258
- > **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.
259
+ > **Platform note:** on macOS, Claude Code stores its OAuth credentials in the system Keychain rather than `~/.claude/.credentials.json`, so the Claude panel is not shown on macOS. Cursor's `~/.config/cursor` credential path is Linux-oriented.
259
260
 
260
261
  ---
261
262
 
package/README.zh-CN.md CHANGED
@@ -235,27 +235,28 @@ vct usage --json --daily
235
235
 
236
236
  ### 实时额度面板
237
237
 
238
- `vct usage` 会**在仪表盘中直接显示 Claude Code 与 Codex 的实时剩余额度——完全零配置。** 不需要 status-line hook,也不需要配置文件:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。
238
+ `vct usage` 会**在仪表盘中直接显示 Claude Code、Codex、GitHub Copilot 与 Cursor 的实时剩余额度——完全零配置。** 不需要 status-line hook,也不需要配置文件:vct 会读取各 provider 自己的 OAuth 凭证,在后台线程调用其用量 API,并在你工作时保持面板持续更新。
239
239
 
240
240
  ```
241
- ┌ Provider/Tokens/Cost/Days ┬ Claude ───────────────────┬ Codex ────────────────────┐
242
- │ Claude 1.2M $3.00 4d │ Plan: max 20x │ Plan: plus │
243
- │ Codex 800K $0.00 6d │ 5h ▰▱▱▱▱ 16% ↻ 2h0m │ 5h ▰▰▱▱▱ 37% ↻ 2h33m │
244
- │ ... │ 7d ▰▰▱▱▱ 41% ↻ 5d │ 7d ▰▰▱▱▱ 24% ↻ 3d16h │
245
- │ │ Opus ▰▰▰▱▱ 61% ↻ 5d │ Credits: 0 +3 reset │
246
- │ │ Balance: - $0.00 used │ updated just now │
247
- │ │ updated just now │ │
248
- └───────────────────────────┴────────────────────────────┴────────────────────────────┘
241
+ ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
242
+ │ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
243
+ │ 5h ▰▱▱▱▱ 16% ↻ 2h0m ││ 5h ▰▰▱▱▱ 37% ↻ 2h33m││ prem ▰▱▱▱▱ 2% ↻ 25d ││ total ▰▰▰▰▰ 94% ↻ 17d │
244
+ │ 7d ▰▰▱▱▱ 41% ↻ 5d ││ 7d ▰▰▱▱▱ 24% ↻ 3d16h││ 1464/1500 · chat/compl ∞││ auto ▰▰▰▰▰ 100% ↻ 17d │
245
+ │ Opus ▰▰▰▱▱ 61% ↻ 5d ││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 44% ↻ 17d │
246
+ │ Balance: - $0.00 used ││ updated just now ││ ││ updated just now │
247
+ └─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
249
248
  ```
250
249
 
251
250
  - **Claude** — 方案类型、5 小时、每周以及单模型每周用量,来自官方 OAuth 用量 API(`GET /api/oauth/usage`),从 `~/.claude/.credentials.json` 读取,并显示额度余额。约每分钟轮询一次以避开该端点的速率限制;触及上限时标题会出现红色 `LIMIT` 标记。单模型每周那一行属于尽力而为,未返回该范围时就自动隐藏。
252
251
  - **Codex** — 套餐类型、5 小时和每周用量以及额度余额,使用 `~/.codex/auth.json` 从 ChatGPT 后端(`wham/usage`)获取(在适用时显示大致剩余讯息数 / 消费上限);API 不可用时回退到 Codex 会话日志中最新的 `rate_limits`(标题显示 `Codex` 或 `Codex (session)`)。
252
+ - **Copilot** — 方案类型、premium 请求额度(剩余 / 配额,并附带进度条),以及无限制的 chat / completions,来自 GitHub 的 Copilot API(`GET /copilot_internal/user`),从 `~/.copilot/config.json` 读取。该请求会模拟 Copilot CLI。token 为长期有效,因此不需要刷新;遇到 `401` / `403` 时会显示 `run: copilot login` 提示。
253
+ - **Cursor** — 方案类型、total / auto / API 用量百分比,以及按需消费,来自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被动式的:vct 每次轮询都会重新读取该文件,并在 token 有效期内使用它,因为官方 Cursor 客户端会让它保持最新。
253
254
 
254
- **自动刷新 token。** 对这两个 provider,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式),因此 token 会在多次检查之间复用,而不是每次都重新刷新。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。
255
+ **自动刷新 token。** 对 Claude 和 Codex,当 token 接近过期或被拒绝时,vct 会刷新它并把新 token 写回该 provider 自己的凭证文件(采用该 CLI 的原始格式),因此 token 会在多次检查之间复用,而不是每次都重新刷新。如果刷新失败,面板会显示 `run: <provider> auth login` 提示,而不会直接中断。Copilot(长期有效的 token)和 Cursor(由其自身客户端保持最新)为只读——vct 从不写入它们的凭证文件。
255
256
 
256
- 只有在某个 provider 的凭证存在时,才会显示对应的面板。额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
257
+ 只有在某个 provider 的凭证存在时,才会显示对应的面板。当四个面板都显示时,Provider Usage 表格会从这一栏中折叠隐藏;在较窄的宽度下,面板会折行成 2×2 网格。额度面板仅在交互式 TUI 中显示;`--table`、`--text`、`--json` 不受影响。
257
258
 
258
- > **平台说明:** 在 macOS 上,Claude Code 会把 OAuth 凭证保存在系统 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不会显示 Claude 面板。
259
+ > **平台说明:** 在 macOS 上,Claude Code 会把 OAuth 凭证保存在系统 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不会显示 Claude 面板。Cursor 的 `~/.config/cursor` 凭证路径偏向 Linux。
259
260
 
260
261
  ---
261
262
 
package/README.zh-TW.md CHANGED
@@ -235,27 +235,28 @@ vct usage --json --daily
235
235
 
236
236
  ### 即時額度面板
237
237
 
238
- `vct usage` 會**在儀表板中直接顯示 Claude Code 與 Codex 的即時剩餘額度——完全零設定。** 不需要 status-line hook,也不需要設定檔:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。
238
+ `vct usage` 會**在儀表板中直接顯示 Claude Code、Codex、GitHub Copilot 與 Cursor 的即時剩餘額度——完全零設定。** 不需要 status-line hook,也不需要設定檔:vct 會讀取各 provider 自己的 OAuth 憑證,在背景執行緒呼叫其用量 API,並在你工作時讓面板保持最新。
239
239
 
240
240
  ```
241
- ┌ Provider/Tokens/Cost/Days ┬ Claude ───────────────────┬ Codex ────────────────────┐
242
- │ Claude 1.2M $3.00 4d │ Plan: max 20x │ Plan: plus │
243
- │ Codex 800K $0.00 6d │ 5h ▰▱▱▱▱ 16% ↻ 2h0m │ 5h ▰▰▱▱▱ 37% ↻ 2h33m │
244
- │ ... │ 7d ▰▰▱▱▱ 41% ↻ 5d │ 7d ▰▰▱▱▱ 24% ↻ 3d16h │
245
- │ │ Opus ▰▰▰▱▱ 61% ↻ 5d │ Credits: 0 +3 reset │
246
- │ │ Balance: - $0.00 used │ updated just now │
247
- │ │ updated just now │ │
248
- └───────────────────────────┴────────────────────────────┴────────────────────────────┘
241
+ ┌ Claude ─────────────────┐┌ Codex ──────────────────┐┌ Copilot ────────────────┐┌ Cursor ─────────────────┐
242
+ │ Plan: max 20x ││ Plan: plus ││ Plan: individual ││ Plan: free │
243
+ │ 5h ▰▱▱▱▱ 16% ↻ 2h0m ││ 5h ▰▰▱▱▱ 37% ↻ 2h33m││ prem ▰▱▱▱▱ 2% ↻ 25d ││ total ▰▰▰▰▰ 94% ↻ 17d │
244
+ │ 7d ▰▰▱▱▱ 41% ↻ 5d ││ 7d ▰▰▱▱▱ 24% ↻ 3d16h││ 1464/1500 · chat/compl ∞││ auto ▰▰▰▰▰ 100% ↻ 17d │
245
+ │ Opus ▰▰▰▱▱ 61% ↻ 5d ││ Credits: 0 +3 reset ││ updated just now ││ api ▰▰▰▱▱ 44% ↻ 17d │
246
+ │ Balance: - $0.00 used ││ updated just now ││ ││ updated just now │
247
+ └─────────────────────────┘└─────────────────────────┘└─────────────────────────┘└─────────────────────────┘
249
248
  ```
250
249
 
251
250
  - **Claude** — 方案類型、5 小時、每週以及單模型每週用量,來自官方 OAuth 用量 API(`GET /api/oauth/usage`),從 `~/.claude/.credentials.json` 讀取,並顯示額度餘額。約每分鐘輪詢一次以避開該端點的速率限制;觸及上限時標題會出現紅色 `LIMIT` 標記。單模型每週那一行屬於盡力而為,未回傳該範圍時就自動隱藏。
252
251
  - **Codex** — 方案類型、5 小時和每週用量以及額度餘額,使用 `~/.codex/auth.json` 從 ChatGPT 後端(`wham/usage`)取得(在適用時顯示大致剩餘訊息數 / 消費上限);API 無法使用時回退到 Codex 工作階段紀錄中最新的 `rate_limits`(標題顯示 `Codex` 或 `Codex (session)`)。
252
+ - **Copilot** — 方案類型、premium 請求額度(剩餘 / 配額,並附上進度條),以及無限制的 chat / completions,來自 GitHub 的 Copilot API(`GET /copilot_internal/user`),從 `~/.copilot/config.json` 讀取。該請求會模擬 Copilot CLI。token 為長期有效,因此不需要刷新;遇到 `401` / `403` 時會顯示 `run: copilot login` 提示。
253
+ - **Cursor** — 方案類型、total / auto / API 用量百分比,以及按需消費,來自 cursor.com(`GET /api/usage-summary`),使用 `~/.config/cursor/auth.json` 中的 session token。刷新是被動式的:vct 每次輪詢都會重新讀取該檔案,並在 token 有效期內使用它,因為官方 Cursor 用戶端會讓它保持最新。
253
254
 
254
- **自動刷新 token。** 對這兩個 provider,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式),因此 token 會在多次檢查之間重複使用,而不是每次都重新刷新。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。
255
+ **自動刷新 token。** 對 Claude 和 Codex,當 token 接近過期或被拒絕時,vct 會刷新它並把新的 token 寫回該 provider 自己的憑證檔案(採用該 CLI 的原始格式),因此 token 會在多次檢查之間重複使用,而不是每次都重新刷新。如果刷新失敗,面板會顯示 `run: <provider> auth login` 提示,而不會直接中斷。Copilot(長期有效的 token)和 Cursor(由其自身用戶端保持最新)為唯讀——vct 從不寫入它們的憑證檔案。
255
256
 
256
- 只有在某個 provider 的憑證存在時,才會顯示對應的面板。額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
257
+ 只有在某個 provider 的憑證存在時,才會顯示對應的面板。當四個面板都顯示時,Provider Usage 表格會從這一列中折疊隱藏;在較窄的寬度下,面板會折行成 2×2 網格。額度面板僅在互動式 TUI 中顯示;`--table`、`--text`、`--json` 不受影響。
257
258
 
258
- > **平台說明:** 在 macOS 上,Claude Code 會把 OAuth 憑證儲存在系統 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不會顯示 Claude 面板。
259
+ > **平台說明:** 在 macOS 上,Claude Code 會把 OAuth 憑證儲存在系統 Keychain 中,而不是 `~/.claude/.credentials.json`,因此在 macOS 上不會顯示 Claude 面板。Cursor 的 `~/.config/cursor` 憑證路徑偏向 Linux。
259
260
 
260
261
  ---
261
262
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/vibe-coding-tracker",
3
- "version": "1.1.0",
3
+ "version": "1.3.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",