@mai0313/vibe-coding-tracker 0.5.9 → 0.5.12

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.
@@ -0,0 +1,327 @@
1
+ <div align="center" markdown="1">
2
+
3
+ # Vibe Coding Tracker — AI 编程助手使用量追踪器
4
+
5
+ [![Crates.io](https://img.shields.io/crates/v/vibe_coding_tracker?logo=rust&style=flat-square&color=E05D44)](https://crates.io/crates/vibe_coding_tracker)
6
+ [![Crates.io Downloads](https://img.shields.io/crates/d/vibe_coding_tracker?logo=rust&style=flat-square)](https://crates.io/crates/vibe_coding_tracker)
7
+ [![npm version](https://img.shields.io/npm/v/vibe-coding-tracker?logo=npm&style=flat-square&color=CB3837)](https://www.npmjs.com/package/vibe-coding-tracker)
8
+ [![npm downloads](https://img.shields.io/npm/dt/vibe-coding-tracker?logo=npm&style=flat-square)](https://www.npmjs.com/package/vibe-coding-tracker)
9
+ [![PyPI version](https://img.shields.io/pypi/v/vibe_coding_tracker?logo=python&style=flat-square&color=3776AB)](https://pypi.org/project/vibe_coding_tracker/)
10
+ [![PyPI downloads](https://img.shields.io/pypi/dm/vibe_coding_tracker?logo=python&style=flat-square)](https://pypi.org/project/vibe-coding-tracker)
11
+ [![rust](https://img.shields.io/badge/Rust-stable-orange?logo=rust&logoColor=white&style=flat-square)](https://www.rust-lang.org/)
12
+ [![tests](https://img.shields.io/github/actions/workflow/status/Mai0313/VibeCodingTracker/test.yml?label=tests&logo=github&style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/actions/workflows/test.yml)
13
+ [![code-quality](https://img.shields.io/github/actions/workflow/status/Mai0313/VibeCodingTracker/code-quality-check.yml?label=code-quality&logo=github&style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/actions/workflows/code-quality-check.yml)
14
+ [![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray&style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/tree/master?tab=License-1-ov-file)
15
+ [![Star on GitHub](https://img.shields.io/github/stars/Mai0313/VibeCodingTracker?style=social&label=Star)](https://github.com/Mai0313/VibeCodingTracker)
16
+ [![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/pulls)
17
+
18
+ </div>
19
+
20
+ **实时追踪你的 AI 编程开销。** Vibe Coding Tracker 是一款基于 Rust 构建的轻量级高性能 CLI 工具,用于监控和分析你在 Claude Code、Codex、Copilot 和 Gemini 上的使用情况——提供详细的费用明细、token 统计和代码操作洞察,同时保持极低的 CPU 和内存占用。
21
+
22
+ [English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
23
+
24
+ > 注意:CLI 示例中使用简写别名 `vct`。如果你是通过 npm/pip/cargo 安装的,二进制文件可能命名为 `vibe_coding_tracker` 或 `vct`。如有需要,请创建别名或在运行命令时将 `vct` 替换为完整名称。
25
+
26
+ ---
27
+
28
+ ## 🎯 为什么选择 Vibe Coding Tracker?
29
+
30
+ ### 💰 掌握你的开销
31
+
32
+ 不用再猜测 AI 编程会话到底花了多少钱。通过 [LiteLLM](https://github.com/BerriAI/litellm) 自动更新定价,获取**实时费用追踪**。
33
+
34
+ ### 🪶 超轻量级
35
+
36
+ 使用 Rust 构建,资源占用极低。交互式 TUI 面板运行时仅需约 **3-5% CPU** 和约 **140 MB 内存**,即使处理来自多个供应商的数百万 token 也是如此——无需 Electron,无需臃肿的运行时。
37
+
38
+ ### 📊 精美的可视化
39
+
40
+ 选择你喜欢的查看方式:
41
+
42
+ - **交互式面板**:自动刷新的终端 UI,支持实时更新
43
+ - **静态报表**:专业的表格,适合文档记录
44
+ - **脚本友好**:纯文本和 JSON 格式,方便自动化
45
+ - **完整精度**:导出精确费用,满足财务核算需求
46
+
47
+ ### 🚀 零配置
48
+
49
+ 自动检测并处理来自 Claude Code、Codex、Copilot 和 Gemini 的日志。无需任何设置——直接运行即可分析。
50
+
51
+ ### 🎨 丰富的洞察
52
+
53
+ - 按模型和日期统计 token 使用量
54
+ - 按 cache 类型(读取/创建)细分费用
55
+ - 文件操作追踪(编辑、读取、写入行数)
56
+ - 工具调用历史(Bash、Edit、Read、Write、TodoWrite)
57
+ - 按供应商统计每日平均值
58
+
59
+ ---
60
+
61
+ ## ✨ 核心特性
62
+
63
+ | 特性 | 说明 |
64
+ | ------------------- | ----------------------------------------------------- |
65
+ | 🤖 **多供应商支持** | Claude Code、Codex、Copilot 和 Gemini——一站式管理 |
66
+ | 💵 **智能定价** | 模糊模型匹配 + 从 LiteLLM 每日缓存更新 |
67
+ | 🎨 **4 种显示模式** | 交互式 TUI、静态表格、纯文本和 JSON |
68
+ | 📈 **双维度分析** | token/费用统计(`usage`)+ 代码操作统计(`analysis`) |
69
+ | 🪶 **超轻量级** | 约 3-5% CPU、约 140 MB RAM——基于 Rust 构建 |
70
+ | 🔄 **实时更新** | 面板每秒自动刷新 |
71
+ | 💾 **高效缓存** | 智能每日缓存,减少 API 调用次数 |
72
+
73
+ ---
74
+
75
+ ## 🚀 快速开始
76
+
77
+ ### 安装
78
+
79
+ 选择最适合你的安装方式:
80
+
81
+ > 👨‍💻 **开发者**:如果你想从源码构建或参与项目开发,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
82
+
83
+ #### 方式一:通过 npm 安装
84
+
85
+ **前置条件**:[Node.js](https://nodejs.org/) v22 或更高版本
86
+
87
+ 以下包名任选其一(内容完全相同):
88
+
89
+ ```bash
90
+ # Main package
91
+ npm install -g vibe-coding-tracker
92
+
93
+ # Short alias with scope
94
+ npm install -g @mai0313/vct
95
+
96
+ # Full name with scope
97
+ npm install -g @mai0313/vibe-coding-tracker
98
+ ```
99
+
100
+ #### 方式二:通过 PyPI 安装
101
+
102
+ **前置条件**:Python 3.8 或更高版本
103
+
104
+ ```bash
105
+ pip install vibe_coding_tracker
106
+ # Or with uv
107
+ uv pip install vibe_coding_tracker
108
+ ```
109
+
110
+ #### 方式三:通过 crates.io 安装
111
+
112
+ 使用 Cargo 从 Rust 官方包注册中心安装:
113
+
114
+ ```bash
115
+ cargo install vibe_coding_tracker
116
+ ```
117
+
118
+ ### 首次运行
119
+
120
+ ```bash
121
+ # View your usage with the interactive dashboard
122
+ vct usage
123
+
124
+ # Or run the binary built by Cargo/pip
125
+ vibe_coding_tracker usage
126
+
127
+ # Analyze code operations across all sessions
128
+ vct analysis
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 📖 命令指南
134
+
135
+ ### 🔍 快速参考
136
+
137
+ ```
138
+ vct <COMMAND> [OPTIONS]
139
+ # Replace with `vibe_coding_tracker` if you are using the full binary name
140
+
141
+ Commands:
142
+ analysis Analyze JSONL conversation files (single file or all sessions)
143
+ usage Display token usage statistics
144
+ version Display version information
145
+ update Update to the latest version from GitHub releases
146
+ help Print this message or the help of the given subcommand(s)
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 💰 Usage 命令
152
+
153
+ **追踪你在所有 AI 编程会话中的开销。**
154
+
155
+ ### 基本用法
156
+
157
+ ```bash
158
+ # Interactive dashboard (recommended)
159
+ vct usage
160
+
161
+ # Static table for reports
162
+ vct usage --table
163
+
164
+ # Plain text for scripts
165
+ vct usage --text
166
+
167
+ # JSON for data processing
168
+ vct usage --json
169
+ ```
170
+
171
+ ### 预览:交互式面板(`vct usage`)
172
+
173
+ ```
174
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
175
+ │ 📊 Token Usage Statistics │
176
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
177
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
178
+ │ Model Input Output Cache Read Cache Create Total Cost │
179
+ │ │
180
+ │ claude-haiku-4-5-20251001 5,567 19,769 4,627,938 619,816 $1.34 │
181
+ │ claude-opus-4-6 25,651 179,066 40,830,154 2,572,258 $77.59 │
182
+ │ gemini-3.1-pro-preview 129,115 10,339 67,385 0 $0.40 │
183
+ │ TOTAL 160,333 209,174 45,525,477 3,192,074 $79.33 │
184
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
185
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
186
+ │ Provider Tokens / Day Cost / Day Active Days │
187
+ │ │
188
+ │ 🤖 Claude Code 16,293,406 $26.31 3 │
189
+ │ ✨ Gemini 206,839 $0.40 1 │
190
+ │ ⭐ All Providers 16,362,353 $26.44 3 │
191
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
192
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
193
+ │ 💰 Total: $79.33 | 🔢 Tokens: 49,087,058 | 📊 Models: 3 | ⚡ CPU: 4.6% | 🧠 Mem: 148 MB │
194
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
195
+ Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
196
+ ```
197
+
198
+ ### 扫描范围
199
+
200
+ 该工具会自动扫描以下目录:
201
+
202
+ - `~/.claude/projects/*.jsonl`(Claude Code)
203
+ - `~/.codex/sessions/*.jsonl`(Codex)
204
+ - `~/.copilot/history-session-state/*.json`(Copilot)
205
+ - `~/.gemini/tmp/<project_hash>/chats/*.json`(Gemini)
206
+
207
+ ---
208
+
209
+ ## 📊 Analysis 命令
210
+
211
+ **深入了解代码操作——查看你的 AI 助手到底做了什么。**
212
+
213
+ ### 基本用法
214
+
215
+ ```bash
216
+ # Interactive dashboard for all sessions (default)
217
+ vct analysis
218
+
219
+ # Static table output with daily averages
220
+ vct analysis --table
221
+
222
+ # Analyze a single conversation file
223
+ vct analysis --path ~/.claude/projects/session.jsonl
224
+
225
+ # Save results to JSON
226
+ vct analysis --output report.json
227
+
228
+ # Group results by provider
229
+ vct analysis --all
230
+
231
+ # Save grouped results
232
+ vct analysis --all --output grouped_report.json
233
+ ```
234
+
235
+ ### 预览:交互式面板(`vct analysis`)
236
+
237
+ ```
238
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
239
+ │ 🔍 Analysis Statistics │
240
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
241
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
242
+ │ Model Edit Lines Read Lines Write Lines Bash Edit Read Write │
243
+ │ │
244
+ │ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 │
245
+ │ claude-opus-4-6 1,280 13,264 1,575 82 146 209 62 │
246
+ │ gemini-3.1-pro-preview 0 0 0 0 0 0 0 │
247
+ │ TOTAL 1,280 13,264 1,575 125 146 268 62 │
248
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
249
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
250
+ │ Provider EditL/Day ReadL/Day WriteL/Day Bash/Day Edit/Day Read/Day Write/Day Days │
251
+ │ │
252
+ │ 🤖 Claude Code 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
253
+ │ ✨ Gemini 0 0 0 0.0 0.0 0.0 0.0 1 │
254
+ │ ⭐ All Providers 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
255
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
256
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
257
+ │ 📝 Lines: 16,119 | 🔧 Tools: 601 | 📊 Models: 3 | ⚡ CPU: 3.6% | 🧠 Mem: 140 MB │
258
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
259
+ Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
260
+ ```
261
+
262
+ ---
263
+
264
+ ## 🔄 Update 命令
265
+
266
+ **自动保持安装版本为最新。**
267
+
268
+ update 命令适用于**所有安装方式**(npm/pip/cargo/手动安装),它会直接从 GitHub releases 下载并替换二进制文件。
269
+
270
+ ### 基本用法
271
+
272
+ ```bash
273
+ # Check for updates
274
+ vct update --check
275
+
276
+ # Interactive update with confirmation
277
+ vct update
278
+
279
+ # Force update — always downloads latest version
280
+ vct update --force
281
+ ```
282
+
283
+ ### 预览(`vct update --check`)
284
+
285
+ ```
286
+ 📋 Current version: v0.5.10
287
+ 🔍 Checking for latest release...
288
+ ✅ Latest version: v0.5.10 — you are up to date!
289
+ ```
290
+
291
+ ---
292
+
293
+ ## 💡 智能定价系统
294
+
295
+ ### 工作原理
296
+
297
+ 1. **自动更新**:每天从 [LiteLLM](https://github.com/BerriAI/litellm) 获取最新定价
298
+ 2. **智能缓存**:将定价信息存储在 `~/.vibe_coding_tracker/` 目录中,有效期 24 小时
299
+ 3. **模糊匹配**:即使是自定义模型名称也能找到最佳匹配
300
+ 4. **始终精确**:确保你获取到最新的定价信息
301
+
302
+ ### 模型匹配
303
+
304
+ **优先级顺序**:
305
+
306
+ 1. ✅ **精确匹配**:`claude-sonnet-4` → `claude-sonnet-4`
307
+ 2. 🔄 **标准化匹配**:`claude-sonnet-4-20250514` → `claude-sonnet-4`
308
+ 3. 🔍 **子串匹配**:`custom-gpt-4` → `gpt-4`
309
+ 4. 🎯 **模糊匹配(AI 驱动)**:使用 Jaro-Winkler 相似度算法(70% 阈值)
310
+ 5. 💵 **兜底方案**:如果未找到匹配,显示 $0.00
311
+
312
+ ---
313
+
314
+ ## 🐳 Docker 支持
315
+
316
+ ```bash
317
+ # Build image
318
+ docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
319
+
320
+ # Run with your sessions
321
+ docker run --rm \
322
+ -v ~/.claude:/root/.claude \
323
+ -v ~/.codex:/root/.codex \
324
+ -v ~/.copilot:/root/.copilot \
325
+ -v ~/.gemini:/root/.gemini \
326
+ vibe_coding_tracker:latest usage
327
+ ```
@@ -0,0 +1,327 @@
1
+ <div align="center" markdown="1">
2
+
3
+ # Vibe Coding Tracker — AI 程式設計助手使用量追蹤器
4
+
5
+ [![Crates.io](https://img.shields.io/crates/v/vibe_coding_tracker?logo=rust&style=flat-square&color=E05D44)](https://crates.io/crates/vibe_coding_tracker)
6
+ [![Crates.io Downloads](https://img.shields.io/crates/d/vibe_coding_tracker?logo=rust&style=flat-square)](https://crates.io/crates/vibe_coding_tracker)
7
+ [![npm version](https://img.shields.io/npm/v/vibe-coding-tracker?logo=npm&style=flat-square&color=CB3837)](https://www.npmjs.com/package/vibe-coding-tracker)
8
+ [![npm downloads](https://img.shields.io/npm/dt/vibe-coding-tracker?logo=npm&style=flat-square)](https://www.npmjs.com/package/vibe-coding-tracker)
9
+ [![PyPI version](https://img.shields.io/pypi/v/vibe_coding_tracker?logo=python&style=flat-square&color=3776AB)](https://pypi.org/project/vibe_coding_tracker/)
10
+ [![PyPI downloads](https://img.shields.io/pypi/dm/vibe_coding_tracker?logo=python&style=flat-square)](https://pypi.org/project/vibe-coding-tracker)
11
+ [![rust](https://img.shields.io/badge/Rust-stable-orange?logo=rust&logoColor=white&style=flat-square)](https://www.rust-lang.org/)
12
+ [![tests](https://img.shields.io/github/actions/workflow/status/Mai0313/VibeCodingTracker/test.yml?label=tests&logo=github&style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/actions/workflows/test.yml)
13
+ [![code-quality](https://img.shields.io/github/actions/workflow/status/Mai0313/VibeCodingTracker/code-quality-check.yml?label=code-quality&logo=github&style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/actions/workflows/code-quality-check.yml)
14
+ [![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray&style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/tree/master?tab=License-1-ov-file)
15
+ [![Star on GitHub](https://img.shields.io/github/stars/Mai0313/VibeCodingTracker?style=social&label=Star)](https://github.com/Mai0313/VibeCodingTracker)
16
+ [![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/pulls)
17
+
18
+ </div>
19
+
20
+ **即時追蹤你的 AI 程式設計花費。** Vibe Coding Tracker 是一款以 Rust 打造的輕量、高效能 CLI 工具,能監控與分析你在 Claude Code、Codex、Copilot 及 Gemini 的使用狀況——提供詳細的費用明細、token 統計資料與程式碼操作分析,同時維持極低的 CPU 與記憶體使用量。
21
+
22
+ [English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
23
+
24
+ > 注意:CLI 範例使用簡短別名 `vct`。如果你是透過 npm/pip/cargo 安裝,執行檔可能命名為 `vibe_coding_tracker` 或 `vct`。如有需要,請建立別名或在執行指令時將 `vct` 替換為完整名稱。
25
+
26
+ ---
27
+
28
+ ## 🎯 為什麼選擇 Vibe Coding Tracker?
29
+
30
+ ### 💰 掌握你的花費
31
+
32
+ 不用再猜測 AI 程式設計工作階段花了多少錢。透過 [LiteLLM](https://github.com/BerriAI/litellm) 自動更新價格,取得**即時費用追蹤**。
33
+
34
+ ### 🪶 超輕量
35
+
36
+ 以 Rust 打造,資源佔用極低。互動式 TUI 儀表板僅需 **~3-5% CPU** 與 **~140 MB 記憶體**,即使處理來自多個供應商的數百萬 token 也不例外——不用 Electron,不用臃腫的執行環境。
37
+
38
+ ### 📊 精美視覺化
39
+
40
+ 選擇你偏好的檢視方式:
41
+
42
+ - **互動式儀表板**:自動更新的終端機 UI,即時顯示最新資訊
43
+ - **靜態報表**:專業的表格格式,適合撰寫文件
44
+ - **腳本友好**:純文字及 JSON 輸出,方便自動化處理
45
+ - **完整精度**:匯出精確費用供會計使用
46
+
47
+ ### 🚀 零設定
48
+
49
+ 自動偵測並處理 Claude Code、Codex、Copilot 及 Gemini 的日誌檔。不需要任何設定——直接執行就能分析。
50
+
51
+ ### 🎨 豐富洞察
52
+
53
+ - 依模型與日期分類的 token 使用量
54
+ - 依 cache 類型(讀取 / 建立)的費用明細
55
+ - 檔案操作追蹤(編輯、讀取、寫入行數)
56
+ - 工具呼叫歷史(Bash、Edit、Read、Write、TodoWrite)
57
+ - 每個供應商的每日平均值
58
+
59
+ ---
60
+
61
+ ## ✨ 主要功能
62
+
63
+ | 功能 | 說明 |
64
+ | ------------------- | --------------------------------------------------------- |
65
+ | 🤖 **多供應商支援** | Claude Code、Codex、Copilot 及 Gemini——一站整合 |
66
+ | 💵 **智慧定價** | 模糊模型比對 + 每日從 LiteLLM cache 更新 |
67
+ | 🎨 **4 種顯示模式** | 互動式 TUI、靜態表格、純文字及 JSON |
68
+ | 📈 **雙重分析** | Token / 費用統計(`usage`)+ 程式碼操作統計(`analysis`) |
69
+ | 🪶 **超輕量** | ~3-5% CPU、~140 MB RAM——以 Rust 打造 |
70
+ | 🔄 **即時更新** | 即時儀表板每秒自動刷新 |
71
+ | 💾 **高效快取** | 智慧每日 cache 減少 API 呼叫次數 |
72
+
73
+ ---
74
+
75
+ ## 🚀 快速開始
76
+
77
+ ### 安裝
78
+
79
+ 選擇最適合你的安裝方式:
80
+
81
+ > 👨‍💻 **開發者**:如果你想從原始碼建置或參與開發,請參閱 [CONTRIBUTING.md](CONTRIBUTING.md)。
82
+
83
+ #### 方法一:透過 npm 安裝
84
+
85
+ **前置條件**:[Node.js](https://nodejs.org/) v22 或更高版本
86
+
87
+ 選擇以下任一套件名稱(內容完全相同):
88
+
89
+ ```bash
90
+ # Main package
91
+ npm install -g vibe-coding-tracker
92
+
93
+ # Short alias with scope
94
+ npm install -g @mai0313/vct
95
+
96
+ # Full name with scope
97
+ npm install -g @mai0313/vibe-coding-tracker
98
+ ```
99
+
100
+ #### 方法二:透過 PyPI 安裝
101
+
102
+ **前置條件**:Python 3.8 或更高版本
103
+
104
+ ```bash
105
+ pip install vibe_coding_tracker
106
+ # Or with uv
107
+ uv pip install vibe_coding_tracker
108
+ ```
109
+
110
+ #### 方法三:透過 crates.io 安裝
111
+
112
+ 使用 Cargo 從官方 Rust 套件倉庫安裝:
113
+
114
+ ```bash
115
+ cargo install vibe_coding_tracker
116
+ ```
117
+
118
+ ### 首次執行
119
+
120
+ ```bash
121
+ # View your usage with the interactive dashboard
122
+ vct usage
123
+
124
+ # Or run the binary built by Cargo/pip
125
+ vibe_coding_tracker usage
126
+
127
+ # Analyze code operations across all sessions
128
+ vct analysis
129
+ ```
130
+
131
+ ---
132
+
133
+ ## 📖 指令指南
134
+
135
+ ### 🔍 快速參考
136
+
137
+ ```
138
+ vct <COMMAND> [OPTIONS]
139
+ # Replace with `vibe_coding_tracker` if you are using the full binary name
140
+
141
+ Commands:
142
+ analysis Analyze JSONL conversation files (single file or all sessions)
143
+ usage Display token usage statistics
144
+ version Display version information
145
+ update Update to the latest version from GitHub releases
146
+ help Print this message or the help of the given subcommand(s)
147
+ ```
148
+
149
+ ---
150
+
151
+ ## 💰 Usage 指令
152
+
153
+ **追蹤你在所有 AI 程式設計工作階段的花費。**
154
+
155
+ ### 基本用法
156
+
157
+ ```bash
158
+ # Interactive dashboard (recommended)
159
+ vct usage
160
+
161
+ # Static table for reports
162
+ vct usage --table
163
+
164
+ # Plain text for scripts
165
+ vct usage --text
166
+
167
+ # JSON for data processing
168
+ vct usage --json
169
+ ```
170
+
171
+ ### 預覽:互動式儀表板(`vct usage`)
172
+
173
+ ```
174
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
175
+ │ 📊 Token Usage Statistics │
176
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
177
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
178
+ │ Model Input Output Cache Read Cache Create Total Cost │
179
+ │ │
180
+ │ claude-haiku-4-5-20251001 5,567 19,769 4,627,938 619,816 $1.34 │
181
+ │ claude-opus-4-6 25,651 179,066 40,830,154 2,572,258 $77.59 │
182
+ │ gemini-3.1-pro-preview 129,115 10,339 67,385 0 $0.40 │
183
+ │ TOTAL 160,333 209,174 45,525,477 3,192,074 $79.33 │
184
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
185
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
186
+ │ Provider Tokens / Day Cost / Day Active Days │
187
+ │ │
188
+ │ 🤖 Claude Code 16,293,406 $26.31 3 │
189
+ │ ✨ Gemini 206,839 $0.40 1 │
190
+ │ ⭐ All Providers 16,362,353 $26.44 3 │
191
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
192
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
193
+ │ 💰 Total: $79.33 | 🔢 Tokens: 49,087,058 | 📊 Models: 3 | ⚡ CPU: 4.6% | 🧠 Mem: 148 MB │
194
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
195
+ Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
196
+ ```
197
+
198
+ ### 掃描範圍
199
+
200
+ 此工具會自動掃描以下目錄:
201
+
202
+ - `~/.claude/projects/*.jsonl`(Claude Code)
203
+ - `~/.codex/sessions/*.jsonl`(Codex)
204
+ - `~/.copilot/history-session-state/*.json`(Copilot)
205
+ - `~/.gemini/tmp/<project_hash>/chats/*.json`(Gemini)
206
+
207
+ ---
208
+
209
+ ## 📊 Analysis 指令
210
+
211
+ **深入分析程式碼操作——精確掌握你的 AI 助手做了哪些事。**
212
+
213
+ ### 基本用法
214
+
215
+ ```bash
216
+ # Interactive dashboard for all sessions (default)
217
+ vct analysis
218
+
219
+ # Static table output with daily averages
220
+ vct analysis --table
221
+
222
+ # Analyze a single conversation file
223
+ vct analysis --path ~/.claude/projects/session.jsonl
224
+
225
+ # Save results to JSON
226
+ vct analysis --output report.json
227
+
228
+ # Group results by provider
229
+ vct analysis --all
230
+
231
+ # Save grouped results
232
+ vct analysis --all --output grouped_report.json
233
+ ```
234
+
235
+ ### 預覽:互動式儀表板(`vct analysis`)
236
+
237
+ ```
238
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
239
+ │ 🔍 Analysis Statistics │
240
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
241
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
242
+ │ Model Edit Lines Read Lines Write Lines Bash Edit Read Write │
243
+ │ │
244
+ │ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 │
245
+ │ claude-opus-4-6 1,280 13,264 1,575 82 146 209 62 │
246
+ │ gemini-3.1-pro-preview 0 0 0 0 0 0 0 │
247
+ │ TOTAL 1,280 13,264 1,575 125 146 268 62 │
248
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
249
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
250
+ │ Provider EditL/Day ReadL/Day WriteL/Day Bash/Day Edit/Day Read/Day Write/Day Days │
251
+ │ │
252
+ │ 🤖 Claude Code 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
253
+ │ ✨ Gemini 0 0 0 0.0 0.0 0.0 0.0 1 │
254
+ │ ⭐ All Providers 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
255
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
256
+ ┌─────────────────────────────────────────────────────────────────────────────────────────────┐
257
+ │ 📝 Lines: 16,119 | 🔧 Tools: 601 | 📊 Models: 3 | ⚡ CPU: 3.6% | 🧠 Mem: 140 MB │
258
+ └─────────────────────────────────────────────────────────────────────────────────────────────┘
259
+ Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
260
+ ```
261
+
262
+ ---
263
+
264
+ ## 🔄 Update 指令
265
+
266
+ **自動保持安裝為最新版本。**
267
+
268
+ Update 指令適用於**所有安裝方式**(npm/pip/cargo/手動安裝),透過直接從 GitHub releases 下載並替換執行檔來完成更新。
269
+
270
+ ### 基本用法
271
+
272
+ ```bash
273
+ # Check for updates
274
+ vct update --check
275
+
276
+ # Interactive update with confirmation
277
+ vct update
278
+
279
+ # Force update — always downloads latest version
280
+ vct update --force
281
+ ```
282
+
283
+ ### 預覽(`vct update --check`)
284
+
285
+ ```
286
+ 📋 Current version: v0.5.10
287
+ 🔍 Checking for latest release...
288
+ ✅ Latest version: v0.5.10 — you are up to date!
289
+ ```
290
+
291
+ ---
292
+
293
+ ## 💡 智慧定價系統
294
+
295
+ ### 運作方式
296
+
297
+ 1. **自動更新**:每日從 [LiteLLM](https://github.com/BerriAI/litellm) 取得最新價格
298
+ 2. **智慧快取**:將價格資料儲存於 `~/.vibe_coding_tracker/`,有效期 24 小時
299
+ 3. **模糊比對**:即使是自訂模型名稱也能找到最佳配對
300
+ 4. **始終精準**:確保你取得最新的定價資訊
301
+
302
+ ### 模型比對
303
+
304
+ **優先順序**:
305
+
306
+ 1. ✅ **完全比對**:`claude-sonnet-4` → `claude-sonnet-4`
307
+ 2. 🔄 **正規化比對**:`claude-sonnet-4-20250514` → `claude-sonnet-4`
308
+ 3. 🔍 **子字串比對**:`custom-gpt-4` → `gpt-4`
309
+ 4. 🎯 **模糊比對(AI 驅動)**:使用 Jaro-Winkler 相似度(70% 門檻值)
310
+ 5. 💵 **備援方案**:若無法配對則顯示 $0.00
311
+
312
+ ---
313
+
314
+ ## 🐳 Docker 支援
315
+
316
+ ```bash
317
+ # Build image
318
+ docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
319
+
320
+ # Run with your sessions
321
+ docker run --rm \
322
+ -v ~/.claude:/root/.claude \
323
+ -v ~/.codex:/root/.codex \
324
+ -v ~/.copilot:/root/.copilot \
325
+ -v ~/.gemini:/root/.gemini \
326
+ vibe_coding_tracker:latest usage
327
+ ```