@mai0313/vct 0.5.8 → 0.5.11

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
@@ -1,4 +1,4 @@
1
- <center>
1
+ <div align="center" markdown="1">
2
2
 
3
3
  # Vibe Coding Tracker — AI Coding Assistant Usage Tracker
4
4
 
@@ -15,13 +15,13 @@
15
15
  [![Star on GitHub](https://img.shields.io/github/stars/Mai0313/VibeCodingTracker?style=social&label=Star)](https://github.com/Mai0313/VibeCodingTracker)
16
16
  [![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://github.com/Mai0313/VibeCodingTracker/pulls)
17
17
 
18
- </center>
18
+ </div>
19
19
 
20
20
  **Track your AI coding costs in real-time.** Vibe Coding Tracker is a powerful CLI tool that helps you monitor and analyze your Claude Code, Codex, Copilot, and Gemini usage, providing detailed cost breakdowns, token statistics, and code operation insights.
21
21
 
22
22
  [English](README.md) | [繁體中文](README.zh-TW.md) | [简体中文](README.zh-CN.md)
23
23
 
24
- > Note: CLI examples use the short alias `vct`. If you built from source, the compiled binary is named `vibe_coding_tracker`; create an alias or replace `vct` with the full name when running commands.
24
+ > Note: CLI examples use the short alias `vct`. If you installed via npm/pip/cargo, the binary might be named `vibe_coding_tracker` or `vct`. Create an alias or replace `vct` with the full name when running commands if needed.
25
25
 
26
26
  ---
27
27
 
@@ -74,11 +74,13 @@ Automatically detects and processes logs from Claude Code, Codex, Copilot, and G
74
74
 
75
75
  Choose the installation method that works best for you:
76
76
 
77
- #### Method 1: Install from npm (Recommended ✨)
77
+ > 👨‍💻 **Developers**: If you want to build from source or contribute to development, please see [CONTRIBUTING.md](CONTRIBUTING.md).
78
78
 
79
- **The easiest way to install** - includes pre-compiled binaries for your platform, no build step required!
79
+ #### Method 1: Install from npm
80
80
 
81
- Choose any of the following package names (all are identical):
81
+ **Prerequisites**: [Node.js](https://nodejs.org/) v22 or higher
82
+
83
+ Choose one of the following package names (they are identical):
82
84
 
83
85
  ```bash
84
86
  # Main package
@@ -91,34 +93,16 @@ npm install -g @mai0313/vct
91
93
  npm install -g @mai0313/vibe-coding-tracker
92
94
  ```
93
95
 
94
- **Prerequisites**: [Node.js](https://nodejs.org/) v22 or higher
95
-
96
- **Supported Platforms**:
97
-
98
- - Linux (x64, ARM64)
99
- - macOS (x64, ARM64)
100
- - Windows (x64, ARM64)
101
-
102
96
  #### Method 2: Install from PyPI
103
97
 
104
- **For Python users** - includes pre-compiled binaries for your platform, no build step required!
98
+ **Prerequisites**: Python 3.8 or higher
105
99
 
106
100
  ```bash
107
- # Install with pip
108
101
  pip install vibe_coding_tracker
109
-
110
- # Install with uv (recommended for faster installation)
102
+ # Or with uv
111
103
  uv pip install vibe_coding_tracker
112
104
  ```
113
105
 
114
- **Prerequisites**: Python 3.8 or higher
115
-
116
- **Supported Platforms**:
117
-
118
- - Linux (x64, ARM64)
119
- - macOS (x64, ARM64)
120
- - Windows (x64, ARM64)
121
-
122
106
  #### Method 3: Install from crates.io
123
107
 
124
108
  Install using Cargo from the official Rust package registry:
@@ -127,102 +111,19 @@ Install using Cargo from the official Rust package registry:
127
111
  cargo install vibe_coding_tracker
128
112
  ```
129
113
 
130
- **Prerequisites**: [Rust toolchain](https://rustup.rs/) 1.85 or higher
131
-
132
- > **Note**: This project uses **Rust 2024 edition** and requires Rust 1.85+. Update your toolchain with `rustup update` if needed.
133
-
134
- #### Method 4: Build from Source
135
-
136
- For users who want to customize the build or contribute to development:
137
-
138
- ```bash
139
- # 1. Clone the repository
140
- git clone https://github.com/Mai0313/VibeCodingTracker.git
141
- cd VibeCodingTracker
142
-
143
- # 2. Build release version
144
- cargo build --release
145
-
146
- # 3. Binary location
147
- ./target/release/vibe_coding_tracker
148
-
149
- # 4. Optional: create a short alias
150
- # Linux/macOS:
151
- sudo ln -sf "$(pwd)/target/release/vibe_coding_tracker" /usr/local/bin/vct
152
-
153
- # Or install to user directory:
154
- mkdir -p ~/.local/bin
155
- ln -sf "$(pwd)/target/release/vibe_coding_tracker" ~/.local/bin/vct
156
- # Make sure ~/.local/bin is in your PATH
157
- ```
158
-
159
- **Prerequisites**: [Rust toolchain](https://rustup.rs/) 1.85 or higher
160
-
161
- > **Note**: This project uses **Rust 2024 edition** and requires Rust 1.85+. Update your toolchain with `rustup update` if needed.
162
-
163
- #### Method 5: Quick Install via Curl (Linux/macOS)
164
-
165
- **One-line installation script** - automatically detects your platform and installs the latest release:
166
-
167
- ```bash
168
- curl -fsSLk https://github.com/Mai0313/VibeCodingTracker/raw/main/scripts/install.sh | bash
169
- ```
170
-
171
- **Prerequisites**: `curl` and `tar` (usually pre-installed)
172
-
173
- **What it does**:
174
-
175
- - Detects your OS and architecture automatically
176
- - Downloads the latest release from GitHub
177
- - Extracts and installs to `/usr/local/bin` or `~/.local/bin`
178
- - Creates the `vct` short alias automatically
179
- - Skips SSL verification for restricted networks
180
-
181
- **Supported Platforms**:
182
-
183
- - Linux (x64, ARM64)
184
- - macOS (x64, ARM64)
185
-
186
- #### Method 6: Quick Install via PowerShell (Windows)
187
-
188
- **One-line installation script** - automatically detects your architecture and installs the latest release:
189
-
190
- ```powershell
191
- powershell -ExecutionPolicy ByPass -c "[System.Net.ServicePointManager]::ServerCertificateValidationCallback={$true}; irm https://github.com/Mai0313/VibeCodingTracker/raw/main/scripts/install.ps1 | iex"
192
- ```
193
-
194
- **Prerequisites**: PowerShell 5.0 or higher (included in Windows 10+)
195
-
196
- **What it does**:
197
-
198
- - Detects your Windows architecture automatically (x64 or ARM64)
199
- - Downloads the latest release from GitHub
200
- - Installs to `%LOCALAPPDATA%\Programs\VibeCodingTracker`
201
- - Creates the `vct.exe` short alias automatically
202
- - Adds to user PATH automatically
203
- - Skips SSL verification for restricted networks
204
-
205
- **Note**: You may need to restart your terminal for PATH changes to take effect.
206
-
207
- **Supported Platforms**:
208
-
209
- - Windows 10/11 (x64, ARM64)
210
-
211
114
  ### First Run
212
115
 
213
116
  ```bash
214
117
  # View your usage with the short alias (if available)
215
118
  vct usage
216
119
 
217
- # Or run the binary built by Cargo
218
- ./target/release/vibe_coding_tracker usage
120
+ # Or run the binary built by Cargo/pip
121
+ vibe_coding_tracker usage
219
122
 
220
123
  # Analyze a specific conversation
221
- ./target/release/vibe_coding_tracker analysis --path ~/.claude/projects/session.jsonl
124
+ vibe_coding_tracker analysis --path ~/.claude/projects/session.jsonl
222
125
  ```
223
126
 
224
- > 💡 **Tip**: Use `vct` as a short alias for `vibe_coding_tracker` to save typing—create it manually with `ln -sf ./target/release/vibe_coding_tracker ~/.local/bin/vct` (or any path you prefer).
225
-
226
127
  ---
227
128
 
228
129
  ## 📖 Command Guide
@@ -234,11 +135,11 @@ vct <COMMAND> [OPTIONS]
234
135
  # Replace with `vibe_coding_tracker` if you are using the full binary name
235
136
 
236
137
  Commands:
237
- usage Show token usage and costs (default: interactive)
238
- analysis Analyze conversation files and export data
138
+ analysis Analyze JSONL conversation files (single file or all sessions)
139
+ usage Display token usage statistics
239
140
  version Display version information
240
141
  update Update to the latest version from GitHub releases
241
- help Show help information
142
+ help Print this message or the help of the given subcommand(s)
242
143
  ```
243
144
 
244
145
  ---
@@ -272,155 +173,6 @@ The tool scans these directories automatically:
272
173
  - `~/.copilot/history-session-state/*.json` (Copilot)
273
174
  - `~/.gemini/tmp/<project_hash>/chats/*.json` (Gemini)
274
175
 
275
- ### 🎨 Interactive Mode (Default)
276
-
277
- **Live dashboard that updates every second**
278
-
279
- ```
280
- ┌──────────────────────────────────────────────────────────────────┐
281
- │ 📊 Token Usage Statistics │
282
- └──────────────────────────────────────────────────────────────────┘
283
- ┌────────────┬──────────────────────┬────────────┬────────────┬────────────┬──────────────┬────────────┬────────────┐
284
- │ Date ┆ Model ┆ Input ┆ Output ┆ Cache Read ┆ Cache Create ┆ Total ┆ Cost (USD) │
285
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
286
- │ 2025-10-01 ┆ claude-sonnet-4-20… ┆ 45,230 ┆ 12,450 ┆ 230,500 ┆ 50,000 ┆ 338,180 ┆ $2.15 │
287
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
288
- │ 2025-10-02 ┆ claude-sonnet-4-20… ┆ 32,100 ┆ 8,920 ┆ 180,000 ┆ 30,000 ┆ 251,020 ┆ $1.58 │
289
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
290
- │ 2025-10-03 ┆ claude-sonnet-4-20… ┆ 28,500 ┆ 7,200 ┆ 150,000 ┆ 25,000 ┆ 210,700 ┆ $1.32 │
291
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
292
- │ 2025-10-03 ┆ gpt-4-turbo ┆ 15,000 ┆ 5,000 ┆ 0 ┆ 0 ┆ 20,000 ┆ $0.25 │
293
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
294
- │ ┆ TOTAL ┆ 120,830 ┆ 33,570 ┆ 560,500 ┆ 105,000 ┆ 819,900 ┆ $5.30 │
295
- └────────────┴──────────────────────┴────────────┴────────────┴────────────┴──────────────┴────────────┴────────────┘
296
- ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
297
- │ 💰 Total Cost: $5.30 | 🔢 Total Tokens: 819,900 | 📅 Entries: 4 | ⚡ CPU: 2.3% | 🧠 Memory: 12.5 MB │
298
- └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
299
- ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
300
- │ 📈 Daily Averages │
301
- │ │
302
- │ Claude Code: 266,667 tokens/day | $1.68/day │
303
- │ Codex: 20,000 tokens/day | $0.25/day │
304
- │ Copilot: 15,000 tokens/day | $0.18/day │
305
- │ Overall: 179,090 tokens/day | $1.20/day │
306
- └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
307
-
308
- Press 'q', 'Esc', or 'Ctrl+C' to quit
309
- ```
310
-
311
- **Features**:
312
-
313
- - ✨ Auto-refreshes every second
314
- - 🎯 Highlights today's entries
315
- - 🔄 Shows recently updated rows
316
- - 💾 Displays memory usage
317
- - 📊 Summary statistics
318
- - 📈 Daily averages by provider (Claude Code, Codex, Copilot, Gemini)
319
-
320
- **Controls**: Press `q`, `Esc`, or `Ctrl+C` to exit
321
-
322
- ### 📋 Static Table Mode
323
-
324
- **Perfect for documentation and reports**
325
-
326
- ```bash
327
- vct usage --table
328
- ```
329
-
330
- ```
331
- 📊 Token Usage Statistics
332
-
333
- ┌────────────┬──────────────────────┬────────────┬────────────┬────────────┬──────────────┬──────────────┬────────────┐
334
- │ Date ┆ Model ┆ Input ┆ Output ┆ Cache Read ┆ Cache Create ┆ Total Tokens ┆ Cost (USD) │
335
- ╞════════════╪══════════════════════╪════════════╪════════════╪════════════╪══════════════╪══════════════╪════════════╡
336
- │ 2025-10-01 ┆ claude-sonnet-4-20… ┆ 45,230 ┆ 12,450 ┆ 230,500 ┆ 50,000 ┆ 338,180 ┆ $2.15 │
337
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
338
- │ 2025-10-02 ┆ claude-sonnet-4-20… ┆ 32,100 ┆ 8,920 ┆ 180,000 ┆ 30,000 ┆ 251,020 ┆ $1.58 │
339
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
340
- │ 2025-10-03 ┆ claude-sonnet-4-20… ┆ 28,500 ┆ 7,200 ┆ 150,000 ┆ 25,000 ┆ 210,700 ┆ $1.32 │
341
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
342
- │ 2025-10-03 ┆ gpt-4-turbo ┆ 15,000 ┆ 5,000 ┆ 0 ┆ 0 ┆ 20,000 ┆ $0.25 │
343
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
344
- │ ┆ TOTAL ┆ 120,830 ┆ 33,570 ┆ 560,500 ┆ 105,000 ┆ 819,900 ┆ $5.30 │
345
- └────────────┴──────────────────────┴────────────┴────────────┴────────────┴──────────────┴──────────────┴────────────┘
346
-
347
- 📈 Daily Averages (by Provider)
348
-
349
- ┌─────────────┬────────────────┬──────────────┬──────┐
350
- │ Provider ┆ Avg Tokens/Day ┆ Avg Cost/Day ┆ Days │
351
- ╞═════════════╪════════════════╪══════════════╪══════╡
352
- │ Claude Code ┆ 266,667 ┆ $1.68 ┆ 3 │
353
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
354
- │ Codex ┆ 20,000 ┆ $0.25 ┆ 1 │
355
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
356
- │ Copilot ┆ 15,000 ┆ $0.18 ┆ 1 │
357
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
358
- │ OVERALL ┆ 179,090 ┆ $1.20 ┆ 5 │
359
- └─────────────┴────────────────┴──────────────┴──────┘
360
- ```
361
-
362
- ### 📝 Text Mode
363
-
364
- **Ideal for scripting and parsing**
365
-
366
- ```bash
367
- vct usage --text
368
- ```
369
-
370
- ```
371
- 2025-10-01 > claude-sonnet-4-20250514: $2.154230
372
- 2025-10-02 > claude-sonnet-4-20250514: $1.583450
373
- 2025-10-03 > claude-sonnet-4-20250514: $1.321200
374
- 2025-10-03 > gpt-4-turbo: $0.250000
375
- ```
376
-
377
- ### 🗂️ JSON Mode
378
-
379
- **Full precision for accounting and integration**
380
-
381
- ```bash
382
- vct usage --json
383
- ```
384
-
385
- ```json
386
- {
387
- "2025-10-01": [
388
- {
389
- "model": "claude-sonnet-4-20250514",
390
- "usage": {
391
- "input_tokens": 45230,
392
- "output_tokens": 12450,
393
- "cache_read_input_tokens": 230500,
394
- "cache_creation_input_tokens": 50000,
395
- "cache_creation": {
396
- "ephemeral_5m_input_tokens": 50000
397
- },
398
- "service_tier": "standard"
399
- },
400
- "cost_usd": 2.1542304567890125
401
- }
402
- ]
403
- }
404
- ```
405
-
406
- ### 🔍 Output Comparison
407
-
408
- | Feature | Interactive | Table | Text | JSON |
409
- | --------------- | ----------- | ------- | --------- | ------------------ |
410
- | **Best For** | Monitoring | Reports | Scripts | Integration |
411
- | **Cost Format** | $2.15 | $2.15 | $2.154230 | 2.1542304567890123 |
412
- | **Updates** | Real-time | Static | Static | Static |
413
- | **Colors** | ✅ | ✅ | ❌ | ❌ |
414
- | **Parseable** | ❌ | ❌ | ✅ | ✅ |
415
-
416
- ### 💡 Use Cases
417
-
418
- - **Budget Tracking**: Monitor your daily AI spending
419
- - **Cost Optimization**: Identify expensive sessions
420
- - **Team Reporting**: Generate usage reports for management
421
- - **Billing**: Export precise costs for invoicing
422
- - **Monitoring**: Real-time dashboard for active development
423
-
424
176
  ---
425
177
 
426
178
  ## 📊 Analysis Command
@@ -452,204 +204,6 @@ vct analysis --all
452
204
  vct analysis --all --output grouped_report.json
453
205
  ```
454
206
 
455
- ### What You Get
456
-
457
- **Single File Analysis**:
458
-
459
- - **Token Usage**: Input, output, and cache statistics by model
460
- - **File Operations**: Every read, write, and edit with full details
461
- - **Command History**: All shell commands executed
462
- - **Tool Usage**: Counts of each tool type used
463
- - **Metadata**: User, machine ID, Git repo, timestamps
464
-
465
- **Batch Analysis**:
466
-
467
- - **Aggregated Metrics**: Grouped by date and model
468
- - **Line Counts**: Edit, read, and write operations
469
- - **Tool Statistics**: Bash, Edit, Read, TodoWrite, Write counts
470
- - **Interactive Display**: Real-time TUI table (default)
471
- - **JSON Export**: Structured data for further processing
472
-
473
- ### Sample Output - Single File
474
-
475
- ```json
476
- {
477
- "extensionName": "Claude-Code",
478
- "insightsVersion": "0.1.0",
479
- "user": "wei",
480
- "machineId": "5b0dfa41ada84d5180a514698f67bd80",
481
- "records": [
482
- {
483
- "conversationUsage": {
484
- "claude-sonnet-4-20250514": {
485
- "input_tokens": 252,
486
- "output_tokens": 3921,
487
- "cache_read_input_tokens": 1298818,
488
- "cache_creation_input_tokens": 124169
489
- }
490
- },
491
- "toolCallCounts": {
492
- "Read": 15,
493
- "Write": 4,
494
- "Edit": 2,
495
- "Bash": 5,
496
- "TodoWrite": 3
497
- },
498
- "totalUniqueFiles": 8,
499
- "totalWriteLines": 80,
500
- "totalReadLines": 120,
501
- "folderPath": "/home/wei/repo/project",
502
- "gitRemoteUrl": "https://github.com/user/project.git"
503
- }
504
- ]
505
- }
506
- ```
507
-
508
- ### Sample Output - Batch Analysis
509
-
510
- **Interactive Table** (default when running `vct analysis`):
511
-
512
- ```
513
- ┌──────────────────────────────────────────────────────────────────┐
514
- │ 🔍 Analysis Statistics │
515
- └──────────────────────────────────────────────────────────────────┘
516
- ┌────────────┬────────────────────┬────────────┬────────────┬────────────┬──────┬──────┬──────┬───────────┬───────┐
517
- │ Date ┆ Model ┆ Edit Lines ┆ Read Lines ┆ Write Lines┆ Bash ┆ Edit ┆ Read ┆ TodoWrite ┆ Write │
518
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
519
- │ 2025-10-02 ┆ claude-sonnet-4-5…┆ 901 ┆ 11,525 ┆ 53 ┆ 13 ┆ 26 ┆ 27 ┆ 10 ┆ 1 │
520
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
521
- │ 2025-10-03 ┆ claude-sonnet-4-5…┆ 574 ┆ 10,057 ┆ 1,415 ┆ 53 ┆ 87 ┆ 78 ┆ 30 ┆ 8 │
522
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
523
- │ 2025-10-03 ┆ gpt-5-codex ┆ 0 ┆ 1,323 ┆ 0 ┆ 75 ┆ 0 ┆ 20 ┆ 0 ┆ 0 │
524
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
525
- │ ┆ TOTAL ┆ 1,475 ┆ 22,905 ┆ 1,468 ┆ 141 ┆ 113 ┆ 125 ┆ 40 ┆ 9 │
526
- └────────────┴────────────────────┴────────────┴────────────┴────────────┴──────┴──────┴──────┴───────────┴───────┘
527
- ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
528
- │ 📝 Total Lines: 25,848 | 🔧 Total Tools: 428 | 📅 Entries: 3 | ⚡ CPU: 1.8% | 🧠 Memory: 8.2 MB │
529
- └────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
530
- ┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
531
- │ 📈 Daily Averages (by Provider) │
532
- │ │
533
- │ 🤖 Claude Code: 737 Edit/Day | 10,791 Read/Day | 734 Write/Day | 3 Days │
534
- │ 💻 Codex: 0 Edit/Day | 1,323 Read/Day | 0 Write/Day | 1 Day │
535
- │ ⭐ All Providers: 491 Edit/Day | 7,635 Read/Day | 489 Write/Day | 3 Days │
536
- └────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
537
-
538
- Press 'q', 'Esc', or 'Ctrl+C' to quit
539
- ```
540
-
541
- **Static Table Mode** (with `--table`):
542
-
543
- ```bash
544
- vct analysis --table
545
- ```
546
-
547
- ```
548
- 🔍 Analysis Statistics
549
-
550
- ┌────────────┬────────────────────┬────────────┬────────────┬─────────────┬──────┬───────┬───────┬───────────┬───────┐
551
- │ Date ┆ Model ┆ Edit Lines ┆ Read Lines ┆ Write Lines ┆ Bash ┆ Edit ┆ Read ┆ TodoWrite ┆ Write │
552
- ╞════════════╪════════════════════╪════════════╪════════════╪═════════════╪══════╪═══════╪═══════╪═══════════╪═══════╡
553
- │ 2025-10-02 ┆ claude-sonnet-4-5…┆ 901 ┆ 11,525 ┆ 53 ┆ 13 ┆ 26 ┆ 27 ┆ 10 ┆ 1 │
554
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
555
- │ 2025-10-03 ┆ claude-sonnet-4-5…┆ 574 ┆ 10,057 ┆ 1,415 ┆ 53 ┆ 87 ┆ 78 ┆ 30 ┆ 8 │
556
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
557
- │ 2025-10-03 ┆ gpt-5-codex ┆ 0 ┆ 1,323 ┆ 0 ┆ 75 ┆ 0 ┆ 20 ┆ 0 ┆ 0 │
558
- ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
559
- │ ┆ TOTAL ┆ 1,475 ┆ 22,905 ┆ 1,468 ┆ 141 ┆ 113 ┆ 125 ┆ 40 ┆ 9 │
560
- └────────────┴────────────────────┴────────────┴────────────┴─────────────┴──────┴───────┴───────┴───────────┴───────┘
561
-
562
- 📈 Daily Averages (by Provider)
563
-
564
- ┌──────────────┬───────────┬───────────┬────────────┬──────────┬──────────┬──────────┬──────────┬───────────┬──────┐
565
- │ Provider ┆ EditL/Day ┆ ReadL/Day ┆ WriteL/Day ┆ Bash/Day ┆ Edit/Day ┆ Read/Day ┆ Todo/Day ┆ Write/Day ┆ Days │
566
- ╞══════════════╪═══════════╪═══════════╪════════════╪══════════╪══════════╪══════════╪══════════╪═══════════╪══════╡
567
- │ 🤖 Claude Code ┆ 737.5 ┆ 10,791 ┆ 734 ┆ 33.0 ┆ 56.5 ┆ 52.5 ┆ 20.0 ┆ 4.5 ┆ 2 │
568
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
569
- │ 💻 Codex ┆ 0 ┆ 1,323 ┆ 0 ┆ 75.0 ┆ 0.0 ┆ 20.0 ┆ 0.0 ┆ 0.0 ┆ 1 │
570
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌┤
571
- │ ⭐ All Providers ┆ 491.7 ┆ 7,635 ┆ 489.3 ┆ 47.0 ┆ 37.7 ┆ 41.7 ┆ 13.3 ┆ 3.0 ┆ 3 │
572
- └──────────────┴───────────┴───────────┴────────────┴──────────┴──────────┴──────────┴──────────┴───────────┴──────┘
573
- ```
574
-
575
- **JSON Export** (with `--output`):
576
-
577
- ```json
578
- [
579
- {
580
- "date": "2025-10-02",
581
- "model": "claude-sonnet-4-5-20250929",
582
- "editLines": 901,
583
- "readLines": 11525,
584
- "writeLines": 53,
585
- "bashCount": 13,
586
- "editCount": 26,
587
- "readCount": 27,
588
- "todoWriteCount": 10,
589
- "writeCount": 1
590
- },
591
- {
592
- "date": "2025-10-03",
593
- "model": "claude-sonnet-4-5-20250929",
594
- "editLines": 574,
595
- "readLines": 10057,
596
- "writeLines": 1415,
597
- "bashCount": 53,
598
- "editCount": 87,
599
- "readCount": 78,
600
- "todoWriteCount": 30,
601
- "writeCount": 8
602
- }
603
- ]
604
- ```
605
-
606
- ### 💡 Use Cases
607
-
608
- **Single File Analysis**:
609
-
610
- - **Usage Auditing**: Track what the AI did in each session
611
- - **Cost Attribution**: Calculate costs per project or feature
612
- - **Compliance**: Export detailed activity logs
613
- - **Analysis**: Understand coding patterns and tool usage
614
-
615
- **Batch Analysis**:
616
-
617
- - **Productivity Tracking**: Monitor coding activity over time
618
- - **Tool Usage Patterns**: Identify most-used tools across sessions
619
- - **Model Comparison**: Compare efficiency between different AI models
620
- - **Historical Analysis**: Track trends in code operations by date
621
-
622
- ---
623
-
624
- ## 🔧 Version Command
625
-
626
- **Check your installation.**
627
-
628
- ```bash
629
- # Formatted output
630
- vct version
631
-
632
- # JSON format
633
- vct version --json
634
-
635
- # Plain text
636
- vct version --text
637
- ```
638
-
639
- ### Output
640
-
641
- ```
642
- 🚀 Vibe Coding Tracker
643
-
644
- ┌───────────────┬─────────┐
645
- │ Version ┆ 0.1.0 │
646
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
647
- │ Rust Version ┆ 1.89.0 │
648
- ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
649
- │ Cargo Version ┆ 1.89.0 │
650
- └───────────────┴─────────┘
651
- ```
652
-
653
207
  ---
654
208
 
655
209
  ## 🔄 Update Command
@@ -671,68 +225,6 @@ vct update
671
225
  vct update --force
672
226
  ```
673
227
 
674
- ### ✨ How It Works
675
-
676
- 1. **Check Latest Version**: Fetches the latest release from GitHub API
677
- 2. **Compare Versions**: Compares current version with the latest available (skipped with `--force`)
678
- 3. **Download Binary**: Downloads the appropriate binary for your platform (Linux/macOS/Windows)
679
- 4. **Smart Replacement**:
680
- - **Linux/macOS**: Automatically replaces the binary (backs up old version to `.old`)
681
- - **Windows**: Downloads as `.new` and creates a batch script for safe replacement
682
-
683
- ### 🔄 Force Update Mode
684
-
685
- The `--force` flag bypasses version checking and **always downloads** the latest release:
686
-
687
- ```bash
688
- # Force reinstall the latest version (useful for corrupted installations)
689
- vct update --force
690
- ```
691
-
692
- **Use cases**:
693
-
694
- - Reinstall after corrupted binary
695
- - Force download latest release without version check
696
- - Troubleshooting installation issues
697
-
698
- **Only fails if**: No binary is found for your platform (OS/architecture)
699
-
700
- ### 🎯 Works for All Installation Methods
701
-
702
- Whether you installed via **npm**, **pip**, **cargo**, or **manually**, `vct update` will work the same way:
703
-
704
- ```bash
705
- $ vct update --check
706
- 🔍 Checking for updates...
707
- 📌 Current version: 0.1.6
708
- 📌 Latest version: v0.1.7
709
-
710
- 🆕 New version available: v0.1.7
711
-
712
- 💡 To update, run:
713
- vct update
714
- ```
715
-
716
- **Why does this work?** All installation methods (npm/pip/cargo/manual) use the **same pre-compiled binaries** from GitHub releases. The update command simply downloads the latest binary and replaces your current installation.
717
-
718
- ### Platform Support
719
-
720
- The update command automatically detects your platform and downloads the correct archive:
721
-
722
- - **Linux**: `vibe_coding_tracker-v{version}-linux-x64-gnu.tar.gz`, `vibe_coding_tracker-v{version}-linux-arm64-gnu.tar.gz`
723
- - **macOS**: `vibe_coding_tracker-v{version}-macos-x64.tar.gz`, `vibe_coding_tracker-v{version}-macos-arm64.tar.gz`
724
- - **Windows**: `vibe_coding_tracker-v{version}-windows-x64.zip`, `vibe_coding_tracker-v{version}-windows-arm64.zip`
725
-
726
- ### Windows Update Process
727
-
728
- On Windows, the binary cannot be replaced while running. The update command:
729
-
730
- 1. Downloads the new version as `vct.new`
731
- 2. Creates an update script (`update_vct.bat`)
732
- 3. Displays instructions to complete the update
733
-
734
- Run the batch script after closing the application to finish the update.
735
-
736
228
  ---
737
229
 
738
230
  ## 💡 Smart Pricing System
@@ -754,15 +246,6 @@ Run the batch script after closing the application to finish the update.
754
246
  4. 🎯 **Fuzzy (AI-powered)**: Uses Jaro-Winkler similarity (70% threshold)
755
247
  5. 💵 **Fallback**: Shows $0.00 if no match found
756
248
 
757
- ### Cost Calculation
758
-
759
- ```
760
- Total Cost = (Input Tokens × Input Cost) +
761
- (Output Tokens × Output Cost) +
762
- (Cache Read × Cache Read Cost) +
763
- (Cache Creation × Cache Creation Cost)
764
- ```
765
-
766
249
  ---
767
250
 
768
251
  ## 🐳 Docker Support
@@ -779,125 +262,3 @@ docker run --rm \
779
262
  -v ~/.gemini:/root/.gemini \
780
263
  vibe_coding_tracker:latest usage
781
264
  ```
782
-
783
- ---
784
-
785
- ## 🔍 Troubleshooting
786
-
787
- ### Pricing Data Not Loading
788
-
789
- ```bash
790
- # Check cache
791
- ls -la ~/.vibe_coding_tracker/
792
-
793
- # Force refresh
794
- rm -rf ~/.vibe_coding_tracker/
795
- vct usage
796
-
797
- # Debug mode
798
- RUST_LOG=debug vct usage
799
- ```
800
-
801
- ### No Usage Data Shown
802
-
803
- ```bash
804
- # Verify session directories
805
- ls -la ~/.claude/projects/
806
- ls -la ~/.codex/sessions/
807
- ls -la ~/.copilot/sessions/
808
- ls -la ~/.gemini/tmp/
809
-
810
- # Count session files
811
- find ~/.claude/projects -name "*.jsonl" | wc -l
812
- find ~/.codex/sessions -name "*.jsonl" | wc -l
813
- find ~/.copilot/sessions -name "*.json" | wc -l
814
- find ~/.gemini/tmp -name "*.json" | wc -l
815
- ```
816
-
817
- ### Analysis Command Fails
818
-
819
- ```bash
820
- # Validate JSONL format
821
- jq empty < your-file.jsonl
822
-
823
- # Check file permissions
824
- ls -la your-file.jsonl
825
-
826
- # Run with debug output
827
- RUST_LOG=debug vct analysis --path your-file.jsonl
828
- ```
829
-
830
- ### Interactive Mode Issues
831
-
832
- ```bash
833
- # Reset terminal if broken
834
- reset
835
-
836
- # Check terminal type
837
- echo $TERM # Should be xterm-256color or compatible
838
-
839
- # Use static table as fallback
840
- vct usage --table
841
- ```
842
-
843
- ---
844
-
845
- ## ⚡ Performance
846
-
847
- Built with Rust for **speed** and **reliability**:
848
-
849
- | Operation | Time |
850
- | ------------------- | ------ |
851
- | Parse 10MB JSONL | ~320ms |
852
- | Analyze 1000 events | ~45ms |
853
- | Load cached pricing | ~2ms |
854
- | Interactive refresh | ~30ms |
855
-
856
- **Binary Size**: ~3-5 MB (stripped)
857
-
858
- ---
859
-
860
- ## 📚 Learn More
861
-
862
- - **Developer Docs**: See [.github/copilot-instructions.md](.github/copilot-instructions.md)
863
- - **Report Issues**: [GitHub Issues](https://github.com/Mai0313/VibeCodingTracker/issues)
864
- - **Source Code**: [GitHub Repository](https://github.com/Mai0313/VibeCodingTracker)
865
-
866
- ---
867
-
868
- ## 🤝 Contributing
869
-
870
- Contributions welcome! Here's how:
871
-
872
- 1. Fork the repository
873
- 2. Create your feature branch
874
- 3. Make your changes
875
- 4. Submit a pull request
876
-
877
- For development setup and guidelines, see [.github/copilot-instructions.md](.github/copilot-instructions.md).
878
-
879
- ---
880
-
881
- ## 📄 License
882
-
883
- MIT License - see [LICENSE](LICENSE) for details.
884
-
885
- ---
886
-
887
- ## 🙏 Credits
888
-
889
- - [LiteLLM](https://github.com/BerriAI/litellm) for model pricing data
890
- - Claude Code, Codex, Copilot, and Gemini teams for creating amazing AI coding assistants
891
- - The Rust community for excellent tooling
892
-
893
- ---
894
-
895
- <center>
896
-
897
- **Save money. Track usage. Code smarter.**
898
-
899
- [⭐ Star this project](https://github.com/Mai0313/VibeCodingTracker) if you find it useful!
900
-
901
- Made with 🦀 Rust
902
-
903
- </center>
@@ -0,0 +1,264 @@
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 是一个强大的 CLI 工具,帮助您监控和分析 Claude Code、Codex、Copilot 和 Gemini 的使用情况,提供详细的成本分解、token 统计和代码操作洞察。
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
+ 选择您偏好的视图:
37
+
38
+ - **交互式仪表板**:自动刷新的终端 UI,实时更新
39
+ - **静态报表**:专业的表格,适合文档
40
+ - **脚本友好**:纯文本和 JSON,便于自动化
41
+ - **全精度**:导出精确成本,用于财务核算
42
+
43
+ ### 🚀 零配置
44
+
45
+ 自动检测并处理 Claude Code、Codex、Copilot 和 Gemini 的日志。无需设置——只需运行和分析。
46
+
47
+ ### 🎨 丰富的洞察
48
+
49
+ - 按模型和日期的 token 使用量
50
+ - 按缓存类型的成本分解
51
+ - 文件操作追踪
52
+ - 命令执行历史
53
+ - Git 仓库信息
54
+
55
+ ---
56
+
57
+ ## ✨ 核心特性
58
+
59
+ | 特性 | 描述 |
60
+ | ------------------- | --------------------------------------------------- |
61
+ | 🤖 **自动检测** | 智能识别 Claude Code、Codex、Copilot 或 Gemini 日志 |
62
+ | 💵 **智能定价** | 模糊模型匹配 + 每日缓存以提高速度 |
63
+ | 🎨 **4 种显示模式** | 交互式、表格、文本和 JSON 输出 |
64
+ | 📈 **全面统计** | Token、成本、文件操作和工具调用 |
65
+ | ⚡ **高性能** | 使用 Rust 构建,速度快且可靠 |
66
+ | 🔄 **实时更新** | 仪表板每秒刷新 |
67
+ | 💾 **高效缓存** | 智能的每日缓存减少 API 调用 |
68
+
69
+ ---
70
+
71
+ ## 🚀 快速开始
72
+
73
+ ### 安装
74
+
75
+ 选择最适合您的安装方式:
76
+
77
+ > 👨‍💻 **开发者**:如果您想从源码构建或参与开发,请参阅 [CONTRIBUTING.md](CONTRIBUTING.md)。
78
+
79
+ #### 方式 1: 从 npm 安装
80
+
81
+ **前置条件**: [Node.js](https://nodejs.org/) v22 或更高版本
82
+
83
+ 选择以下任一包名称(三者完全相同):
84
+
85
+ ```bash
86
+ # 主要包
87
+ npm install -g vibe-coding-tracker
88
+
89
+ # 带 scope 的短别名
90
+ npm install -g @mai0313/vct
91
+
92
+ # 带 scope 的完整名称
93
+ npm install -g @mai0313/vibe-coding-tracker
94
+ ```
95
+
96
+ #### 方式 2: 从 PyPI 安装
97
+
98
+ **前置条件**: Python 3.8 或更高版本
99
+
100
+ ```bash
101
+ pip install vibe_coding_tracker
102
+ # 或使用 uv
103
+ uv pip install vibe_coding_tracker
104
+ ```
105
+
106
+ #### 方式 3: 从 crates.io 安装
107
+
108
+ 使用 Cargo 从 Rust 官方包注册表安装:
109
+
110
+ ```bash
111
+ cargo install vibe_coding_tracker
112
+ ```
113
+
114
+ ### 首次运行
115
+
116
+ ```bash
117
+ # 使用交互式仪表板查看使用量(已设置短别名时)
118
+ vct usage
119
+
120
+ # 或使用完整名称
121
+ vibe_coding_tracker usage
122
+
123
+ # 分析特定对话
124
+ vibe_coding_tracker analysis --path ~/.claude/projects/session.jsonl
125
+ ```
126
+
127
+ ---
128
+
129
+ ## 📖 命令指南
130
+
131
+ ### 🔍 快速参考
132
+
133
+ ```bash
134
+ vct <命令 >[选项]
135
+ # 若未设置别名,请改用 `vibe_coding_tracker` 完整二进制名称
136
+
137
+ 命令:
138
+ analysis 分析对话文件并导出数据(支持单文件或所有会话)
139
+ usage 显示 token 使用量统计
140
+ version 显示版本信息
141
+ update 从 GitHub releases 更新到最新版本
142
+ help 显示此信息或给定子命令的说明
143
+ ```
144
+
145
+ ---
146
+
147
+ ## 💰 Usage 命令
148
+
149
+ **追踪您所有 AI 编程会话的支出。**
150
+
151
+ ### 基本用法
152
+
153
+ ```bash
154
+ # 交互式仪表板(推荐)
155
+ vct usage
156
+
157
+ # 静态表格,适合报表
158
+ vct usage --table
159
+
160
+ # 纯文本,适合脚本
161
+ vct usage --text
162
+
163
+ # JSON,适合数据处理
164
+ vct usage --json
165
+ ```
166
+
167
+ ### 您将获得什么
168
+
169
+ 该工具自动扫描这些目录:
170
+
171
+ - `~/.claude/projects/*.jsonl`(Claude Code)
172
+ - `~/.codex/sessions/*.jsonl`(Codex)
173
+ - `~/.copilot/history-session-state/*.json`(Copilot)
174
+ - `~/.gemini/tmp/<project_hash>/chats/*.json`(Gemini)
175
+
176
+ ---
177
+
178
+ ## 📊 Analysis 命令
179
+
180
+ **深入了解对话文件 - 单文件或批量分析。**
181
+
182
+ ### 基本用法
183
+
184
+ ```bash
185
+ # 单文件:分析并显示
186
+ vct analysis --path ~/.claude/projects/session.jsonl
187
+
188
+ # 单文件:保存到文件
189
+ vct analysis --path ~/.claude/projects/session.jsonl --output report.json
190
+
191
+ # 批量:使用交互式表格分析所有会话(默认)
192
+ vct analysis
193
+
194
+ # 批量:静态表格输出并显示每日平均
195
+ vct analysis --table
196
+
197
+ # 批量:将汇总结果保存为 JSON
198
+ vct analysis --output batch_report.json
199
+
200
+ # 批量并依提供者分组:输出完整的 records,依提供者分组(JSON 格式)
201
+ vct analysis --all
202
+
203
+ # 将分组结果保存到文件
204
+ vct analysis --all --output grouped_report.json
205
+ ```
206
+
207
+ ---
208
+
209
+ ## 🔄 Update 命令
210
+
211
+ **自动保持安装版本为最新。**
212
+
213
+ update 命令适用于**所有安装方式**(npm/pip/cargo/manual),直接从 GitHub releases 下载并替换二进制文件。
214
+
215
+ ### 基本用法
216
+
217
+ ```bash
218
+ # 检查更新
219
+ vct update --check
220
+
221
+ # 交互式更新(会询问确认)
222
+ vct update
223
+
224
+ # 强制更新 - 总是下载最新版本(即使已是最新版本)
225
+ vct update --force
226
+ ```
227
+
228
+ ---
229
+
230
+ ## 💡 智能定价系统
231
+
232
+ ### 运作原理
233
+
234
+ 1. **自动更新**:每天从 [LiteLLM](https://github.com/BerriAI/litellm) 获取定价
235
+ 2. **智能缓存**:在 `~/.vibe_coding_tracker/` 中存储定价 24 小时
236
+ 3. **模糊匹配**:即使对于自定义模型名称也能找到最佳匹配
237
+ 4. **始终准确**:确保您获取最新的定价
238
+
239
+ ### 模型匹配
240
+
241
+ **优先顺序**:
242
+
243
+ 1. ✅ **精确匹配**:`claude-sonnet-4` → `claude-sonnet-4`
244
+ 2. 🔄 **规范化**:`claude-sonnet-4-20250514` → `claude-sonnet-4`
245
+ 3. 🔍 **子字符串**:`custom-gpt-4` → `gpt-4`
246
+ 4. 🎯 **模糊(AI 驱动)**:使用 Jaro-Winkler 相似度(70% 阈值)
247
+ 5. 💵 **后备**:如果找不到匹配则显示 $0.00
248
+
249
+ ---
250
+
251
+ ## 🐳 Docker 支持
252
+
253
+ ```bash
254
+ # 构建镜像
255
+ docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
256
+
257
+ # 使用您的会话运行
258
+ docker run --rm \
259
+ -v ~/.claude:/root/.claude \
260
+ -v ~/.codex:/root/.codex \
261
+ -v ~/.copilot:/root/.copilot \
262
+ -v ~/.gemini:/root/.gemini \
263
+ vibe_coding_tracker:latest usage
264
+ ```
@@ -0,0 +1,264 @@
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 是一個強大的 CLI 工具,幫助您監控和分析 Claude Code、Codex、Copilot 和 Gemini 的使用情況,提供詳細的成本分解、token 統計和程式碼操作洞察。
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
+ 選擇您偏好的檢視:
37
+
38
+ - **互動式儀表板**:自動重新整理的終端 UI,即時更新
39
+ - **靜態報表**:專業的表格,適合文件
40
+ - **指令碼友善**:純文字和 JSON,便於自動化
41
+ - **完整精度**:匯出精確成本,用於財務核算
42
+
43
+ ### 🚀 零設定
44
+
45
+ 自動偵測並處理 Claude Code、Codex、Copilot 和 Gemini 的日誌。無需設定——只需執行和分析。
46
+
47
+ ### 🎨 豐富的洞察
48
+
49
+ - 按模型和日期的 token 使用量
50
+ - 按快取類型的成本分解
51
+ - 檔案操作追蹤
52
+ - 命令執行歷史
53
+ - Git 儲存庫資訊
54
+
55
+ ---
56
+
57
+ ## ✨ 核心特性
58
+
59
+ | 特性 | 描述 |
60
+ | ------------------- | --------------------------------------------------- |
61
+ | 🤖 **自動偵測** | 智慧識別 Claude Code、Codex、Copilot 或 Gemini 日誌 |
62
+ | 💵 **智慧定價** | 模糊模型匹配 + 每日快取以提高速度 |
63
+ | 🎨 **4 種顯示模式** | 互動式、表格、文字和 JSON 輸出 |
64
+ | 📈 **全面統計** | Token、成本、檔案操作和工具呼叫 |
65
+ | ⚡ **高效能** | 使用 Rust 建置,速度快且可靠 |
66
+ | 🔄 **即時更新** | 儀表板每秒重新整理 |
67
+ | 💾 **高效快取** | 智慧的每日快取減少 API 呼叫 |
68
+
69
+ ---
70
+
71
+ ## 🚀 快速開始
72
+
73
+ ### 安裝
74
+
75
+ 選擇最適合您的安裝方式:
76
+
77
+ > 👨‍💻 **開發者**:如果您想從原始碼建置或貢獻開發,請參閱 [CONTRIBUTING.md](CONTRIBUTING.md)。
78
+
79
+ #### 方式 1: 從 npm 安裝
80
+
81
+ **前置條件**: [Node.js](https://nodejs.org/) v22 或更高版本
82
+
83
+ 選擇以下任一套件名稱(三者完全相同):
84
+
85
+ ```bash
86
+ # 主要套件
87
+ npm install -g vibe-coding-tracker
88
+
89
+ # 帶 scope 的短別名
90
+ npm install -g @mai0313/vct
91
+
92
+ # 帶 scope 的完整名稱
93
+ npm install -g @mai0313/vibe-coding-tracker
94
+ ```
95
+
96
+ #### 方式 2: 從 PyPI 安裝
97
+
98
+ **前置條件**: Python 3.8 或更高版本
99
+
100
+ ```bash
101
+ pip install vibe_coding_tracker
102
+ # 或使用 uv
103
+ uv pip install vibe_coding_tracker
104
+ ```
105
+
106
+ #### 方式 3: 從 crates.io 安裝
107
+
108
+ 使用 Cargo 從 Rust 官方套件庫安裝:
109
+
110
+ ```bash
111
+ cargo install vibe_coding_tracker
112
+ ```
113
+
114
+ ### 首次執行
115
+
116
+ ```bash
117
+ # 使用互動式儀表板檢視使用量(已設定短別名時)
118
+ vct usage
119
+
120
+ # 或使用完整名稱
121
+ vibe_coding_tracker usage
122
+
123
+ # 分析特定對話
124
+ vibe_coding_tracker analysis --path ~/.claude/projects/session.jsonl
125
+ ```
126
+
127
+ ---
128
+
129
+ ## 📖 命令指南
130
+
131
+ ### 🔍 快速參考
132
+
133
+ ```bash
134
+ vct <命令 >[選項]
135
+ # 若未設定別名,請改用 `vibe_coding_tracker`完整二進位名稱
136
+
137
+ 命令:
138
+ analysis 分析對話檔案並匯出資料(支援單檔案或所有會話)
139
+ usage 顯示 token 使用量統計
140
+ version 顯示版本資訊
141
+ update 從 GitHub releases 更新到最新版本
142
+ help 顯示此訊息或給定子命令的說明
143
+ ```
144
+
145
+ ---
146
+
147
+ ## 💰 Usage 命令
148
+
149
+ **追蹤您所有 AI 程式設計會話的支出。**
150
+
151
+ ### 基本用法
152
+
153
+ ```bash
154
+ # 互動式儀表板(推薦)
155
+ vct usage
156
+
157
+ # 靜態表格,適合報表
158
+ vct usage --table
159
+
160
+ # 純文字,適合指令碼
161
+ vct usage --text
162
+
163
+ # JSON,適合資料處理
164
+ vct usage --json
165
+ ```
166
+
167
+ ### 您將獲得什麼
168
+
169
+ 該工具自動掃描這些目錄:
170
+
171
+ - `~/.claude/projects/*.jsonl`(Claude Code)
172
+ - `~/.codex/sessions/*.jsonl`(Codex)
173
+ - `~/.copilot/history-session-state/*.json`(Copilot)
174
+ - `~/.gemini/tmp/<project_hash>/chats/*.json`(Gemini)
175
+
176
+ ---
177
+
178
+ ## 📊 Analysis 命令
179
+
180
+ **深入了解對話檔案 - 單檔案或批次分析。**
181
+
182
+ ### 基本用法
183
+
184
+ ```bash
185
+ # 單檔案:分析並顯示
186
+ vct analysis --path ~/.claude/projects/session.jsonl
187
+
188
+ # 單檔案:儲存到檔案
189
+ vct analysis --path ~/.claude/projects/session.jsonl --output report.json
190
+
191
+ # 批次:使用互動式表格分析所有會話(預設)
192
+ vct analysis
193
+
194
+ # 批次:靜態表格輸出並顯示每日平均
195
+ vct analysis --table
196
+
197
+ # 批次:將彙總結果儲存為 JSON
198
+ vct analysis --output batch_report.json
199
+
200
+ # 批次並依提供者分組:輸出完整的 records,依提供者分組(JSON 格式)
201
+ vct analysis --all
202
+
203
+ # 將分組結果儲存到檔案
204
+ vct analysis --all --output grouped_report.json
205
+ ```
206
+
207
+ ---
208
+
209
+ ## 🔄 Update 命令
210
+
211
+ **自動保持安裝版本為最新。**
212
+
213
+ update 命令適用於**所有安裝方式**(npm/pip/cargo/manual),直接從 GitHub releases 下載並替換二進位檔。
214
+
215
+ ### 基本用法
216
+
217
+ ```bash
218
+ # 檢查更新
219
+ vct update --check
220
+
221
+ # 互動式更新(會詢問確認)
222
+ vct update
223
+
224
+ # 強制更新 - 總是下載最新版本(即使已是最新版本)
225
+ vct update --force
226
+ ```
227
+
228
+ ---
229
+
230
+ ## 💡 智慧定價系統
231
+
232
+ ### 運作原理
233
+
234
+ 1. **自動更新**:每天從 [LiteLLM](https://github.com/BerriAI/litellm) 取得定價
235
+ 2. **智慧快取**:在 `~/.vibe_coding_tracker/` 中儲存定價 24 小時
236
+ 3. **模糊匹配**:即使對於自訂模型名稱也能找到最佳匹配
237
+ 4. **始終準確**:確保您取得最新的定價
238
+
239
+ ### 模型匹配
240
+
241
+ **優先順序**:
242
+
243
+ 1. ✅ **精確匹配**:`claude-sonnet-4` → `claude-sonnet-4`
244
+ 2. 🔄 **規範化**:`claude-sonnet-4-20250514` → `claude-sonnet-4`
245
+ 3. 🔍 **子字串**:`custom-gpt-4` → `gpt-4`
246
+ 4. 🎯 **模糊(AI 驅動)**:使用 Jaro-Winkler 相似度(70% 閾值)
247
+ 5. 💵 **後備**:如果找不到匹配則顯示 $0.00
248
+
249
+ ---
250
+
251
+ ## 🐳 Docker 支援
252
+
253
+ ```bash
254
+ # 建置映像
255
+ docker build -f docker/Dockerfile --target prod -t vibe_coding_tracker:latest .
256
+
257
+ # 使用您的會話執行
258
+ docker run --rm \
259
+ -v ~/.claude:/root/.claude \
260
+ -v ~/.codex:/root/.codex \
261
+ -v ~/.copilot:/root/.copilot \
262
+ -v ~/.gemini:/root/.gemini \
263
+ vibe_coding_tracker:latest usage
264
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mai0313/vct",
3
- "version": "0.5.8",
3
+ "version": "0.5.11",
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",