@mai0313/vibe-coding-tracker 0.5.11 → 0.5.13
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 +164 -42
- package/README.zh-CN.md +210 -88
- package/README.zh-TW.md +219 -97
- 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
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
**Track your AI coding costs in real-time.** Vibe Coding Tracker is a
|
|
20
|
+
**Track your AI coding costs in real-time.** Vibe Coding Tracker is a lightweight, high-performance CLI tool built in Rust that monitors and analyzes your Claude Code, Codex, Copilot, and Gemini usage — with detailed cost breakdowns, token statistics, and code operation insights, all while keeping CPU and memory usage minimal.
|
|
21
21
|
|
|
22
22
|
[English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
|
|
23
23
|
|
|
@@ -31,6 +31,10 @@
|
|
|
31
31
|
|
|
32
32
|
Stop wondering how much your AI coding sessions cost. Get **real-time cost tracking** with automatic pricing updates from [LiteLLM](https://github.com/BerriAI/litellm).
|
|
33
33
|
|
|
34
|
+
### 🪶 Ultra-Lightweight
|
|
35
|
+
|
|
36
|
+
Built with Rust for minimal resource footprint. The interactive TUI dashboard runs at **~3-5% CPU** and **~140 MB memory** even while processing millions of tokens across multiple providers — no Electron, no bloated runtimes.
|
|
37
|
+
|
|
34
38
|
### 📊 Beautiful Visualizations
|
|
35
39
|
|
|
36
40
|
Choose your preferred view:
|
|
@@ -42,29 +46,29 @@ Choose your preferred view:
|
|
|
42
46
|
|
|
43
47
|
### 🚀 Zero Configuration
|
|
44
48
|
|
|
45
|
-
Automatically detects and processes logs from Claude Code, Codex, Copilot, and Gemini. No setup required—just run and analyze.
|
|
49
|
+
Automatically detects and processes logs from Claude Code, Codex, Copilot, and Gemini. No setup required — just run and analyze.
|
|
46
50
|
|
|
47
51
|
### 🎨 Rich Insights
|
|
48
52
|
|
|
49
53
|
- Token usage by model and date
|
|
50
|
-
- Cost breakdown by cache types
|
|
51
|
-
- File operations tracking
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
+
- Cost breakdown by cache types (read / create)
|
|
55
|
+
- File operations tracking (edit, read, write lines)
|
|
56
|
+
- Tool call history (Bash, Edit, Read, Write, TodoWrite)
|
|
57
|
+
- Per-provider daily averages
|
|
54
58
|
|
|
55
59
|
---
|
|
56
60
|
|
|
57
61
|
## ✨ Key Features
|
|
58
62
|
|
|
59
|
-
| Feature
|
|
60
|
-
|
|
|
61
|
-
| 🤖 **
|
|
62
|
-
| 💵 **Smart Pricing**
|
|
63
|
-
| 🎨 **4 Display Modes**
|
|
64
|
-
| 📈 **
|
|
65
|
-
|
|
|
66
|
-
| 🔄 **Live Updates**
|
|
67
|
-
| 💾 **Efficient Caching**
|
|
63
|
+
| Feature | Description |
|
|
64
|
+
| ------------------------ | -------------------------------------------------------------- |
|
|
65
|
+
| 🤖 **Multi-Provider** | Claude Code, Codex, Copilot, and Gemini — all in one place |
|
|
66
|
+
| 💵 **Smart Pricing** | Fuzzy model matching + daily cache from LiteLLM |
|
|
67
|
+
| 🎨 **4 Display Modes** | Interactive TUI, static table, plain text, and JSON |
|
|
68
|
+
| 📈 **Dual Analysis** | Token/cost stats (`usage`) + code operation stats (`analysis`) |
|
|
69
|
+
| 🪶 **Ultra-Lightweight** | ~3-5% CPU, ~140 MB RAM — built with Rust |
|
|
70
|
+
| 🔄 **Live Updates** | Real-time dashboard refreshes every second |
|
|
71
|
+
| 💾 **Efficient Caching** | Smart daily cache reduces API calls |
|
|
68
72
|
|
|
69
73
|
---
|
|
70
74
|
|
|
@@ -114,14 +118,14 @@ cargo install vibe_coding_tracker
|
|
|
114
118
|
### First Run
|
|
115
119
|
|
|
116
120
|
```bash
|
|
117
|
-
# View your usage with the
|
|
121
|
+
# View your usage with the interactive dashboard
|
|
118
122
|
vct usage
|
|
119
123
|
|
|
120
124
|
# Or run the binary built by Cargo/pip
|
|
121
125
|
vibe_coding_tracker usage
|
|
122
126
|
|
|
123
|
-
# Analyze
|
|
124
|
-
|
|
127
|
+
# Analyze code operations across all sessions
|
|
128
|
+
vct analysis
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
---
|
|
@@ -130,24 +134,43 @@ vibe_coding_tracker analysis --path ~/.claude/projects/session.jsonl
|
|
|
130
134
|
|
|
131
135
|
### 🔍 Quick Reference
|
|
132
136
|
|
|
133
|
-
```
|
|
137
|
+
```
|
|
134
138
|
vct <COMMAND> [OPTIONS]
|
|
135
139
|
# Replace with `vibe_coding_tracker` if you are using the full binary name
|
|
136
140
|
|
|
137
141
|
Commands:
|
|
138
|
-
analysis Analyze JSONL conversation files (single file or all sessions)
|
|
139
|
-
usage Display token usage statistics
|
|
140
|
-
version Display version information
|
|
141
|
-
update Update to the latest version from GitHub releases
|
|
142
|
-
help Print this message or the help of the given subcommand(s)
|
|
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)
|
|
143
147
|
```
|
|
144
148
|
|
|
149
|
+
Time range flags (shared by `usage` and `analysis`, mutually exclusive, default `--all`):
|
|
150
|
+
|
|
151
|
+
| Flag | Window |
|
|
152
|
+
| ----------- | --------------------------------- |
|
|
153
|
+
| `--daily` | Sessions modified today |
|
|
154
|
+
| `--weekly` | Current ISO week (Monday → today) |
|
|
155
|
+
| `--monthly` | Current calendar month |
|
|
156
|
+
| `--all` | Every session on disk (default) |
|
|
157
|
+
|
|
145
158
|
---
|
|
146
159
|
|
|
147
160
|
## 💰 Usage Command
|
|
148
161
|
|
|
149
162
|
**Track your spending across all AI coding sessions.**
|
|
150
163
|
|
|
164
|
+
### Flags
|
|
165
|
+
|
|
166
|
+
| Flag | Purpose |
|
|
167
|
+
| ---------------------------------------------- | ----------------------------------- |
|
|
168
|
+
| *(none)* | Interactive TUI dashboard (default) |
|
|
169
|
+
| `--table` | Static table, no TUI |
|
|
170
|
+
| `--text` | Plain text, script-friendly |
|
|
171
|
+
| `--json` | JSON with enriched pricing metadata |
|
|
172
|
+
| `--daily` / `--weekly` / `--monthly` / `--all` | Time range filter (see table above) |
|
|
173
|
+
|
|
151
174
|
### Basic Usage
|
|
152
175
|
|
|
153
176
|
```bash
|
|
@@ -160,13 +183,48 @@ vct usage --table
|
|
|
160
183
|
# Plain text for scripts
|
|
161
184
|
vct usage --text
|
|
162
185
|
|
|
163
|
-
# JSON for data processing
|
|
186
|
+
# JSON for data processing (includes cost_usd and matched_model fields)
|
|
164
187
|
vct usage --json
|
|
188
|
+
|
|
189
|
+
# Combine time range with output format
|
|
190
|
+
vct usage --weekly
|
|
191
|
+
vct usage --table --monthly
|
|
192
|
+
vct usage --json --daily
|
|
165
193
|
```
|
|
166
194
|
|
|
167
|
-
|
|
195
|
+
> [!NOTE]
|
|
196
|
+
> Model rows are sorted by cost in ascending order, so the highest-spending model sits right above the `TOTAL` row. This applies to the interactive dashboard, `--table`, and `--text` output; `--json` preserves the same order.
|
|
168
197
|
|
|
169
|
-
|
|
198
|
+
### Preview: Interactive Dashboard (`vct usage`)
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
202
|
+
│ 📊 Token Usage Statistics │
|
|
203
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
204
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
205
|
+
│ Model Input Output Cache Read Cache Create Total Cost │
|
|
206
|
+
│ │
|
|
207
|
+
│ gemini-3.1-pro-preview 129,115 10,339 67,385 0 $0.40 │
|
|
208
|
+
│ claude-haiku-4-5-20251001 5,567 19,769 4,627,938 619,816 $1.34 │
|
|
209
|
+
│ claude-opus-4-6 25,651 179,066 40,830,154 2,572,258 $77.59 │
|
|
210
|
+
│ TOTAL 160,333 209,174 45,525,477 3,192,074 $79.33 │
|
|
211
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
212
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
213
|
+
│ Provider Tokens / Day Cost / Day Active Days │
|
|
214
|
+
│ │
|
|
215
|
+
│ 🤖 Claude Code 16,293,406 $26.31 3 │
|
|
216
|
+
│ ✨ Gemini 206,839 $0.40 1 │
|
|
217
|
+
│ ⭐ All Providers 16,362,353 $26.44 3 │
|
|
218
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
219
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
220
|
+
│ 💰 Total: $79.33 | 🔢 Tokens: 49,087,058 | 📊 Models: 3 | ⚡ CPU: 4.6% | 🧠 Mem: 148 MB │
|
|
221
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
222
|
+
Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### What It Scans
|
|
226
|
+
|
|
227
|
+
The tool automatically scans these directories:
|
|
170
228
|
|
|
171
229
|
- `~/.claude/projects/*.jsonl` (Claude Code)
|
|
172
230
|
- `~/.codex/sessions/*.jsonl` (Codex)
|
|
@@ -177,31 +235,73 @@ The tool scans these directories automatically:
|
|
|
177
235
|
|
|
178
236
|
## 📊 Analysis Command
|
|
179
237
|
|
|
180
|
-
**Deep dive into
|
|
238
|
+
**Deep dive into code operations — see exactly what your AI assistant did.**
|
|
239
|
+
|
|
240
|
+
### Flags
|
|
241
|
+
|
|
242
|
+
| Flag | Purpose |
|
|
243
|
+
| ---------------------------------------------- | ------------------------------------------------------------------ |
|
|
244
|
+
| *(none)* | Interactive TUI dashboard over all sessions |
|
|
245
|
+
| `--path <FILE>` | Analyze a single JSONL/JSON conversation file (prints JSON) |
|
|
246
|
+
| `--table` | Static table with per-provider daily averages |
|
|
247
|
+
| `--output <FILE>` | Save results as pretty-printed JSON |
|
|
248
|
+
| `--by-provider` | Group rows by provider (claude / codex / copilot / gemini) as JSON |
|
|
249
|
+
| `--daily` / `--weekly` / `--monthly` / `--all` | Time range filter (see table above) |
|
|
250
|
+
|
|
251
|
+
See [`examples/`](examples/) for sample inputs and matching JSON outputs for all four providers.
|
|
181
252
|
|
|
182
253
|
### Basic Usage
|
|
183
254
|
|
|
184
255
|
```bash
|
|
185
|
-
#
|
|
256
|
+
# Interactive dashboard for all sessions (default)
|
|
257
|
+
vct analysis
|
|
258
|
+
|
|
259
|
+
# Static table output with daily averages
|
|
260
|
+
vct analysis --table
|
|
261
|
+
|
|
262
|
+
# Analyze a single conversation file → stdout JSON
|
|
186
263
|
vct analysis --path ~/.claude/projects/session.jsonl
|
|
187
264
|
|
|
188
|
-
#
|
|
189
|
-
vct analysis --
|
|
265
|
+
# Save results to JSON
|
|
266
|
+
vct analysis --output report.json
|
|
190
267
|
|
|
191
|
-
#
|
|
192
|
-
vct analysis
|
|
268
|
+
# Group results by provider
|
|
269
|
+
vct analysis --by-provider
|
|
193
270
|
|
|
194
|
-
#
|
|
195
|
-
vct analysis --
|
|
271
|
+
# Save grouped results
|
|
272
|
+
vct analysis --by-provider --output grouped_report.json
|
|
196
273
|
|
|
197
|
-
#
|
|
198
|
-
vct analysis --
|
|
274
|
+
# Combine time range with output format
|
|
275
|
+
vct analysis --weekly
|
|
276
|
+
vct analysis --table --monthly
|
|
277
|
+
vct analysis --by-provider --daily --output today.json
|
|
278
|
+
```
|
|
199
279
|
|
|
200
|
-
|
|
201
|
-
vct analysis --all
|
|
280
|
+
### Preview: Interactive Dashboard (`vct analysis`)
|
|
202
281
|
|
|
203
|
-
|
|
204
|
-
|
|
282
|
+
```
|
|
283
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
284
|
+
│ 🔍 Analysis Statistics │
|
|
285
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
286
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
287
|
+
│ Model Edit Lines Read Lines Write Lines Bash Edit Read Write │
|
|
288
|
+
│ │
|
|
289
|
+
│ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 │
|
|
290
|
+
│ claude-opus-4-6 1,280 13,264 1,575 82 146 209 62 │
|
|
291
|
+
│ gemini-3.1-pro-preview 0 0 0 0 0 0 0 │
|
|
292
|
+
│ TOTAL 1,280 13,264 1,575 125 146 268 62 │
|
|
293
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
294
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
295
|
+
│ Provider EditL/Day ReadL/Day WriteL/Day Bash/Day Edit/Day Read/Day Write/Day Days │
|
|
296
|
+
│ │
|
|
297
|
+
│ 🤖 Claude Code 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
|
|
298
|
+
│ ✨ Gemini 0 0 0 0.0 0.0 0.0 0.0 1 │
|
|
299
|
+
│ ⭐ All Providers 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
|
|
300
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
301
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
302
|
+
│ 📝 Lines: 16,119 | 🔧 Tools: 601 | 📊 Models: 3 | ⚡ CPU: 3.6% | 🧠 Mem: 140 MB │
|
|
303
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
304
|
+
Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
|
|
205
305
|
```
|
|
206
306
|
|
|
207
307
|
---
|
|
@@ -221,10 +321,32 @@ vct update --check
|
|
|
221
321
|
# Interactive update with confirmation
|
|
222
322
|
vct update
|
|
223
323
|
|
|
224
|
-
# Force update
|
|
324
|
+
# Force update — always downloads latest version
|
|
225
325
|
vct update --force
|
|
226
326
|
```
|
|
227
327
|
|
|
328
|
+
### Preview (`vct update --check`)
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
📋 Current version: v0.5.10
|
|
332
|
+
🔍 Checking for latest release...
|
|
333
|
+
✅ Latest version: v0.5.10 — you are up to date!
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 🏷️ Version Command
|
|
339
|
+
|
|
340
|
+
Report the embedded build metadata (binary version, Rust toolchain, Cargo version):
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
vct version # Pretty table
|
|
344
|
+
vct version --text # One-field-per-line, script-friendly
|
|
345
|
+
vct version --json # Machine-readable JSON
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
The binary version is produced at build time by `build.rs` from `git describe`, so development builds include commit count + short SHA + `dirty` suffix when applicable.
|
|
349
|
+
|
|
228
350
|
---
|
|
229
351
|
|
|
230
352
|
## 💡 Smart Pricing System
|
package/README.zh-CN.md
CHANGED
|
@@ -17,54 +17,58 @@
|
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
**实时追踪你的 AI 编程开销。** Vibe Coding Tracker 是一款基于 Rust 构建的轻量级高性能 CLI 工具,用于监控和分析你在 Claude Code、Codex、Copilot 和 Gemini 上的使用情况——提供详细的费用明细、token 统计和代码操作洞察,同时保持极低的 CPU 和内存占用。
|
|
21
21
|
|
|
22
22
|
[English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
|
|
23
23
|
|
|
24
|
-
>
|
|
24
|
+
> 注意:CLI 示例中使用简写别名 `vct`。如果你是通过 npm/pip/cargo 安装的,二进制文件可能命名为 `vibe_coding_tracker` 或 `vct`。如有需要,请创建别名或在运行命令时将 `vct` 替换为完整名称。
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
28
|
## 🎯 为什么选择 Vibe Coding Tracker?
|
|
29
29
|
|
|
30
|
-
### 💰
|
|
30
|
+
### 💰 掌握你的开销
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
不用再猜测 AI 编程会话到底花了多少钱。通过 [LiteLLM](https://github.com/BerriAI/litellm) 自动更新定价,获取**实时费用追踪**。
|
|
33
|
+
|
|
34
|
+
### 🪶 超轻量级
|
|
35
|
+
|
|
36
|
+
使用 Rust 构建,资源占用极低。交互式 TUI 面板运行时仅需约 **3-5% CPU** 和约 **140 MB 内存**,即使处理来自多个供应商的数百万 token 也是如此——无需 Electron,无需臃肿的运行时。
|
|
33
37
|
|
|
34
38
|
### 📊 精美的可视化
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
选择你喜欢的查看方式:
|
|
37
41
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- **脚本友好**:纯文本和 JSON
|
|
41
|
-
-
|
|
42
|
+
- **交互式面板**:自动刷新的终端 UI,支持实时更新
|
|
43
|
+
- **静态报表**:专业的表格,适合文档记录
|
|
44
|
+
- **脚本友好**:纯文本和 JSON 格式,方便自动化
|
|
45
|
+
- **完整精度**:导出精确费用,满足财务核算需求
|
|
42
46
|
|
|
43
47
|
### 🚀 零配置
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
自动检测并处理来自 Claude Code、Codex、Copilot 和 Gemini 的日志。无需任何设置——直接运行即可分析。
|
|
46
50
|
|
|
47
51
|
### 🎨 丰富的洞察
|
|
48
52
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
53
|
+
- 按模型和日期统计 token 使用量
|
|
54
|
+
- 按 cache 类型(读取/创建)细分费用
|
|
55
|
+
- 文件操作追踪(编辑、读取、写入行数)
|
|
56
|
+
- 工具调用历史(Bash、Edit、Read、Write、TodoWrite)
|
|
57
|
+
- 按供应商统计每日平均值
|
|
54
58
|
|
|
55
59
|
---
|
|
56
60
|
|
|
57
61
|
## ✨ 核心特性
|
|
58
62
|
|
|
59
|
-
| 特性 |
|
|
60
|
-
| ------------------- |
|
|
61
|
-
| 🤖
|
|
62
|
-
| 💵 **智能定价** | 模糊模型匹配 +
|
|
63
|
-
| 🎨 **4 种显示模式** |
|
|
64
|
-
| 📈
|
|
65
|
-
|
|
|
66
|
-
| 🔄 **实时更新** |
|
|
67
|
-
| 💾 **高效缓存** |
|
|
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 调用次数 |
|
|
68
72
|
|
|
69
73
|
---
|
|
70
74
|
|
|
@@ -72,40 +76,40 @@
|
|
|
72
76
|
|
|
73
77
|
### 安装
|
|
74
78
|
|
|
75
|
-
|
|
79
|
+
选择最适合你的安装方式:
|
|
76
80
|
|
|
77
|
-
> 👨💻
|
|
81
|
+
> 👨💻 **开发者**:如果你想从源码构建或参与项目开发,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
|
|
78
82
|
|
|
79
|
-
####
|
|
83
|
+
#### 方式一:通过 npm 安装
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
**前置条件**:[Node.js](https://nodejs.org/) v22 或更高版本
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
以下包名任选其一(内容完全相同):
|
|
84
88
|
|
|
85
89
|
```bash
|
|
86
|
-
#
|
|
90
|
+
# Main package
|
|
87
91
|
npm install -g vibe-coding-tracker
|
|
88
92
|
|
|
89
|
-
#
|
|
93
|
+
# Short alias with scope
|
|
90
94
|
npm install -g @mai0313/vct
|
|
91
95
|
|
|
92
|
-
#
|
|
96
|
+
# Full name with scope
|
|
93
97
|
npm install -g @mai0313/vibe-coding-tracker
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-
####
|
|
100
|
+
#### 方式二:通过 PyPI 安装
|
|
97
101
|
|
|
98
|
-
|
|
102
|
+
**前置条件**:Python 3.8 或更高版本
|
|
99
103
|
|
|
100
104
|
```bash
|
|
101
105
|
pip install vibe_coding_tracker
|
|
102
|
-
#
|
|
106
|
+
# Or with uv
|
|
103
107
|
uv pip install vibe_coding_tracker
|
|
104
108
|
```
|
|
105
109
|
|
|
106
|
-
####
|
|
110
|
+
#### 方式三:通过 crates.io 安装
|
|
107
111
|
|
|
108
|
-
使用 Cargo 从 Rust
|
|
112
|
+
使用 Cargo 从 Rust 官方包注册中心安装:
|
|
109
113
|
|
|
110
114
|
```bash
|
|
111
115
|
cargo install vibe_coding_tracker
|
|
@@ -114,14 +118,14 @@ cargo install vibe_coding_tracker
|
|
|
114
118
|
### 首次运行
|
|
115
119
|
|
|
116
120
|
```bash
|
|
117
|
-
#
|
|
121
|
+
# View your usage with the interactive dashboard
|
|
118
122
|
vct usage
|
|
119
123
|
|
|
120
|
-
#
|
|
124
|
+
# Or run the binary built by Cargo/pip
|
|
121
125
|
vibe_coding_tracker usage
|
|
122
126
|
|
|
123
|
-
#
|
|
124
|
-
|
|
127
|
+
# Analyze code operations across all sessions
|
|
128
|
+
vct analysis
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
---
|
|
@@ -130,43 +134,97 @@ vibe_coding_tracker analysis --path ~/.claude/projects/session.jsonl
|
|
|
130
134
|
|
|
131
135
|
### 🔍 快速参考
|
|
132
136
|
|
|
133
|
-
```
|
|
134
|
-
vct
|
|
135
|
-
#
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
analysis
|
|
139
|
-
usage
|
|
140
|
-
version
|
|
141
|
-
update
|
|
142
|
-
help
|
|
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)
|
|
143
147
|
```
|
|
144
148
|
|
|
149
|
+
时间范围 flag(`usage` 与 `analysis` 共用,互斥,默认 `--all`):
|
|
150
|
+
|
|
151
|
+
| Flag | 范围 |
|
|
152
|
+
| ----------- | ---------------------------- |
|
|
153
|
+
| `--daily` | 今天更新过的 session |
|
|
154
|
+
| `--weekly` | 本 ISO 周(周一 → 今天) |
|
|
155
|
+
| `--monthly` | 本自然月 |
|
|
156
|
+
| `--all` | 磁盘上所有 session(默认值) |
|
|
157
|
+
|
|
145
158
|
---
|
|
146
159
|
|
|
147
160
|
## 💰 Usage 命令
|
|
148
161
|
|
|
149
|
-
|
|
162
|
+
**追踪你在所有 AI 编程会话中的开销。**
|
|
163
|
+
|
|
164
|
+
### Flag 一览
|
|
165
|
+
|
|
166
|
+
| Flag | 用途 |
|
|
167
|
+
| ---------------------------------------------- | -------------------------- |
|
|
168
|
+
| *(不带参数)* | 互动式 TUI 面板(默认) |
|
|
169
|
+
| `--table` | 静态表格,不启动 TUI |
|
|
170
|
+
| `--text` | 纯文本,适合脚本处理 |
|
|
171
|
+
| `--json` | JSON 输出,附带定价信息 |
|
|
172
|
+
| `--daily` / `--weekly` / `--monthly` / `--all` | 时间范围筛选(见上方表格) |
|
|
150
173
|
|
|
151
174
|
### 基本用法
|
|
152
175
|
|
|
153
176
|
```bash
|
|
154
|
-
#
|
|
177
|
+
# Interactive dashboard (recommended)
|
|
155
178
|
vct usage
|
|
156
179
|
|
|
157
|
-
#
|
|
180
|
+
# Static table for reports
|
|
158
181
|
vct usage --table
|
|
159
182
|
|
|
160
|
-
#
|
|
183
|
+
# Plain text for scripts
|
|
161
184
|
vct usage --text
|
|
162
185
|
|
|
163
|
-
# JSON
|
|
186
|
+
# JSON 输出,包含 cost_usd 与 matched_model 字段
|
|
164
187
|
vct usage --json
|
|
188
|
+
|
|
189
|
+
# 时间范围与输出格式可自由组合
|
|
190
|
+
vct usage --weekly
|
|
191
|
+
vct usage --table --monthly
|
|
192
|
+
vct usage --json --daily
|
|
165
193
|
```
|
|
166
194
|
|
|
167
|
-
|
|
195
|
+
> [!NOTE]
|
|
196
|
+
> Model 行会按 cost 升序排序,因此花费最高的 model 会紧邻在 `TOTAL` 行上方。该排序适用于交互式面板、`--table` 与 `--text` 三种输出;`--json` 也会保持相同顺序。
|
|
168
197
|
|
|
169
|
-
|
|
198
|
+
### 预览:交互式面板(`vct usage`)
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
202
|
+
│ 📊 Token Usage Statistics │
|
|
203
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
204
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
205
|
+
│ Model Input Output Cache Read Cache Create Total Cost │
|
|
206
|
+
│ │
|
|
207
|
+
│ gemini-3.1-pro-preview 129,115 10,339 67,385 0 $0.40 │
|
|
208
|
+
│ claude-haiku-4-5-20251001 5,567 19,769 4,627,938 619,816 $1.34 │
|
|
209
|
+
│ claude-opus-4-6 25,651 179,066 40,830,154 2,572,258 $77.59 │
|
|
210
|
+
│ TOTAL 160,333 209,174 45,525,477 3,192,074 $79.33 │
|
|
211
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
212
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
213
|
+
│ Provider Tokens / Day Cost / Day Active Days │
|
|
214
|
+
│ │
|
|
215
|
+
│ 🤖 Claude Code 16,293,406 $26.31 3 │
|
|
216
|
+
│ ✨ Gemini 206,839 $0.40 1 │
|
|
217
|
+
│ ⭐ All Providers 16,362,353 $26.44 3 │
|
|
218
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
219
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
220
|
+
│ 💰 Total: $79.33 | 🔢 Tokens: 49,087,058 | 📊 Models: 3 | ⚡ CPU: 4.6% | 🧠 Mem: 148 MB │
|
|
221
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
222
|
+
Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 扫描范围
|
|
226
|
+
|
|
227
|
+
该工具会自动扫描以下目录:
|
|
170
228
|
|
|
171
229
|
- `~/.claude/projects/*.jsonl`(Claude Code)
|
|
172
230
|
- `~/.codex/sessions/*.jsonl`(Codex)
|
|
@@ -177,31 +235,73 @@ vct usage --json
|
|
|
177
235
|
|
|
178
236
|
## 📊 Analysis 命令
|
|
179
237
|
|
|
180
|
-
|
|
238
|
+
**深入了解代码操作——查看你的 AI 助手到底做了什么。**
|
|
239
|
+
|
|
240
|
+
### Flag 一览
|
|
241
|
+
|
|
242
|
+
| Flag | 用途 |
|
|
243
|
+
| ---------------------------------------------- | --------------------------------------------------------------- |
|
|
244
|
+
| *(不带参数)* | 互动式 TUI 面板,覆盖所有 session |
|
|
245
|
+
| `--path <FILE>` | 分析单一 JSONL/JSON 对话文件(stdout 输出 JSON) |
|
|
246
|
+
| `--table` | 静态表格,附带每日平均值 |
|
|
247
|
+
| `--output <FILE>` | 将结果以格式化 JSON 保存到文件 |
|
|
248
|
+
| `--by-provider` | 按 provider(claude / codex / copilot / gemini)分组并输出 JSON |
|
|
249
|
+
| `--daily` / `--weekly` / `--monthly` / `--all` | 时间范围筛选(见上方表格) |
|
|
250
|
+
|
|
251
|
+
参见 [`examples/`](examples/) 目录,其中包含四种 provider 的示例输入与对应 JSON 输出。
|
|
181
252
|
|
|
182
253
|
### 基本用法
|
|
183
254
|
|
|
184
255
|
```bash
|
|
185
|
-
#
|
|
256
|
+
# Interactive dashboard for all sessions (default)
|
|
257
|
+
vct analysis
|
|
258
|
+
|
|
259
|
+
# Static table output with daily averages
|
|
260
|
+
vct analysis --table
|
|
261
|
+
|
|
262
|
+
# 分析单一对话文件 → stdout JSON
|
|
186
263
|
vct analysis --path ~/.claude/projects/session.jsonl
|
|
187
264
|
|
|
188
|
-
#
|
|
189
|
-
vct analysis --
|
|
265
|
+
# Save results to JSON
|
|
266
|
+
vct analysis --output report.json
|
|
190
267
|
|
|
191
|
-
#
|
|
192
|
-
vct analysis
|
|
268
|
+
# Group results by provider
|
|
269
|
+
vct analysis --by-provider
|
|
193
270
|
|
|
194
|
-
#
|
|
195
|
-
vct analysis --
|
|
271
|
+
# Save grouped results
|
|
272
|
+
vct analysis --by-provider --output grouped_report.json
|
|
196
273
|
|
|
197
|
-
#
|
|
198
|
-
vct analysis --
|
|
274
|
+
# 时间范围与输出格式可自由组合
|
|
275
|
+
vct analysis --weekly
|
|
276
|
+
vct analysis --table --monthly
|
|
277
|
+
vct analysis --by-provider --daily --output today.json
|
|
278
|
+
```
|
|
199
279
|
|
|
200
|
-
|
|
201
|
-
vct analysis --all
|
|
280
|
+
### 预览:交互式面板(`vct analysis`)
|
|
202
281
|
|
|
203
|
-
|
|
204
|
-
|
|
282
|
+
```
|
|
283
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
284
|
+
│ 🔍 Analysis Statistics │
|
|
285
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
286
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
287
|
+
│ Model Edit Lines Read Lines Write Lines Bash Edit Read Write │
|
|
288
|
+
│ │
|
|
289
|
+
│ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 │
|
|
290
|
+
│ claude-opus-4-6 1,280 13,264 1,575 82 146 209 62 │
|
|
291
|
+
│ gemini-3.1-pro-preview 0 0 0 0 0 0 0 │
|
|
292
|
+
│ TOTAL 1,280 13,264 1,575 125 146 268 62 │
|
|
293
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
294
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
295
|
+
│ Provider EditL/Day ReadL/Day WriteL/Day Bash/Day Edit/Day Read/Day Write/Day Days │
|
|
296
|
+
│ │
|
|
297
|
+
│ 🤖 Claude Code 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
|
|
298
|
+
│ ✨ Gemini 0 0 0 0.0 0.0 0.0 0.0 1 │
|
|
299
|
+
│ ⭐ All Providers 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
|
|
300
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
301
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
302
|
+
│ 📝 Lines: 16,119 | 🔧 Tools: 601 | 📊 Models: 3 | ⚡ CPU: 3.6% | 🧠 Mem: 140 MB │
|
|
303
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
304
|
+
Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
|
|
205
305
|
```
|
|
206
306
|
|
|
207
307
|
---
|
|
@@ -210,51 +310,73 @@ vct analysis --all --output grouped_report.json
|
|
|
210
310
|
|
|
211
311
|
**自动保持安装版本为最新。**
|
|
212
312
|
|
|
213
|
-
update 命令适用于**所有安装方式**(npm/pip/cargo
|
|
313
|
+
update 命令适用于**所有安装方式**(npm/pip/cargo/手动安装),它会直接从 GitHub releases 下载并替换二进制文件。
|
|
214
314
|
|
|
215
315
|
### 基本用法
|
|
216
316
|
|
|
217
317
|
```bash
|
|
218
|
-
#
|
|
318
|
+
# Check for updates
|
|
219
319
|
vct update --check
|
|
220
320
|
|
|
221
|
-
#
|
|
321
|
+
# Interactive update with confirmation
|
|
222
322
|
vct update
|
|
223
323
|
|
|
224
|
-
#
|
|
324
|
+
# Force update — always downloads latest version
|
|
225
325
|
vct update --force
|
|
226
326
|
```
|
|
227
327
|
|
|
328
|
+
### 预览(`vct update --check`)
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
📋 Current version: v0.5.10
|
|
332
|
+
🔍 Checking for latest release...
|
|
333
|
+
✅ Latest version: v0.5.10 — you are up to date!
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 🏷️ Version 命令
|
|
339
|
+
|
|
340
|
+
查看内置的构建信息(binary version、Rust toolchain、Cargo version):
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
vct version # 彩色表格
|
|
344
|
+
vct version --text # 每行一个字段,适合脚本
|
|
345
|
+
vct version --json # 机读 JSON
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Binary version 由 `build.rs` 在编译期通过 `git describe` 写入,开发版本会附带 commit 计数、short SHA 与 `dirty` 后缀。
|
|
349
|
+
|
|
228
350
|
---
|
|
229
351
|
|
|
230
352
|
## 💡 智能定价系统
|
|
231
353
|
|
|
232
|
-
###
|
|
354
|
+
### 工作原理
|
|
233
355
|
|
|
234
|
-
1. **自动更新**:每天从 [LiteLLM](https://github.com/BerriAI/litellm)
|
|
235
|
-
2.
|
|
236
|
-
3.
|
|
237
|
-
4.
|
|
356
|
+
1. **自动更新**:每天从 [LiteLLM](https://github.com/BerriAI/litellm) 获取最新定价
|
|
357
|
+
2. **智能缓存**:将定价信息存储在 `~/.vibe_coding_tracker/` 目录中,有效期 24 小时
|
|
358
|
+
3. **模糊匹配**:即使是自定义模型名称也能找到最佳匹配
|
|
359
|
+
4. **始终精确**:确保你获取到最新的定价信息
|
|
238
360
|
|
|
239
361
|
### 模型匹配
|
|
240
362
|
|
|
241
|
-
|
|
363
|
+
**优先级顺序**:
|
|
242
364
|
|
|
243
365
|
1. ✅ **精确匹配**:`claude-sonnet-4` → `claude-sonnet-4`
|
|
244
|
-
2. 🔄
|
|
245
|
-
3. 🔍
|
|
246
|
-
4. 🎯
|
|
247
|
-
5. 💵
|
|
366
|
+
2. 🔄 **标准化匹配**:`claude-sonnet-4-20250514` → `claude-sonnet-4`
|
|
367
|
+
3. 🔍 **子串匹配**:`custom-gpt-4` → `gpt-4`
|
|
368
|
+
4. 🎯 **模糊匹配(AI 驱动)**:使用 Jaro-Winkler 相似度算法(70% 阈值)
|
|
369
|
+
5. 💵 **兜底方案**:如果未找到匹配,显示 $0.00
|
|
248
370
|
|
|
249
371
|
---
|
|
250
372
|
|
|
251
373
|
## 🐳 Docker 支持
|
|
252
374
|
|
|
253
375
|
```bash
|
|
254
|
-
#
|
|
376
|
+
# Build image
|
|
255
377
|
docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
|
|
256
378
|
|
|
257
|
-
#
|
|
379
|
+
# Run with your sessions
|
|
258
380
|
docker run --rm \
|
|
259
381
|
-v ~/.claude:/root/.claude \
|
|
260
382
|
-v ~/.codex:/root/.codex \
|
package/README.zh-TW.md
CHANGED
|
@@ -17,54 +17,58 @@
|
|
|
17
17
|
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
**即時追蹤你的 AI 程式設計花費。** Vibe Coding Tracker 是一款以 Rust 打造的輕量、高效能 CLI 工具,能監控與分析你在 Claude Code、Codex、Copilot 及 Gemini 的使用狀況——提供詳細的費用明細、token 統計資料與程式碼操作分析,同時維持極低的 CPU 與記憶體使用量。
|
|
21
21
|
|
|
22
22
|
[English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
|
|
23
23
|
|
|
24
|
-
>
|
|
24
|
+
> 注意:CLI 範例使用簡短別名 `vct`。如果你是透過 npm/pip/cargo 安裝,執行檔可能命名為 `vibe_coding_tracker` 或 `vct`。如有需要,請建立別名或在執行指令時將 `vct` 替換為完整名稱。
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
28
|
## 🎯 為什麼選擇 Vibe Coding Tracker?
|
|
29
29
|
|
|
30
|
-
### 💰
|
|
30
|
+
### 💰 掌握你的花費
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
不用再猜測 AI 程式設計工作階段花了多少錢。透過 [LiteLLM](https://github.com/BerriAI/litellm) 自動更新價格,取得**即時費用追蹤**。
|
|
33
33
|
|
|
34
|
-
###
|
|
34
|
+
### 🪶 超輕量
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
以 Rust 打造,資源佔用極低。互動式 TUI 儀表板僅需 **~3-5% CPU** 與 **~140 MB 記憶體**,即使處理來自多個供應商的數百萬 token 也不例外——不用 Electron,不用臃腫的執行環境。
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
### 📊 精美視覺化
|
|
39
|
+
|
|
40
|
+
選擇你偏好的檢視方式:
|
|
41
|
+
|
|
42
|
+
- **互動式儀表板**:自動更新的終端機 UI,即時顯示最新資訊
|
|
43
|
+
- **靜態報表**:專業的表格格式,適合撰寫文件
|
|
44
|
+
- **腳本友好**:純文字及 JSON 輸出,方便自動化處理
|
|
45
|
+
- **完整精度**:匯出精確費用供會計使用
|
|
42
46
|
|
|
43
47
|
### 🚀 零設定
|
|
44
48
|
|
|
45
|
-
自動偵測並處理 Claude Code、Codex、Copilot
|
|
49
|
+
自動偵測並處理 Claude Code、Codex、Copilot 及 Gemini 的日誌檔。不需要任何設定——直接執行就能分析。
|
|
46
50
|
|
|
47
|
-
### 🎨
|
|
51
|
+
### 🎨 豐富洞察
|
|
48
52
|
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
53
|
+
- 依模型與日期分類的 token 使用量
|
|
54
|
+
- 依 cache 類型(讀取 / 建立)的費用明細
|
|
55
|
+
- 檔案操作追蹤(編輯、讀取、寫入行數)
|
|
56
|
+
- 工具呼叫歷史(Bash、Edit、Read、Write、TodoWrite)
|
|
57
|
+
- 每個供應商的每日平均值
|
|
54
58
|
|
|
55
59
|
---
|
|
56
60
|
|
|
57
|
-
## ✨
|
|
61
|
+
## ✨ 主要功能
|
|
58
62
|
|
|
59
|
-
|
|
|
60
|
-
| ------------------- |
|
|
61
|
-
| 🤖
|
|
62
|
-
| 💵 **智慧定價** |
|
|
63
|
-
| 🎨 **4 種顯示模式** |
|
|
64
|
-
| 📈
|
|
65
|
-
|
|
|
66
|
-
| 🔄 **即時更新** |
|
|
67
|
-
| 💾 **高效快取** |
|
|
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 呼叫次數 |
|
|
68
72
|
|
|
69
73
|
---
|
|
70
74
|
|
|
@@ -72,40 +76,40 @@
|
|
|
72
76
|
|
|
73
77
|
### 安裝
|
|
74
78
|
|
|
75
|
-
|
|
79
|
+
選擇最適合你的安裝方式:
|
|
76
80
|
|
|
77
|
-
> 👨💻
|
|
81
|
+
> 👨💻 **開發者**:如果你想從原始碼建置或參與開發,請參閱 [CONTRIBUTING.md](CONTRIBUTING.md)。
|
|
78
82
|
|
|
79
|
-
####
|
|
83
|
+
#### 方法一:透過 npm 安裝
|
|
80
84
|
|
|
81
|
-
|
|
85
|
+
**前置條件**:[Node.js](https://nodejs.org/) v22 或更高版本
|
|
82
86
|
|
|
83
|
-
|
|
87
|
+
選擇以下任一套件名稱(內容完全相同):
|
|
84
88
|
|
|
85
89
|
```bash
|
|
86
|
-
#
|
|
90
|
+
# Main package
|
|
87
91
|
npm install -g vibe-coding-tracker
|
|
88
92
|
|
|
89
|
-
#
|
|
93
|
+
# Short alias with scope
|
|
90
94
|
npm install -g @mai0313/vct
|
|
91
95
|
|
|
92
|
-
#
|
|
96
|
+
# Full name with scope
|
|
93
97
|
npm install -g @mai0313/vibe-coding-tracker
|
|
94
98
|
```
|
|
95
99
|
|
|
96
|
-
####
|
|
100
|
+
#### 方法二:透過 PyPI 安裝
|
|
97
101
|
|
|
98
|
-
|
|
102
|
+
**前置條件**:Python 3.8 或更高版本
|
|
99
103
|
|
|
100
104
|
```bash
|
|
101
105
|
pip install vibe_coding_tracker
|
|
102
|
-
#
|
|
106
|
+
# Or with uv
|
|
103
107
|
uv pip install vibe_coding_tracker
|
|
104
108
|
```
|
|
105
109
|
|
|
106
|
-
####
|
|
110
|
+
#### 方法三:透過 crates.io 安裝
|
|
107
111
|
|
|
108
|
-
使用 Cargo
|
|
112
|
+
使用 Cargo 從官方 Rust 套件倉庫安裝:
|
|
109
113
|
|
|
110
114
|
```bash
|
|
111
115
|
cargo install vibe_coding_tracker
|
|
@@ -114,59 +118,113 @@ cargo install vibe_coding_tracker
|
|
|
114
118
|
### 首次執行
|
|
115
119
|
|
|
116
120
|
```bash
|
|
117
|
-
#
|
|
121
|
+
# View your usage with the interactive dashboard
|
|
118
122
|
vct usage
|
|
119
123
|
|
|
120
|
-
#
|
|
124
|
+
# Or run the binary built by Cargo/pip
|
|
121
125
|
vibe_coding_tracker usage
|
|
122
126
|
|
|
123
|
-
#
|
|
124
|
-
|
|
127
|
+
# Analyze code operations across all sessions
|
|
128
|
+
vct analysis
|
|
125
129
|
```
|
|
126
130
|
|
|
127
131
|
---
|
|
128
132
|
|
|
129
|
-
## 📖
|
|
133
|
+
## 📖 指令指南
|
|
130
134
|
|
|
131
135
|
### 🔍 快速參考
|
|
132
136
|
|
|
133
|
-
```
|
|
134
|
-
vct
|
|
135
|
-
#
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
analysis
|
|
139
|
-
usage
|
|
140
|
-
version
|
|
141
|
-
update
|
|
142
|
-
help
|
|
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)
|
|
143
147
|
```
|
|
144
148
|
|
|
149
|
+
時間範圍 flag(`usage` 與 `analysis` 共用,互斥,預設 `--all`):
|
|
150
|
+
|
|
151
|
+
| Flag | 範圍 |
|
|
152
|
+
| ----------- | -------------------------- |
|
|
153
|
+
| `--daily` | 今天更新過的 session |
|
|
154
|
+
| `--weekly` | 本 ISO 週(週一 → 今天) |
|
|
155
|
+
| `--monthly` | 本自然月 |
|
|
156
|
+
| `--all` | 磁碟上所有 session(預設) |
|
|
157
|
+
|
|
145
158
|
---
|
|
146
159
|
|
|
147
|
-
## 💰 Usage
|
|
160
|
+
## 💰 Usage 指令
|
|
161
|
+
|
|
162
|
+
**追蹤你在所有 AI 程式設計工作階段的花費。**
|
|
148
163
|
|
|
149
|
-
|
|
164
|
+
### Flag 一覽
|
|
165
|
+
|
|
166
|
+
| Flag | 用途 |
|
|
167
|
+
| ---------------------------------------------- | ---------------------------- |
|
|
168
|
+
| *(不帶參數)* | 互動式 TUI 儀表板(預設) |
|
|
169
|
+
| `--table` | 靜態表格,不啟動 TUI |
|
|
170
|
+
| `--text` | 純文字,適合腳本處理 |
|
|
171
|
+
| `--json` | JSON 輸出,附帶 pricing 資訊 |
|
|
172
|
+
| `--daily` / `--weekly` / `--monthly` / `--all` | 時間範圍篩選(見上方表格) |
|
|
150
173
|
|
|
151
174
|
### 基本用法
|
|
152
175
|
|
|
153
176
|
```bash
|
|
154
|
-
#
|
|
177
|
+
# Interactive dashboard (recommended)
|
|
155
178
|
vct usage
|
|
156
179
|
|
|
157
|
-
#
|
|
180
|
+
# Static table for reports
|
|
158
181
|
vct usage --table
|
|
159
182
|
|
|
160
|
-
#
|
|
183
|
+
# Plain text for scripts
|
|
161
184
|
vct usage --text
|
|
162
185
|
|
|
163
|
-
# JSON
|
|
186
|
+
# JSON 輸出,包含 cost_usd 與 matched_model 欄位
|
|
164
187
|
vct usage --json
|
|
188
|
+
|
|
189
|
+
# 時間範圍與輸出格式可自由組合
|
|
190
|
+
vct usage --weekly
|
|
191
|
+
vct usage --table --monthly
|
|
192
|
+
vct usage --json --daily
|
|
165
193
|
```
|
|
166
194
|
|
|
167
|
-
|
|
195
|
+
> [!NOTE]
|
|
196
|
+
> Model 列會依 cost 由小到大排序,所以花費最高的 model 會緊鄰在 `TOTAL` 列上方。這個排序會套用到互動式儀表板、`--table` 與 `--text` 三種輸出;`--json` 也會保持相同順序。
|
|
168
197
|
|
|
169
|
-
|
|
198
|
+
### 預覽:互動式儀表板(`vct usage`)
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
202
|
+
│ 📊 Token Usage Statistics │
|
|
203
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
204
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
205
|
+
│ Model Input Output Cache Read Cache Create Total Cost │
|
|
206
|
+
│ │
|
|
207
|
+
│ gemini-3.1-pro-preview 129,115 10,339 67,385 0 $0.40 │
|
|
208
|
+
│ claude-haiku-4-5-20251001 5,567 19,769 4,627,938 619,816 $1.34 │
|
|
209
|
+
│ claude-opus-4-6 25,651 179,066 40,830,154 2,572,258 $77.59 │
|
|
210
|
+
│ TOTAL 160,333 209,174 45,525,477 3,192,074 $79.33 │
|
|
211
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
212
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
213
|
+
│ Provider Tokens / Day Cost / Day Active Days │
|
|
214
|
+
│ │
|
|
215
|
+
│ 🤖 Claude Code 16,293,406 $26.31 3 │
|
|
216
|
+
│ ✨ Gemini 206,839 $0.40 1 │
|
|
217
|
+
│ ⭐ All Providers 16,362,353 $26.44 3 │
|
|
218
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
219
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
220
|
+
│ 💰 Total: $79.33 | 🔢 Tokens: 49,087,058 | 📊 Models: 3 | ⚡ CPU: 4.6% | 🧠 Mem: 148 MB │
|
|
221
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
222
|
+
Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 掃描範圍
|
|
226
|
+
|
|
227
|
+
此工具會自動掃描以下目錄:
|
|
170
228
|
|
|
171
229
|
- `~/.claude/projects/*.jsonl`(Claude Code)
|
|
172
230
|
- `~/.codex/sessions/*.jsonl`(Codex)
|
|
@@ -175,86 +233,150 @@ vct usage --json
|
|
|
175
233
|
|
|
176
234
|
---
|
|
177
235
|
|
|
178
|
-
## 📊 Analysis
|
|
236
|
+
## 📊 Analysis 指令
|
|
179
237
|
|
|
180
|
-
|
|
238
|
+
**深入分析程式碼操作——精確掌握你的 AI 助手做了哪些事。**
|
|
239
|
+
|
|
240
|
+
### Flag 一覽
|
|
241
|
+
|
|
242
|
+
| Flag | 用途 |
|
|
243
|
+
| ---------------------------------------------- | --------------------------------------------------------------- |
|
|
244
|
+
| *(不帶參數)* | 互動式 TUI 儀表板,涵蓋所有 session |
|
|
245
|
+
| `--path <FILE>` | 分析單一 JSONL/JSON 對話檔案(stdout 輸出 JSON) |
|
|
246
|
+
| `--table` | 靜態表格,附帶每日平均值 |
|
|
247
|
+
| `--output <FILE>` | 將結果以格式化 JSON 存成檔案 |
|
|
248
|
+
| `--by-provider` | 依 provider(claude / codex / copilot / gemini)分組並輸出 JSON |
|
|
249
|
+
| `--daily` / `--weekly` / `--monthly` / `--all` | 時間範圍篩選(見上方表格) |
|
|
250
|
+
|
|
251
|
+
請參考 [`examples/`](examples/) 目錄,裡面有四種 provider 的範例輸入與對應的 JSON 輸出。
|
|
181
252
|
|
|
182
253
|
### 基本用法
|
|
183
254
|
|
|
184
255
|
```bash
|
|
185
|
-
#
|
|
256
|
+
# Interactive dashboard for all sessions (default)
|
|
257
|
+
vct analysis
|
|
258
|
+
|
|
259
|
+
# Static table output with daily averages
|
|
260
|
+
vct analysis --table
|
|
261
|
+
|
|
262
|
+
# 分析單一對話檔案 → stdout JSON
|
|
186
263
|
vct analysis --path ~/.claude/projects/session.jsonl
|
|
187
264
|
|
|
188
|
-
#
|
|
189
|
-
vct analysis --
|
|
265
|
+
# Save results to JSON
|
|
266
|
+
vct analysis --output report.json
|
|
190
267
|
|
|
191
|
-
#
|
|
192
|
-
vct analysis
|
|
268
|
+
# Group results by provider
|
|
269
|
+
vct analysis --by-provider
|
|
193
270
|
|
|
194
|
-
#
|
|
195
|
-
vct analysis --
|
|
271
|
+
# Save grouped results
|
|
272
|
+
vct analysis --by-provider --output grouped_report.json
|
|
196
273
|
|
|
197
|
-
#
|
|
198
|
-
vct analysis --
|
|
274
|
+
# 時間範圍與輸出格式可自由組合
|
|
275
|
+
vct analysis --weekly
|
|
276
|
+
vct analysis --table --monthly
|
|
277
|
+
vct analysis --by-provider --daily --output today.json
|
|
278
|
+
```
|
|
199
279
|
|
|
200
|
-
|
|
201
|
-
vct analysis --all
|
|
280
|
+
### 預覽:互動式儀表板(`vct analysis`)
|
|
202
281
|
|
|
203
|
-
|
|
204
|
-
|
|
282
|
+
```
|
|
283
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
284
|
+
│ 🔍 Analysis Statistics │
|
|
285
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
286
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
287
|
+
│ Model Edit Lines Read Lines Write Lines Bash Edit Read Write │
|
|
288
|
+
│ │
|
|
289
|
+
│ claude-haiku-4-5-20251001 0 0 0 43 0 59 0 │
|
|
290
|
+
│ claude-opus-4-6 1,280 13,264 1,575 82 146 209 62 │
|
|
291
|
+
│ gemini-3.1-pro-preview 0 0 0 0 0 0 0 │
|
|
292
|
+
│ TOTAL 1,280 13,264 1,575 125 146 268 62 │
|
|
293
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
294
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
295
|
+
│ Provider EditL/Day ReadL/Day WriteL/Day Bash/Day Edit/Day Read/Day Write/Day Days │
|
|
296
|
+
│ │
|
|
297
|
+
│ 🤖 Claude Code 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
|
|
298
|
+
│ ✨ Gemini 0 0 0 0.0 0.0 0.0 0.0 1 │
|
|
299
|
+
│ ⭐ All Providers 426.7 4421.3 525.0 41.7 48.7 89.3 20.7 3 │
|
|
300
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
301
|
+
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
|
|
302
|
+
│ 📝 Lines: 16,119 | 🔧 Tools: 601 | 📊 Models: 3 | ⚡ CPU: 3.6% | 🧠 Mem: 140 MB │
|
|
303
|
+
└─────────────────────────────────────────────────────────────────────────────────────────────┘
|
|
304
|
+
Press 'q', 'Esc', 'Ctrl+C' to quit | Press 'r' to refresh
|
|
205
305
|
```
|
|
206
306
|
|
|
207
307
|
---
|
|
208
308
|
|
|
209
|
-
## 🔄 Update
|
|
309
|
+
## 🔄 Update 指令
|
|
210
310
|
|
|
211
|
-
|
|
311
|
+
**自動保持安裝為最新版本。**
|
|
212
312
|
|
|
213
|
-
|
|
313
|
+
Update 指令適用於**所有安裝方式**(npm/pip/cargo/手動安裝),透過直接從 GitHub releases 下載並替換執行檔來完成更新。
|
|
214
314
|
|
|
215
315
|
### 基本用法
|
|
216
316
|
|
|
217
317
|
```bash
|
|
218
|
-
#
|
|
318
|
+
# Check for updates
|
|
219
319
|
vct update --check
|
|
220
320
|
|
|
221
|
-
#
|
|
321
|
+
# Interactive update with confirmation
|
|
222
322
|
vct update
|
|
223
323
|
|
|
224
|
-
#
|
|
324
|
+
# Force update — always downloads latest version
|
|
225
325
|
vct update --force
|
|
226
326
|
```
|
|
227
327
|
|
|
328
|
+
### 預覽(`vct update --check`)
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
📋 Current version: v0.5.10
|
|
332
|
+
🔍 Checking for latest release...
|
|
333
|
+
✅ Latest version: v0.5.10 — you are up to date!
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 🏷️ Version 指令
|
|
339
|
+
|
|
340
|
+
檢視內建的建置資訊(binary version、Rust toolchain、Cargo version):
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
vct version # 彩色表格
|
|
344
|
+
vct version --text # 每行一個欄位,適合腳本
|
|
345
|
+
vct version --json # 機器可讀的 JSON
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
Binary version 由 `build.rs` 在編譯期透過 `git describe` 寫入,開發版本會附上 commit 數、short SHA 與 `dirty` 後綴。
|
|
349
|
+
|
|
228
350
|
---
|
|
229
351
|
|
|
230
352
|
## 💡 智慧定價系統
|
|
231
353
|
|
|
232
|
-
###
|
|
354
|
+
### 運作方式
|
|
233
355
|
|
|
234
|
-
1.
|
|
235
|
-
2.
|
|
236
|
-
3.
|
|
237
|
-
4.
|
|
356
|
+
1. **自動更新**:每日從 [LiteLLM](https://github.com/BerriAI/litellm) 取得最新價格
|
|
357
|
+
2. **智慧快取**:將價格資料儲存於 `~/.vibe_coding_tracker/`,有效期 24 小時
|
|
358
|
+
3. **模糊比對**:即使是自訂模型名稱也能找到最佳配對
|
|
359
|
+
4. **始終精準**:確保你取得最新的定價資訊
|
|
238
360
|
|
|
239
|
-
###
|
|
361
|
+
### 模型比對
|
|
240
362
|
|
|
241
363
|
**優先順序**:
|
|
242
364
|
|
|
243
|
-
1. ✅
|
|
244
|
-
2. 🔄
|
|
245
|
-
3. 🔍
|
|
246
|
-
4. 🎯
|
|
247
|
-
5. 💵
|
|
365
|
+
1. ✅ **完全比對**:`claude-sonnet-4` → `claude-sonnet-4`
|
|
366
|
+
2. 🔄 **正規化比對**:`claude-sonnet-4-20250514` → `claude-sonnet-4`
|
|
367
|
+
3. 🔍 **子字串比對**:`custom-gpt-4` → `gpt-4`
|
|
368
|
+
4. 🎯 **模糊比對(AI 驅動)**:使用 Jaro-Winkler 相似度(70% 門檻值)
|
|
369
|
+
5. 💵 **備援方案**:若無法配對則顯示 $0.00
|
|
248
370
|
|
|
249
371
|
---
|
|
250
372
|
|
|
251
373
|
## 🐳 Docker 支援
|
|
252
374
|
|
|
253
375
|
```bash
|
|
254
|
-
#
|
|
376
|
+
# Build image
|
|
255
377
|
docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
|
|
256
378
|
|
|
257
|
-
#
|
|
379
|
+
# Run with your sessions
|
|
258
380
|
docker run --rm \
|
|
259
381
|
-v ~/.claude:/root/.claude \
|
|
260
382
|
-v ~/.codex:/root/.codex \
|
|
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/vibe-coding-tracker",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.13",
|
|
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",
|