token-usage-insights 0.9.0 → 0.9.2
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.en.md +67 -8
- package/README.ja.md +67 -8
- package/README.ko.md +67 -8
- package/README.md +67 -8
- package/README.zh-CN.md +67 -8
- package/package.json +2 -2
package/README.en.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Token War Room
|
|
2
2
|
|
|
3
|
-
**Token War Room is a local-first dashboard for AI coding-agent token usage and session reconstruction.** It reads local records from Google Antigravity CLI, GitHub Copilot CLI, GitHub Copilot Chat (VS Code), Codex Desktop, Codex CLI, Claude Code, Grok Build, Pi Coding Agent, and
|
|
3
|
+
**Token War Room is a local-first dashboard for AI coding-agent token usage and session reconstruction.** It reads local records from Google Antigravity CLI, GitHub Copilot CLI, GitHub Copilot App, GitHub Copilot Chat (VS Code), Codex Desktop, Codex CLI, Claude Code, Cursor, Grok Build, Pi Coding Agent, OMP, and Muse Code, presenting daily, monthly, and yearly token consumption, cache usage, reasoning tokens, estimated costs, model distribution, project-directory distribution, and complete session timelines in one place.
|
|
4
4
|
|
|
5
5
|
This project does not call AI provider APIs on your behalf. Its core data sources are local logs, Status Line collector files, and local SQLite.
|
|
6
6
|
|
|
@@ -48,14 +48,17 @@ http://localhost:3003
|
|
|
48
48
|
| --- | --- | --- | --- |
|
|
49
49
|
| Google Antigravity CLI | Required | `~/.gemini/antigravity-cli/usage/usage-YYYY-MM-DD.jsonl` | Collects token data through `statusline-token.sh` or the Windows `statusline-token.ps1` |
|
|
50
50
|
| GitHub Copilot CLI | Required | `~/.copilot/usage/usage-YYYY-MM-DD.jsonl` | Collects token data through `statusline-token.sh` or the Windows `statusline-token.ps1` |
|
|
51
|
+
| GitHub Copilot App | Not required | `~/.copilot/data.db`, `~/.copilot/session-store.db` | The dashboard reads the desktop app's local SQLite databases directly |
|
|
51
52
|
| GitHub Copilot Chat (VS Code) | Not required | VS Code `workspaceStorage/chatSessions` | The dashboard scans local chat sessions from VS Code Stable and Insiders directly |
|
|
52
53
|
| Codex Desktop / CLI | Not required | `~/.codex/sessions`, `~/.codex/archived_sessions` | The dashboard scans active and archived local Codex sessions directly |
|
|
53
54
|
| Claude Code | Not required | `~/.claude/projects` | The dashboard scans local Claude Code project sessions directly |
|
|
55
|
+
| Cursor | Not required | `~/.cursor/projects` | The dashboard scans local Cursor transcripts and reads attributable model metadata in read-only mode |
|
|
54
56
|
| Grok Build | Not required | `~/.grok/sessions` | The dashboard scans the `updates.jsonl` session streams saved automatically by Grok Build |
|
|
55
57
|
| Pi Coding Agent | Not required | `~/.pi/agent/sessions` | The dashboard scans the local session JSONL files saved automatically by Pi Coding Agent |
|
|
56
58
|
| OMP | Not required | `~/.omp/agent/sessions` | The dashboard scans the local session JSONL files saved automatically by OMP |
|
|
59
|
+
| Muse Code | Not required | `~/.local/share/muse/sessions` | The dashboard scans the local session JSONL files saved automatically by Muse Code |
|
|
57
60
|
|
|
58
|
-
**If you only use VS Code Copilot, Codex Desktop, Codex CLI, Claude Code, Grok Build, Pi Coding Agent, or
|
|
61
|
+
**If you only use Copilot App, VS Code Copilot, Codex Desktop, Codex CLI, Claude Code, Cursor, Grok Build, Pi Coding Agent, OMP, or Muse Code, run the one-line installation command and open the dashboard.**
|
|
59
62
|
|
|
60
63
|
### Native Windows usage
|
|
61
64
|
|
|
@@ -74,6 +77,7 @@ Windows uses the following native paths by default:
|
|
|
74
77
|
| Grok Build | `%USERPROFILE%\.grok` |
|
|
75
78
|
| Pi Coding Agent | `%USERPROFILE%\.pi` |
|
|
76
79
|
| OMP | `%USERPROFILE%\.omp` |
|
|
80
|
+
| Muse Code | `%USERPROFILE%\.local\share\muse` |
|
|
77
81
|
|
|
78
82
|
The dashboard's setup guide shows PowerShell copy, configuration, and diagnostic commands on Windows. The PowerShell collector uses .NET JSON and file APIs and does not depend on Bash, `jq`, `sed`, or `awk`.
|
|
79
83
|
|
|
@@ -105,13 +109,13 @@ Drive letters, paths containing spaces or non-ASCII characters, and UNC paths ar
|
|
|
105
109
|
|
|
106
110
|
### Interface
|
|
107
111
|
|
|
108
|
-
- Switch between
|
|
112
|
+
- Switch between nine coding-agent badges
|
|
109
113
|
- Daily, monthly, and yearly views
|
|
110
114
|
- Quick date, month, and year switching
|
|
111
115
|
- Automatic live refresh every 5, 10, or 30 seconds
|
|
112
116
|
- Manually sync local logs to SQLite
|
|
113
117
|
- Dark and light themes
|
|
114
|
-
- Traditional Chinese
|
|
118
|
+
- Traditional Chinese, Simplified Chinese, English, Japanese, and Korean interface
|
|
115
119
|
- Model pricing table viewer
|
|
116
120
|
|
|
117
121
|
* * *
|
|
@@ -122,7 +126,7 @@ The dashboard supports URL query parameters for opening a specific state directl
|
|
|
122
126
|
|
|
123
127
|
| Parameter | Applies to | Values | Description |
|
|
124
128
|
| --- | --- | --- | --- |
|
|
125
|
-
| `agent` | All views | `antigravity`, `copilot`, `codex`, `claude`, `cursor`, `grok`, `pi`, `omp` | Selects the coding agent to display. Aliases such as `claude-code`, `grok-build`,
|
|
129
|
+
| `agent` | All views | `antigravity`, `copilot`, `codex`, `claude`, `cursor`, `grok`, `pi`, `omp`, `muse` | Selects the coding agent to display. Aliases such as `claude-code`, `grok-build`, `pi-coding-agent`, `oh-my-pi`, and `muse-code` are also supported |
|
|
126
130
|
| `tab` | All views | `daily`, `monthly`, `yearly` | Selects the daily, monthly, or yearly view |
|
|
127
131
|
| `date` | All views | `daily`: `YYYY-MM-DD`; `monthly`: `YYYY-MM`; `yearly`: `YYYY` | Selects the date, month, or year to display; the format follows `tab` automatically |
|
|
128
132
|
| `dir` | `daily` | Full path, `~`-prefixed home path, or a unique path suffix (e.g. `TokenUsageInsights`) | Filters the daily view by working directory. Windows paths are case-insensitive; if no directory matches, all directories are shown |
|
|
@@ -343,6 +347,27 @@ Notes:
|
|
|
343
347
|
|
|
344
348
|
* * *
|
|
345
349
|
|
|
350
|
+
## Cursor setup
|
|
351
|
+
|
|
352
|
+
**Cursor requires no hooks, a Status Line, or an additional collector script.** The dashboard scans this directory directly:
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
~/.cursor/projects
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Cursor stores conversation and Agent transcripts under its project directories. The dashboard also scans the platform-default `Cursor/User/globalStorage/state.vscdb` in read-only mode and uses its `agentKv` records to attribute actual models; sessions that cannot be matched uniquely remain `Unknown Model`.
|
|
359
|
+
|
|
360
|
+
Usage:
|
|
361
|
+
|
|
362
|
+
1. Create at least one conversation or Agent session in Cursor.
|
|
363
|
+
2. Start or refresh the dashboard.
|
|
364
|
+
3. Select Cursor on the left.
|
|
365
|
+
4. Click the sync button in the upper-right corner, or wait for background sync.
|
|
366
|
+
|
|
367
|
+
Cursor's local data does not contain exact token counts or official billing details, so tokens are estimated from text content. Costs are estimated only when `pricing.csv` contains the matching model and do not represent the official bill. Use `CURSOR_DIR` and `CURSOR_STATE_DB` for non-default locations.
|
|
368
|
+
|
|
369
|
+
* * *
|
|
370
|
+
|
|
346
371
|
## Grok Build setup
|
|
347
372
|
|
|
348
373
|
**Grok Build requires no hooks, a Status Line, or an additional collector script.** The dashboard scans this directory directly:
|
|
@@ -408,6 +433,27 @@ OMP cost is always read directly from each session's own per-turn `usage.cost` a
|
|
|
408
433
|
|
|
409
434
|
* * *
|
|
410
435
|
|
|
436
|
+
## Muse Code setup
|
|
437
|
+
|
|
438
|
+
**Muse Code requires no hooks, a Status Line, or an additional collector script.** The dashboard scans this directory directly:
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
~/.local/share/muse/sessions
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Muse Code stores sessions as `session.jsonl` files grouped by date and session ID. The dashboard parses model-completion events to separate input, cache-read, output, and reasoning tokens, and reconstructs a timeline of user prompts, tool steps, and Agent replies.
|
|
445
|
+
|
|
446
|
+
Usage:
|
|
447
|
+
|
|
448
|
+
1. Use Muse Code normally to create at least one session.
|
|
449
|
+
2. Start or refresh the dashboard.
|
|
450
|
+
3. Select Muse Code on the left.
|
|
451
|
+
4. Click the sync button in the upper-right corner, or wait for background sync.
|
|
452
|
+
|
|
453
|
+
Muse Code costs are estimated from the model reported by the session and `pricing.csv`. If the data is not in the default location, set `MUSE_DIR` to the Muse Code data directory that contains `sessions`.
|
|
454
|
+
|
|
455
|
+
* * *
|
|
456
|
+
|
|
411
457
|
## Local data synchronization
|
|
412
458
|
|
|
413
459
|
When the service starts, the backend initializes local SQLite and performs an immediate data sync. After startup, it also syncs in the background every 5 seconds.
|
|
@@ -430,9 +476,9 @@ This triggers a full incremental sync of local logs.
|
|
|
430
476
|
|
|
431
477
|
**For normal use, use the export and import buttons in the upper-right corner of the dashboard.** The installed version needs only a browser to aggregate data across machines and supports import files up to 200 MB.
|
|
432
478
|
|
|
433
|
-
|
|
479
|
+
Starting with v0.9.0, the dashboard and CLI share the `token-usage-insights` executable. Run it without arguments to start the dashboard, or use `export`, `export-all`, or `import`. The main command and subcommands support `--help` and `-h`; older installations need an update or a source build.
|
|
434
480
|
|
|
435
|
-
`--agent` specifies the assistant (`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp`).
|
|
481
|
+
`--agent` specifies the assistant (`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp` / `muse`).
|
|
436
482
|
|
|
437
483
|
### Use the CLI from source
|
|
438
484
|
|
|
@@ -492,6 +538,7 @@ Paths specified by environment variables are authoritative and do not need to be
|
|
|
492
538
|
| `GROK_DIR` | `~/.grok` | Grok Build data directory |
|
|
493
539
|
| `PI_DIR` | `~/.pi` | Pi Coding Agent data directory |
|
|
494
540
|
| `OMP_DIR` | `~/.omp` | OMP data directory |
|
|
541
|
+
| `MUSE_DIR` | `~/.local/share/muse` | Muse Code data directory; should contain `sessions` |
|
|
495
542
|
| `CORS_ALLOWED_ORIGINS` | `http://localhost:<PORT>,http://127.0.0.1:<PORT>` | Comma-separated allowed CORS origins |
|
|
496
543
|
|
|
497
544
|
> **The default binding is `0.0.0.0`, so other devices on the same local network may connect to the dashboard. For local-only browsing, set `HOST` to `127.0.0.1`.**
|
|
@@ -567,7 +614,7 @@ Environment variables can control the version and installation paths (all option
|
|
|
567
614
|
|
|
568
615
|
| Variable | Platforms | Description |
|
|
569
616
|
| --- | --- | --- |
|
|
570
|
-
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | Release tag to install, such as `v0.
|
|
617
|
+
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | Release tag to install, such as `v0.9.2`; defaults to `latest` |
|
|
571
618
|
| `TOKEN_USAGE_INSIGHTS_INSTALL_DIR` | Linux / macOS | Installation directory, passed to `install.sh` |
|
|
572
619
|
| `TOKEN_USAGE_INSIGHTS_BIN_DIR` | Linux / macOS | Executable-link directory, passed to `install.sh` |
|
|
573
620
|
|
|
@@ -677,9 +724,15 @@ Check whether the data source exists for each tool:
|
|
|
677
724
|
```bash
|
|
678
725
|
ls ~/.gemini/antigravity-cli/usage
|
|
679
726
|
ls ~/.copilot/usage
|
|
727
|
+
ls ~/.copilot/data.db ~/.copilot/session-store.db
|
|
680
728
|
ls ~/.codex/sessions
|
|
681
729
|
ls ~/.codex/archived_sessions
|
|
682
730
|
ls ~/.claude/projects
|
|
731
|
+
ls ~/.cursor/projects
|
|
732
|
+
ls ~/.grok/sessions
|
|
733
|
+
ls ~/.pi/agent/sessions
|
|
734
|
+
ls ~/.omp/agent/sessions
|
|
735
|
+
ls ~/.local/share/muse/sessions
|
|
683
736
|
```
|
|
684
737
|
|
|
685
738
|
Antigravity CLI and Copilot CLI also require `settings.json` to define `statusLine` and the scripts to have execute permission.
|
|
@@ -689,9 +742,15 @@ On Windows PowerShell, inspect the native data directories directly:
|
|
|
689
742
|
```powershell
|
|
690
743
|
Get-ChildItem "$env:USERPROFILE\.gemini\antigravity-cli\usage"
|
|
691
744
|
Get-ChildItem "$env:USERPROFILE\.copilot\usage"
|
|
745
|
+
Get-ChildItem "$env:USERPROFILE\.copilot\data.db", "$env:USERPROFILE\.copilot\session-store.db"
|
|
692
746
|
Get-ChildItem "$env:USERPROFILE\.codex\sessions"
|
|
693
747
|
Get-ChildItem "$env:USERPROFILE\.codex\archived_sessions"
|
|
694
748
|
Get-ChildItem "$env:USERPROFILE\.claude\projects"
|
|
749
|
+
Get-ChildItem "$env:USERPROFILE\.cursor\projects"
|
|
750
|
+
Get-ChildItem "$env:USERPROFILE\.grok\sessions"
|
|
751
|
+
Get-ChildItem "$env:USERPROFILE\.pi\agent\sessions"
|
|
752
|
+
Get-ChildItem "$env:USERPROFILE\.omp\agent\sessions"
|
|
753
|
+
Get-ChildItem "$env:USERPROFILE\.local\share\muse\sessions"
|
|
695
754
|
```
|
|
696
755
|
|
|
697
756
|
### Status Line script cannot run
|
package/README.ja.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Token 戦情室
|
|
2
2
|
|
|
3
|
-
**Token 戦情室は、ローカル優先の AI Coding Agent の Token 使用量とセッション復元ダッシュボードです。** Google Antigravity CLI、GitHub Copilot CLI、GitHub Copilot Chat(VS Code)、Codex Desktop、Codex CLI、Claude Code、Grok Build、Pi Coding Agent、OMP のローカル記録を読み取り、日別・月別・年別の Token 消費量、キャッシュ使用量、推論 Token、推定コスト、モデル分布、プロジェクトディレクトリ分布、完全な Session タイムラインをまとめて表示します。
|
|
3
|
+
**Token 戦情室は、ローカル優先の AI Coding Agent の Token 使用量とセッション復元ダッシュボードです。** Google Antigravity CLI、GitHub Copilot CLI、GitHub Copilot App、GitHub Copilot Chat(VS Code)、Codex Desktop、Codex CLI、Claude Code、Cursor、Grok Build、Pi Coding Agent、OMP、Muse Code のローカル記録を読み取り、日別・月別・年別の Token 消費量、キャッシュ使用量、推論 Token、推定コスト、モデル分布、プロジェクトディレクトリ分布、完全な Session タイムラインをまとめて表示します。
|
|
4
4
|
|
|
5
5
|
このプロジェクトが AI プロバイダー API を代わりに呼び出してデータを取得することはありません。主なデータソースはローカルログ、Status Line コレクターファイル、ローカル SQLite です。
|
|
6
6
|
|
|
@@ -48,14 +48,17 @@ http://localhost:3003
|
|
|
48
48
|
| --- | --- | --- | --- |
|
|
49
49
|
| Google Antigravity CLI | 必要 | `~/.gemini/antigravity-cli/usage/usage-YYYY-MM-DD.jsonl` | `statusline-token.sh` または Windows の `statusline-token.ps1` で Token データを収集 |
|
|
50
50
|
| GitHub Copilot CLI | 必要 | `~/.copilot/usage/usage-YYYY-MM-DD.jsonl` | `statusline-token.sh` または Windows の `statusline-token.ps1` で Token データを収集 |
|
|
51
|
+
| GitHub Copilot App | 不要 | `~/.copilot/data.db`、`~/.copilot/session-store.db` | デスクトップアプリのローカル SQLite をダッシュボードが直接読み取り |
|
|
51
52
|
| GitHub Copilot Chat(VS Code) | 不要 | VS Code `workspaceStorage/chatSessions` | VS Code Stable と Insiders のローカルチャット Session を直接スキャン |
|
|
52
53
|
| Codex Desktop / CLI | 不要 | `~/.codex/sessions`、`~/.codex/archived_sessions` | Codex のアクティブおよびアーカイブ済みローカル Session を直接スキャン |
|
|
53
54
|
| Claude Code | 不要 | `~/.claude/projects` | Claude Code のローカルプロジェクト Session を直接スキャン |
|
|
55
|
+
| Cursor | 不要 | `~/.cursor/projects` | Cursor のローカル transcript をスキャンし、帰属可能なモデル情報を読み取り専用で取得 |
|
|
54
56
|
| Grok Build | 不要 | `~/.grok/sessions` | Grok Build が自動保存する `updates.jsonl` Session stream を直接スキャン |
|
|
55
57
|
| Pi Coding Agent | 不要 | `~/.pi/agent/sessions` | Pi Coding Agent が自動保存するローカル Session JSONL ファイルを直接スキャン |
|
|
56
58
|
| OMP | 不要 | `~/.omp/agent/sessions` | OMP が自動保存するローカル Session JSONL ファイルを直接スキャン |
|
|
59
|
+
| Muse Code | 不要 | `~/.local/share/muse/sessions` | Muse Code が自動保存するローカル Session JSONL ファイルを直接スキャン |
|
|
57
60
|
|
|
58
|
-
**VS Code Copilot、Codex Desktop、Codex CLI、Claude Code、Grok Build、Pi Coding Agent、OMP だけを使用する場合は、1 行のインストールコマンドを実行してダッシュボードを開くだけで利用できます。**
|
|
61
|
+
**Copilot App、VS Code Copilot、Codex Desktop、Codex CLI、Claude Code、Cursor、Grok Build、Pi Coding Agent、OMP、Muse Code だけを使用する場合は、1 行のインストールコマンドを実行してダッシュボードを開くだけで利用できます。**
|
|
59
62
|
|
|
60
63
|
### Windows ネイティブでの利用
|
|
61
64
|
|
|
@@ -74,6 +77,7 @@ Windows ではデフォルトで次のネイティブパスを使用します:
|
|
|
74
77
|
| Grok Build | `%USERPROFILE%\.grok` |
|
|
75
78
|
| Pi Coding Agent | `%USERPROFILE%\.pi` |
|
|
76
79
|
| OMP | `%USERPROFILE%\.omp` |
|
|
80
|
+
| Muse Code | `%USERPROFILE%\.local\share\muse` |
|
|
77
81
|
|
|
78
82
|
ダッシュボードの設定ガイドは Windows で PowerShell のコピー、設定、診断コマンドを表示します。PowerShell collector は .NET JSON とファイル API を使用し、Bash、`jq`、`sed`、`awk` に依存しません。
|
|
79
83
|
|
|
@@ -105,13 +109,13 @@ Windows ではデフォルトで次のネイティブパスを使用します:
|
|
|
105
109
|
|
|
106
110
|
### インターフェース
|
|
107
111
|
|
|
108
|
-
-
|
|
112
|
+
- 9 種類の Coding Agent バッジを切り替え
|
|
109
113
|
- 日別・月別・年別ビュー
|
|
110
114
|
- 日付、月、年のクイック切り替え
|
|
111
115
|
- 5 秒、10 秒、30 秒間隔の自動ライブ更新
|
|
112
116
|
- ローカルログを SQLite に手動同期
|
|
113
117
|
- ダークテーマとライトテーマ
|
|
114
|
-
-
|
|
118
|
+
- 繁体字中国語、簡体字中国語、英語、日本語、韓国語のインターフェース切り替え
|
|
115
119
|
- モデル料金表の表示
|
|
116
120
|
|
|
117
121
|
* * *
|
|
@@ -122,7 +126,7 @@ Windows ではデフォルトで次のネイティブパスを使用します:
|
|
|
122
126
|
|
|
123
127
|
| パラメータ | 対象ビュー | 指定できる値 | 説明 |
|
|
124
128
|
| --- | --- | --- | --- |
|
|
125
|
-
| `agent` | すべて | `antigravity`、`copilot`、`codex`、`claude`、`cursor`、`grok`、`pi`、`omp` | 表示する Coding Agent を指定します。`claude-code`、`grok-build`、`pi-coding-agent` などのエイリアスも利用可能です |
|
|
129
|
+
| `agent` | すべて | `antigravity`、`copilot`、`codex`、`claude`、`cursor`、`grok`、`pi`、`omp`、`muse` | 表示する Coding Agent を指定します。`claude-code`、`grok-build`、`pi-coding-agent`、`oh-my-pi`、`muse-code` などのエイリアスも利用可能です |
|
|
126
130
|
| `tab` | すべて | `daily`、`monthly`、`yearly` | 日別(daily)、月別(monthly)、年別(yearly)ビューを指定します |
|
|
127
131
|
| `date` | すべて | `daily`: `YYYY-MM-DD`、`monthly`: `YYYY-MM`、`yearly`: `YYYY` | 表示する日付・月・年を指定します。形式は `tab` に応じて自動的に対応します |
|
|
128
132
|
| `dir` | `daily` | フルパス、`~` で始まるホームディレクトリのパス、または一意のパス末尾(例:`TokenUsageInsights`) | 日別ビューの作業ディレクトリフィルターを指定します。Windows パスは大文字小文字を区別しません。一致するディレクトリがない場合はすべて表示されます |
|
|
@@ -343,6 +347,27 @@ $env:VSCODE_USER_DATA_DIR = "C:\path\to\vscode-user-data"; & "$HOME\bin\token-us
|
|
|
343
347
|
|
|
344
348
|
* * *
|
|
345
349
|
|
|
350
|
+
## Cursor の設定
|
|
351
|
+
|
|
352
|
+
**Cursor に Hook、Status Line、追加の収集スクリプトは必要ありません。** ダッシュボードは次のディレクトリを直接スキャンします:
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
~/.cursor/projects
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Cursor は会話と Agent の transcript をプロジェクトディレクトリ配下に保存します。ダッシュボードはプラットフォーム既定の `Cursor/User/globalStorage/state.vscdb` も読み取り専用でスキャンし、その `agentKv` 記録から実際のモデルを帰属します。一意に照合できない Session は `Unknown Model` のまま表示されます。
|
|
359
|
+
|
|
360
|
+
使用方法:
|
|
361
|
+
|
|
362
|
+
1. Cursor で少なくとも 1 つの会話または Agent Session を作成します。
|
|
363
|
+
2. ダッシュボードを起動または再読み込みします。
|
|
364
|
+
3. 左側で Cursor を選択します。
|
|
365
|
+
4. 右上の同期ボタンをクリックするか、バックグラウンド同期を待ちます。
|
|
366
|
+
|
|
367
|
+
Cursor のローカルデータには正確な Token 数や公式の請求明細が含まれないため、Token はテキスト内容から推定します。コストは `pricing.csv` に対応するモデルがある場合のみ推定され、公式請求額とは一致しません。デフォルト以外の場所には `CURSOR_DIR` と `CURSOR_STATE_DB` を使用できます。
|
|
368
|
+
|
|
369
|
+
* * *
|
|
370
|
+
|
|
346
371
|
## Grok Build の設定
|
|
347
372
|
|
|
348
373
|
**Grok Build に Hook、Status Line、追加の収集スクリプトは必要ありません。** ダッシュボードは次のディレクトリを直接スキャンします:
|
|
@@ -408,6 +433,27 @@ OMP のコストは、各 Session が各 turn ごとに報告する `usage.cost`
|
|
|
408
433
|
|
|
409
434
|
* * *
|
|
410
435
|
|
|
436
|
+
## Muse Code の設定
|
|
437
|
+
|
|
438
|
+
**Muse Code に Hook、Status Line、追加の収集スクリプトは必要ありません。** ダッシュボードは次のディレクトリを直接スキャンします:
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
~/.local/share/muse/sessions
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Muse Code は Session を日付と Session ID ごとの `session.jsonl` として保存します。ダッシュボードはモデル完了イベントを解析し、入力、キャッシュ読み取り、出力、推論 Token を分けて集計するとともに、ユーザープロンプト、ツール手順、Agent 応答のタイムラインを復元します。
|
|
445
|
+
|
|
446
|
+
使用方法:
|
|
447
|
+
|
|
448
|
+
1. Muse Code を通常どおり使い、少なくとも 1 つの Session を作成します。
|
|
449
|
+
2. ダッシュボードを起動または再読み込みします。
|
|
450
|
+
3. 左側で Muse Code を選択します。
|
|
451
|
+
4. 右上の同期ボタンをクリックするか、バックグラウンド同期を待ちます。
|
|
452
|
+
|
|
453
|
+
Muse Code のコストは、Session が報告するモデルと `pricing.csv` から推定します。データがデフォルトの場所にない場合は、`MUSE_DIR` に `sessions` を含む Muse Code データディレクトリを指定します。
|
|
454
|
+
|
|
455
|
+
* * *
|
|
456
|
+
|
|
411
457
|
## ローカルデータの同期方法
|
|
412
458
|
|
|
413
459
|
サービス起動時にバックエンドがローカル SQLite を初期化し、直ちに 1 回同期します。起動後は 5 秒ごとにバックグラウンド同期も行います。
|
|
@@ -430,9 +476,9 @@ GET /api/:assistant/sync
|
|
|
430
476
|
|
|
431
477
|
**通常はダッシュボード右上のエクスポートとインポートボタンを使用してください。** インストール版はブラウザーだけでマシン間のデータを集約でき、最大 200 MB のインポートファイルに対応します。
|
|
432
478
|
|
|
433
|
-
|
|
479
|
+
v0.9.0 以降、ダッシュボードと CLI は `token-usage-insights` に統合されています。引数なしでダッシュボードを起動し、`export`、`export-all`、`import` でデータを操作できます。各コマンドは `--help` と `-h` に対応します。旧版では更新またはソースからのビルドが必要です。
|
|
434
480
|
|
|
435
|
-
`--agent` はアシスタント(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp`)を指定します。
|
|
481
|
+
`--agent` はアシスタント(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp` / `muse`)を指定します。
|
|
436
482
|
|
|
437
483
|
### ソースから CLI を使用
|
|
438
484
|
|
|
@@ -492,6 +538,7 @@ cargo build --release --bin token-usage-insights
|
|
|
492
538
|
| `GROK_DIR` | `~/.grok` | Grok Build データディレクトリ |
|
|
493
539
|
| `PI_DIR` | `~/.pi` | Pi Coding Agent データディレクトリ |
|
|
494
540
|
| `OMP_DIR` | `~/.omp` | OMP データディレクトリ |
|
|
541
|
+
| `MUSE_DIR` | `~/.local/share/muse` | Muse Code データディレクトリ。`sessions` を含む必要があります |
|
|
495
542
|
| `CORS_ALLOWED_ORIGINS` | `http://localhost:<PORT>,http://127.0.0.1:<PORT>` | カンマ区切りの許可 CORS オリジン |
|
|
496
543
|
|
|
497
544
|
> **デフォルトのバインド先は `0.0.0.0` で、同じローカルネットワーク上の他のデバイスからダッシュボードに接続できる可能性があります。ローカルだけで閲覧する場合は `HOST` を `127.0.0.1` に設定してください。**
|
|
@@ -567,7 +614,7 @@ token-usage-insights
|
|
|
567
614
|
|
|
568
615
|
| 変数 | 対応プラットフォーム | 説明 |
|
|
569
616
|
| --- | --- | --- |
|
|
570
|
-
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | `v0.
|
|
617
|
+
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | `v0.9.2` のようなインストール対象の Release tag。デフォルトは `latest` |
|
|
571
618
|
| `TOKEN_USAGE_INSIGHTS_INSTALL_DIR` | Linux / macOS | `install.sh` に渡すインストールディレクトリ |
|
|
572
619
|
| `TOKEN_USAGE_INSIGHTS_BIN_DIR` | Linux / macOS | `install.sh` に渡す実行ファイルリンクディレクトリ |
|
|
573
620
|
|
|
@@ -677,9 +724,15 @@ systemctl --user reset-failed
|
|
|
677
724
|
```bash
|
|
678
725
|
ls ~/.gemini/antigravity-cli/usage
|
|
679
726
|
ls ~/.copilot/usage
|
|
727
|
+
ls ~/.copilot/data.db ~/.copilot/session-store.db
|
|
680
728
|
ls ~/.codex/sessions
|
|
681
729
|
ls ~/.codex/archived_sessions
|
|
682
730
|
ls ~/.claude/projects
|
|
731
|
+
ls ~/.cursor/projects
|
|
732
|
+
ls ~/.grok/sessions
|
|
733
|
+
ls ~/.pi/agent/sessions
|
|
734
|
+
ls ~/.omp/agent/sessions
|
|
735
|
+
ls ~/.local/share/muse/sessions
|
|
683
736
|
```
|
|
684
737
|
|
|
685
738
|
Antigravity CLI と Copilot CLI では、`settings.json` に `statusLine` が設定され、スクリプトに実行権限があることも確認してください。
|
|
@@ -689,9 +742,15 @@ Windows PowerShell ではネイティブデータディレクトリを直接確
|
|
|
689
742
|
```powershell
|
|
690
743
|
Get-ChildItem "$env:USERPROFILE\.gemini\antigravity-cli\usage"
|
|
691
744
|
Get-ChildItem "$env:USERPROFILE\.copilot\usage"
|
|
745
|
+
Get-ChildItem "$env:USERPROFILE\.copilot\data.db", "$env:USERPROFILE\.copilot\session-store.db"
|
|
692
746
|
Get-ChildItem "$env:USERPROFILE\.codex\sessions"
|
|
693
747
|
Get-ChildItem "$env:USERPROFILE\.codex\archived_sessions"
|
|
694
748
|
Get-ChildItem "$env:USERPROFILE\.claude\projects"
|
|
749
|
+
Get-ChildItem "$env:USERPROFILE\.cursor\projects"
|
|
750
|
+
Get-ChildItem "$env:USERPROFILE\.grok\sessions"
|
|
751
|
+
Get-ChildItem "$env:USERPROFILE\.pi\agent\sessions"
|
|
752
|
+
Get-ChildItem "$env:USERPROFILE\.omp\agent\sessions"
|
|
753
|
+
Get-ChildItem "$env:USERPROFILE\.local\share\muse\sessions"
|
|
695
754
|
```
|
|
696
755
|
|
|
697
756
|
### Status Line スクリプトを実行できない
|
package/README.ko.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Token 전황실
|
|
2
2
|
|
|
3
|
-
**Token 전황실은 로컬 우선 방식의 AI Coding Agent Token 사용량 및 세션 복원 대시보드입니다.** Google Antigravity CLI, GitHub Copilot CLI, GitHub Copilot Chat(VS Code), Codex Desktop, Codex CLI, Claude Code, Grok Build, Pi Coding Agent, OMP의 로컬 기록을 읽어 일별·월별·연별 Token 소비량, 캐시 사용량, 추론 Token, 예상 비용, 모델 분포, 프로젝트 디렉터리 분포와 전체 Session 타임라인을 한곳에 표시합니다.
|
|
3
|
+
**Token 전황실은 로컬 우선 방식의 AI Coding Agent Token 사용량 및 세션 복원 대시보드입니다.** Google Antigravity CLI, GitHub Copilot CLI, GitHub Copilot App, GitHub Copilot Chat(VS Code), Codex Desktop, Codex CLI, Claude Code, Cursor, Grok Build, Pi Coding Agent, OMP, Muse Code의 로컬 기록을 읽어 일별·월별·연별 Token 소비량, 캐시 사용량, 추론 Token, 예상 비용, 모델 분포, 프로젝트 디렉터리 분포와 전체 Session 타임라인을 한곳에 표시합니다.
|
|
4
4
|
|
|
5
5
|
이 프로젝트는 AI 공급자 API를 대신 호출하여 데이터를 조회하지 않습니다. 핵심 데이터 원본은 로컬 로그, Status Line 수집 파일, 로컬 SQLite입니다.
|
|
6
6
|
|
|
@@ -48,14 +48,17 @@ http://localhost:3003
|
|
|
48
48
|
| --- | --- | --- | --- |
|
|
49
49
|
| Google Antigravity CLI | 필요 | `~/.gemini/antigravity-cli/usage/usage-YYYY-MM-DD.jsonl` | `statusline-token.sh` 또는 Windows의 `statusline-token.ps1`로 Token 데이터를 수집 |
|
|
50
50
|
| GitHub Copilot CLI | 필요 | `~/.copilot/usage/usage-YYYY-MM-DD.jsonl` | `statusline-token.sh` 또는 Windows의 `statusline-token.ps1`로 Token 데이터를 수집 |
|
|
51
|
+
| GitHub Copilot App | 불필요 | `~/.copilot/data.db`, `~/.copilot/session-store.db` | 대시보드가 데스크톱 앱의 로컬 SQLite를 직접 읽음 |
|
|
51
52
|
| GitHub Copilot Chat(VS Code) | 불필요 | VS Code `workspaceStorage/chatSessions` | VS Code Stable 및 Insiders의 로컬 채팅 Session을 직접 스캔 |
|
|
52
53
|
| Codex Desktop / CLI | 불필요 | `~/.codex/sessions`, `~/.codex/archived_sessions` | Codex의 활성 및 보관된 로컬 Session 기록을 직접 스캔 |
|
|
53
54
|
| Claude Code | 불필요 | `~/.claude/projects` | Claude Code의 로컬 프로젝트 Session 기록을 직접 스캔 |
|
|
55
|
+
| Cursor | 불필요 | `~/.cursor/projects` | Cursor 로컬 transcript를 스캔하고 귀속 가능한 모델 정보를 읽기 전용으로 조회 |
|
|
54
56
|
| Grok Build | 불필요 | `~/.grok/sessions` | Grok Build가 자동 저장하는 `updates.jsonl` Session stream을 직접 스캔 |
|
|
55
57
|
| Pi Coding Agent | 불필요 | `~/.pi/agent/sessions` | Pi Coding Agent가 자동 저장하는 로컬 Session JSONL 파일을 직접 스캔 |
|
|
56
58
|
| OMP | 불필요 | `~/.omp/agent/sessions` | OMP가 자동 저장하는 로컬 Session JSONL 파일을 직접 스캔 |
|
|
59
|
+
| Muse Code | 불필요 | `~/.local/share/muse/sessions` | Muse Code가 자동 저장하는 로컬 Session JSONL 파일을 직접 스캔 |
|
|
57
60
|
|
|
58
|
-
**VS Code Copilot, Codex Desktop, Codex CLI, Claude Code, Grok Build, Pi Coding Agent 또는
|
|
61
|
+
**Copilot App, VS Code Copilot, Codex Desktop, Codex CLI, Claude Code, Cursor, Grok Build, Pi Coding Agent, OMP 또는 Muse Code만 사용하는 경우 한 줄 설치 명령을 실행하고 대시보드를 열기만 하면 됩니다.**
|
|
59
62
|
|
|
60
63
|
### Windows 네이티브 사용
|
|
61
64
|
|
|
@@ -74,6 +77,7 @@ Windows는 기본적으로 다음 네이티브 경로를 사용합니다.
|
|
|
74
77
|
| Grok Build | `%USERPROFILE%\.grok` |
|
|
75
78
|
| Pi Coding Agent | `%USERPROFILE%\.pi` |
|
|
76
79
|
| OMP | `%USERPROFILE%\.omp` |
|
|
80
|
+
| Muse Code | `%USERPROFILE%\.local\share\muse` |
|
|
77
81
|
|
|
78
82
|
대시보드의 설정 안내는 Windows에서 PowerShell 복사, 설정 및 진단 명령을 표시합니다. PowerShell collector는 .NET JSON 및 파일 API를 사용하며 Bash, `jq`, `sed`, `awk`에 의존하지 않습니다.
|
|
79
83
|
|
|
@@ -105,13 +109,13 @@ Windows는 기본적으로 다음 네이티브 경로를 사용합니다.
|
|
|
105
109
|
|
|
106
110
|
### 인터페이스
|
|
107
111
|
|
|
108
|
-
-
|
|
112
|
+
- 9가지 Coding Agent 배지 전환
|
|
109
113
|
- 일별·월별·연별 보기
|
|
110
114
|
- 날짜·월·연도 빠른 전환
|
|
111
115
|
- 5초, 10초, 30초 간격의 실시간 자동 새로 고침
|
|
112
116
|
- 로컬 로그를 SQLite에 수동 동기화
|
|
113
117
|
- 어두운 테마와 밝은 테마
|
|
114
|
-
- 번체
|
|
118
|
+
- 번체 중국어, 간체 중국어, 영어, 일본어 및 한국어 인터페이스 전환
|
|
115
119
|
- 모델 가격표 보기
|
|
116
120
|
|
|
117
121
|
* * *
|
|
@@ -122,7 +126,7 @@ Windows는 기본적으로 다음 네이티브 경로를 사용합니다.
|
|
|
122
126
|
|
|
123
127
|
| 매개변수 | 적용 보기 | 사용 가능한 값 | 설명 |
|
|
124
128
|
| --- | --- | --- | --- |
|
|
125
|
-
| `agent` | 전체 | `antigravity`, `copilot`, `codex`, `claude`, `cursor`, `grok`, `pi`, `omp` | 표시할 Coding Agent를 지정합니다. `claude-code`, `grok-build`, `pi-coding-agent` 같은 별칭도 지원합니다 |
|
|
129
|
+
| `agent` | 전체 | `antigravity`, `copilot`, `codex`, `claude`, `cursor`, `grok`, `pi`, `omp`, `muse` | 표시할 Coding Agent를 지정합니다. `claude-code`, `grok-build`, `pi-coding-agent`, `oh-my-pi`, `muse-code` 같은 별칭도 지원합니다 |
|
|
126
130
|
| `tab` | 전체 | `daily`, `monthly`, `yearly` | 일별(daily), 월별(monthly), 연별(yearly) 보기를 지정합니다 |
|
|
127
131
|
| `date` | 전체 | `daily`: `YYYY-MM-DD`, `monthly`: `YYYY-MM`, `yearly`: `YYYY` | 표시할 날짜·월·연도를 지정하며, 형식은 `tab`에 따라 자동으로 매핑됩니다 |
|
|
128
132
|
| `dir` | `daily` | 전체 경로, `~`로 시작하는 홈 디렉터리 경로, 또는 고유한 경로 접미사(예: `TokenUsageInsights`) | 일별 보기의 작업 디렉터리 필터를 지정합니다. Windows 경로는 대소문자를 구분하지 않으며, 일치하는 디렉터리가 없으면 전체를 표시합니다 |
|
|
@@ -343,6 +347,27 @@ $env:VSCODE_USER_DATA_DIR = "C:\path\to\vscode-user-data"; & "$HOME\bin\token-us
|
|
|
343
347
|
|
|
344
348
|
* * *
|
|
345
349
|
|
|
350
|
+
## Cursor 설정
|
|
351
|
+
|
|
352
|
+
**Cursor에는 Hook, Status Line 또는 추가 수집 스크립트가 필요하지 않습니다.** 대시보드는 다음 디렉터리를 직접 스캔합니다.
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
~/.cursor/projects
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Cursor는 대화와 Agent transcript를 프로젝트 디렉터리 아래에 저장합니다. 대시보드는 플랫폼 기본 `Cursor/User/globalStorage/state.vscdb`도 읽기 전용으로 스캔하고 `agentKv` 기록을 사용하여 실제 모델을 귀속합니다. 고유하게 일치하지 않는 Session은 `Unknown Model`로 유지됩니다.
|
|
359
|
+
|
|
360
|
+
사용 방법:
|
|
361
|
+
|
|
362
|
+
1. Cursor에서 대화 또는 Agent Session을 하나 이상 만듭니다.
|
|
363
|
+
2. 대시보드를 시작하거나 새로 고칩니다.
|
|
364
|
+
3. 왼쪽에서 Cursor를 선택합니다.
|
|
365
|
+
4. 오른쪽 위 동기화 버튼을 클릭하거나 백그라운드 동기화를 기다립니다.
|
|
366
|
+
|
|
367
|
+
Cursor의 로컬 데이터에는 정확한 Token 수나 공식 청구 내역이 없으므로 Token은 텍스트 내용에서 추정합니다. 비용은 `pricing.csv`에 일치하는 모델이 있을 때만 추정되며 공식 청구액과 같지 않습니다. 기본 위치가 아닌 경우 `CURSOR_DIR` 및 `CURSOR_STATE_DB`를 사용할 수 있습니다.
|
|
368
|
+
|
|
369
|
+
* * *
|
|
370
|
+
|
|
346
371
|
## Grok Build 설정
|
|
347
372
|
|
|
348
373
|
**Grok Build에는 Hook, Status Line 또는 추가 수집 스크립트가 필요하지 않습니다.** 대시보드는 다음 디렉터리를 직접 스캔합니다.
|
|
@@ -408,6 +433,27 @@ OMP의 비용은 각 Session이 각 turn마다 보고하는 `usage.cost` 및 관
|
|
|
408
433
|
|
|
409
434
|
* * *
|
|
410
435
|
|
|
436
|
+
## Muse Code 설정
|
|
437
|
+
|
|
438
|
+
**Muse Code에는 Hook, Status Line 또는 추가 수집 스크립트가 필요하지 않습니다.** 대시보드는 다음 디렉터리를 직접 스캔합니다.
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
~/.local/share/muse/sessions
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Muse Code는 날짜와 Session ID로 구분된 `session.jsonl` 파일에 Session을 저장합니다. 대시보드는 모델 완료 이벤트를 분석하여 입력, 캐시 읽기, 출력, 추론 Token을 분리하고 사용자 프롬프트, 도구 단계 및 Agent 응답 타임라인을 복원합니다.
|
|
445
|
+
|
|
446
|
+
사용 방법:
|
|
447
|
+
|
|
448
|
+
1. Muse Code를 평소처럼 사용하여 Session을 하나 이상 만듭니다.
|
|
449
|
+
2. 대시보드를 시작하거나 새로 고칩니다.
|
|
450
|
+
3. 왼쪽에서 Muse Code를 선택합니다.
|
|
451
|
+
4. 오른쪽 위 동기화 버튼을 클릭하거나 백그라운드 동기화를 기다립니다.
|
|
452
|
+
|
|
453
|
+
Muse Code 비용은 Session이 보고한 모델과 `pricing.csv`를 기준으로 추정합니다. 데이터가 기본 위치에 없다면 `MUSE_DIR`을 `sessions`가 포함된 Muse Code 데이터 디렉터리로 설정합니다.
|
|
454
|
+
|
|
455
|
+
* * *
|
|
456
|
+
|
|
411
457
|
## 로컬 데이터 동기화 방식
|
|
412
458
|
|
|
413
459
|
서비스가 시작되면 백엔드가 로컬 SQLite를 초기화하고 즉시 한 번 데이터를 동기화합니다. 시작 후에는 5초마다 백그라운드 동기화도 수행합니다.
|
|
@@ -430,9 +476,9 @@ GET /api/:assistant/sync
|
|
|
430
476
|
|
|
431
477
|
**일반적인 사용에서는 대시보드 오른쪽 위의 내보내기 및 가져오기 버튼을 사용하세요.** 설치 버전은 브라우저만으로 컴퓨터 간 데이터를 집계할 수 있으며 최대 200 MB의 가져오기 파일을 지원합니다.
|
|
432
478
|
|
|
433
|
-
대시보드와 CLI는 `token-usage-insights` 실행 파일로 통합되었습니다. 인수 없이 실행하면 대시보드가 시작되며, `export`, `export-all`, `import` 하위 명령으로 데이터를 처리합니다. 각 명령은 `--help`와 `-h`를 지원합니다.
|
|
479
|
+
v0.9.0부터 대시보드와 CLI는 `token-usage-insights` 실행 파일로 통합되었습니다. 인수 없이 실행하면 대시보드가 시작되며, `export`, `export-all`, `import` 하위 명령으로 데이터를 처리합니다. 각 명령은 `--help`와 `-h`를 지원합니다. 이전 설치는 업데이트하거나 소스에서 빌드해야 합니다.
|
|
434
480
|
|
|
435
|
-
`--agent`는 어시스턴트(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp`)를 지정합니다.
|
|
481
|
+
`--agent`는 어시스턴트(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp` / `muse`)를 지정합니다.
|
|
436
482
|
|
|
437
483
|
### 소스에서 CLI 사용
|
|
438
484
|
|
|
@@ -492,6 +538,7 @@ cargo build --release --bin token-usage-insights
|
|
|
492
538
|
| `GROK_DIR` | `~/.grok` | Grok Build 데이터 디렉터리 |
|
|
493
539
|
| `PI_DIR` | `~/.pi` | Pi Coding Agent 데이터 디렉터리 |
|
|
494
540
|
| `OMP_DIR` | `~/.omp` | OMP 데이터 디렉터리 |
|
|
541
|
+
| `MUSE_DIR` | `~/.local/share/muse` | Muse Code 데이터 디렉터리. `sessions`를 포함해야 함 |
|
|
495
542
|
| `CORS_ALLOWED_ORIGINS` | `http://localhost:<PORT>,http://127.0.0.1:<PORT>` | 쉼표로 구분한 허용 CORS origin |
|
|
496
543
|
|
|
497
544
|
> **기본 바인딩은 `0.0.0.0`이므로 같은 로컬 네트워크의 다른 장치가 대시보드에 연결할 수 있습니다. 로컬에서만 보려면 `HOST`를 `127.0.0.1`로 설정하세요.**
|
|
@@ -567,7 +614,7 @@ token-usage-insights
|
|
|
567
614
|
|
|
568
615
|
| 변수 | 대상 플랫폼 | 설명 |
|
|
569
616
|
| --- | --- | --- |
|
|
570
|
-
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | 설치할 Release tag(예: `v0.
|
|
617
|
+
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | 설치할 Release tag(예: `v0.9.2`); 기본값은 `latest` |
|
|
571
618
|
| `TOKEN_USAGE_INSIGHTS_INSTALL_DIR` | Linux / macOS | `install.sh`에 전달할 설치 디렉터리 |
|
|
572
619
|
| `TOKEN_USAGE_INSIGHTS_BIN_DIR` | Linux / macOS | `install.sh`에 전달할 실행 파일 링크 디렉터리 |
|
|
573
620
|
|
|
@@ -677,9 +724,15 @@ systemctl --user reset-failed
|
|
|
677
724
|
```bash
|
|
678
725
|
ls ~/.gemini/antigravity-cli/usage
|
|
679
726
|
ls ~/.copilot/usage
|
|
727
|
+
ls ~/.copilot/data.db ~/.copilot/session-store.db
|
|
680
728
|
ls ~/.codex/sessions
|
|
681
729
|
ls ~/.codex/archived_sessions
|
|
682
730
|
ls ~/.claude/projects
|
|
731
|
+
ls ~/.cursor/projects
|
|
732
|
+
ls ~/.grok/sessions
|
|
733
|
+
ls ~/.pi/agent/sessions
|
|
734
|
+
ls ~/.omp/agent/sessions
|
|
735
|
+
ls ~/.local/share/muse/sessions
|
|
683
736
|
```
|
|
684
737
|
|
|
685
738
|
Antigravity CLI와 Copilot CLI는 `settings.json`에 `statusLine`이 설정되어 있고 스크립트에 실행 권한이 있는지도 확인해야 합니다.
|
|
@@ -689,9 +742,15 @@ Windows PowerShell에서는 네이티브 데이터 디렉터리를 직접 확인
|
|
|
689
742
|
```powershell
|
|
690
743
|
Get-ChildItem "$env:USERPROFILE\.gemini\antigravity-cli\usage"
|
|
691
744
|
Get-ChildItem "$env:USERPROFILE\.copilot\usage"
|
|
745
|
+
Get-ChildItem "$env:USERPROFILE\.copilot\data.db", "$env:USERPROFILE\.copilot\session-store.db"
|
|
692
746
|
Get-ChildItem "$env:USERPROFILE\.codex\sessions"
|
|
693
747
|
Get-ChildItem "$env:USERPROFILE\.codex\archived_sessions"
|
|
694
748
|
Get-ChildItem "$env:USERPROFILE\.claude\projects"
|
|
749
|
+
Get-ChildItem "$env:USERPROFILE\.cursor\projects"
|
|
750
|
+
Get-ChildItem "$env:USERPROFILE\.grok\sessions"
|
|
751
|
+
Get-ChildItem "$env:USERPROFILE\.pi\agent\sessions"
|
|
752
|
+
Get-ChildItem "$env:USERPROFILE\.omp\agent\sessions"
|
|
753
|
+
Get-ChildItem "$env:USERPROFILE\.local\share\muse\sessions"
|
|
695
754
|
```
|
|
696
755
|
|
|
697
756
|
### Status Line 스크립트를 실행할 수 없음
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Token 戰情室
|
|
2
2
|
|
|
3
|
-
**Token 戰情室是本機優先的 AI Coding Agent Token 使用量與會話還原看板。** 它會讀取本機上的 Google Antigravity CLI、GitHub Copilot CLI、GitHub Copilot Chat(VS Code)、Codex Desktop、Codex CLI、Claude Code、Grok Build、Pi Coding Agent 與
|
|
3
|
+
**Token 戰情室是本機優先的 AI Coding Agent Token 使用量與會話還原看板。** 它會讀取本機上的 Google Antigravity CLI、GitHub Copilot CLI、GitHub Copilot App、GitHub Copilot Chat(VS Code)、Codex Desktop、Codex CLI、Claude Code、Cursor、Grok Build、Pi Coding Agent、OMP 與 Muse Code 記錄,集中呈現每日、月度、年度的 Token 消耗、快取使用、推理 Token、估算費用、模型分佈、專案目錄分佈與完整 Session 時間軸。
|
|
4
4
|
|
|
5
5
|
本專案不會替你呼叫 AI 供應商 API 查詢資料;核心資料來源是本機日誌、Status Line 收集檔與本機 SQLite。
|
|
6
6
|
|
|
@@ -48,14 +48,17 @@ http://localhost:3003
|
|
|
48
48
|
| --- | --- | --- | --- |
|
|
49
49
|
| Google Antigravity CLI | 需要 | `~/.gemini/antigravity-cli/usage/usage-YYYY-MM-DD.jsonl` | 透過 `statusline-token.sh` 或 Windows `statusline-token.ps1` 收集 Token 資料 |
|
|
50
50
|
| GitHub Copilot CLI | 需要 | `~/.copilot/usage/usage-YYYY-MM-DD.jsonl` | 透過 `statusline-token.sh` 或 Windows `statusline-token.ps1` 收集 Token 資料 |
|
|
51
|
+
| GitHub Copilot App | 不需要 | `~/.copilot/data.db`、`~/.copilot/session-store.db` | 看板直接讀取 Copilot 桌面應用程式的本機 SQLite |
|
|
51
52
|
| GitHub Copilot Chat(VS Code) | 不需要 | VS Code `workspaceStorage/chatSessions` | 看板直接掃描 VS Code Stable 與 Insiders 的本機聊天 Session |
|
|
52
53
|
| Codex Desktop / CLI | 不需要 | `~/.codex/sessions`、`~/.codex/archived_sessions` | 看板會直接掃描 Codex 作用中與已封存的本機 Session 記錄 |
|
|
53
54
|
| Claude Code | 不需要 | `~/.claude/projects` | 看板會直接掃描 Claude Code 本機專案 Session 記錄 |
|
|
55
|
+
| Cursor | 不需要 | `~/.cursor/projects` | 看板會直接掃描 Cursor 本機 transcript,並唯讀取得可歸因的模型資訊 |
|
|
54
56
|
| Grok Build | 不需要 | `~/.grok/sessions` | 看板會直接掃描 Grok Build 自動保存的 `updates.jsonl` Session stream |
|
|
55
57
|
| Pi Coding Agent | 不需要 | `~/.pi/agent/sessions` | 看板會直接掃描 Pi Coding Agent 自動保存的本機 Session JSONL 檔案 |
|
|
56
58
|
| OMP | 不需要 | `~/.omp/agent/sessions` | 看板會直接掃描 OMP 自動保存的本機 Session JSONL 檔案 |
|
|
59
|
+
| Muse Code | 不需要 | `~/.local/share/muse/sessions` | 看板會直接掃描 Muse Code 自動保存的本機 Session JSONL 檔案 |
|
|
57
60
|
|
|
58
|
-
**只使用 VS Code Copilot、Codex Desktop、Codex CLI、Claude Code、Grok Build、Pi Coding Agent 或
|
|
61
|
+
**只使用 Copilot App、VS Code Copilot、Codex Desktop、Codex CLI、Claude Code、Cursor、Grok Build、Pi Coding Agent、OMP 或 Muse Code 時,執行一行安裝指令並開啟看板即可。**
|
|
59
62
|
|
|
60
63
|
### Windows 原生使用
|
|
61
64
|
|
|
@@ -74,6 +77,7 @@ Windows 預設使用下列原生路徑:
|
|
|
74
77
|
| Grok Build | `%USERPROFILE%\.grok` |
|
|
75
78
|
| Pi Coding Agent | `%USERPROFILE%\.pi` |
|
|
76
79
|
| OMP | `%USERPROFILE%\.omp` |
|
|
80
|
+
| Muse Code | `%USERPROFILE%\.local\share\muse` |
|
|
77
81
|
|
|
78
82
|
看板內的設定指南會在 Windows 顯示 PowerShell 複製、設定與診斷命令。PowerShell collector 使用 .NET JSON 與檔案 API,不依賴 Bash、`jq`、`sed` 或 `awk`。
|
|
79
83
|
|
|
@@ -105,13 +109,13 @@ Windows 預設使用下列原生路徑:
|
|
|
105
109
|
|
|
106
110
|
### 介面操作
|
|
107
111
|
|
|
108
|
-
-
|
|
112
|
+
- 九種 Coding Agent 徽章切換
|
|
109
113
|
- 每日、月度、年度視圖
|
|
110
114
|
- 日期、月份、年份快速切換
|
|
111
115
|
- 5 秒、10 秒、30 秒即時自動刷新
|
|
112
116
|
- 手動同步本機日誌到 SQLite
|
|
113
117
|
- 深色與淺色主題
|
|
114
|
-
-
|
|
118
|
+
- 正體中文、簡體中文、英文、日文與韓文介面切換
|
|
115
119
|
- 模型費用表檢視
|
|
116
120
|
|
|
117
121
|
* * *
|
|
@@ -122,7 +126,7 @@ Windows 預設使用下列原生路徑:
|
|
|
122
126
|
|
|
123
127
|
| 參數 | 適用視圖 | 可用值 | 說明 |
|
|
124
128
|
| --- | --- | --- | --- |
|
|
125
|
-
| `agent` | 全部 | `antigravity`、`copilot`、`codex`、`claude`、`cursor`、`grok`、`pi`、`omp` | 指定要顯示的 Coding Agent。另支援 `claude-code`、`grok-build`、`pi-coding-agent` 等別名寫法 |
|
|
129
|
+
| `agent` | 全部 | `antigravity`、`copilot`、`codex`、`claude`、`cursor`、`grok`、`pi`、`omp`、`muse` | 指定要顯示的 Coding Agent。另支援 `claude-code`、`grok-build`、`pi-coding-agent`、`oh-my-pi`、`muse-code` 等別名寫法 |
|
|
126
130
|
| `tab` | 全部 | `daily`、`monthly`、`yearly` | 指定以日(每日)、月(月度)或年(年度)視圖顯示 |
|
|
127
131
|
| `date` | 全部 | `daily`:`YYYY-MM-DD`;`monthly`:`YYYY-MM`;`yearly`:`YYYY` | 指定要顯示的日期、月份或年份,格式會依 `tab` 自動對應 |
|
|
128
132
|
| `dir` | `daily` | 完整路徑、`~` 開頭的家目錄路徑,或唯一的路徑尾碼(如 `TokenUsageInsights`) | 指定每日視圖的工作目錄篩選。Windows 路徑不分大小寫;找不到符合目錄時會顯示全部 |
|
|
@@ -343,6 +347,27 @@ $env:VSCODE_USER_DATA_DIR = "C:\path\to\vscode-user-data"; & "$HOME\bin\token-us
|
|
|
343
347
|
|
|
344
348
|
* * *
|
|
345
349
|
|
|
350
|
+
## Cursor 設定
|
|
351
|
+
|
|
352
|
+
**Cursor 不需要安裝 Hook、Status Line 或額外收集腳本。** 看板會直接掃描:
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
~/.cursor/projects
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Cursor 會將對話與 Agent transcript 保存於專案目錄下。看板也會唯讀掃描平台預設的 `Cursor/User/globalStorage/state.vscdb`,以其中的 `agentKv` 記錄歸因實際模型;無法唯一比對時會保留為 `Unknown Model`。
|
|
359
|
+
|
|
360
|
+
使用方式:
|
|
361
|
+
|
|
362
|
+
1. 先在 Cursor 中產生至少一個對話或 Agent Session。
|
|
363
|
+
2. 啟動或重新整理本專案看板。
|
|
364
|
+
3. 在左側選擇 Cursor。
|
|
365
|
+
4. 按右上角同步按鈕,或等待背景同步。
|
|
366
|
+
|
|
367
|
+
Cursor 本機資料不包含精確 Token 或官方帳務明細,因此 Token 依文字內容估算;只有在 `pricing.csv` 存在對應模型時才會估算費用,結果不等同官方帳單。非預設資料位置可使用 `CURSOR_DIR` 與 `CURSOR_STATE_DB` 指定。
|
|
368
|
+
|
|
369
|
+
* * *
|
|
370
|
+
|
|
346
371
|
## Grok Build 設定
|
|
347
372
|
|
|
348
373
|
**Grok Build 不需要安裝 Hook、Status Line 或額外收集腳本。** 看板會直接掃描:
|
|
@@ -408,6 +433,27 @@ OMP 的成本一律直接讀取 Session 每個 turn 自行回報的 `usage.cost`
|
|
|
408
433
|
|
|
409
434
|
* * *
|
|
410
435
|
|
|
436
|
+
## Muse Code 設定
|
|
437
|
+
|
|
438
|
+
**Muse Code 不需要安裝 Hook、Status Line 或額外收集腳本。** 看板會直接掃描:
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
~/.local/share/muse/sessions
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Muse Code 會將 Session 依日期與 Session ID 分層保存為 `session.jsonl`。看板會解析其中的模型完成事件,分拆輸入、快取讀取、輸出與推理 Token,並還原使用者提示詞、工具步驟與 Agent 回覆時間軸。
|
|
445
|
+
|
|
446
|
+
使用方式:
|
|
447
|
+
|
|
448
|
+
1. 先正常使用 Muse Code 產生至少一個 Session。
|
|
449
|
+
2. 啟動或重新整理本專案看板。
|
|
450
|
+
3. 在左側選擇 Muse Code。
|
|
451
|
+
4. 按右上角同步按鈕,或等待背景同步。
|
|
452
|
+
|
|
453
|
+
Muse Code 的費用會依 Session 回報的模型與 `pricing.csv` 估算。若資料不在預設位置,可設定 `MUSE_DIR` 指向包含 `sessions` 的 Muse Code 資料目錄。
|
|
454
|
+
|
|
455
|
+
* * *
|
|
456
|
+
|
|
411
457
|
## 本地資料同步方式
|
|
412
458
|
|
|
413
459
|
啟動服務時,後端會初始化本機 SQLite 並立即同步一次資料。服務啟動後,也會每 5 秒背景同步一次。
|
|
@@ -430,9 +476,9 @@ GET /api/:assistant/sync
|
|
|
430
476
|
|
|
431
477
|
**一般使用請直接使用看板右上角的匯出與匯入按鈕。** 安裝版只需要瀏覽器即可完成跨機器資料彙整,並支援最大 200 MB 的匯入檔案。
|
|
432
478
|
|
|
433
|
-
看板與 CLI
|
|
479
|
+
看板與 CLI 自 v0.9.0 起整合為同一個 `token-usage-insights` 執行檔。不帶參數會啟動看板;使用 `export`、`export-all`、`import` 子命令可直接操作使用量資料。主命令與各子命令均支援 `--help`、`-h`;較舊的安裝版本需更新或從原始碼建置。
|
|
434
480
|
|
|
435
|
-
`--agent` 會指定助理(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp
|
|
481
|
+
`--agent` 會指定助理(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp` / `muse`)。
|
|
436
482
|
|
|
437
483
|
### 從原始碼使用 CLI
|
|
438
484
|
|
|
@@ -507,6 +553,7 @@ cargo build --release --bin token-usage-insights
|
|
|
507
553
|
| `GROK_DIR` | `~/.grok` | Grok Build 資料目錄 |
|
|
508
554
|
| `PI_DIR` | `~/.pi` | Pi Coding Agent 資料目錄 |
|
|
509
555
|
| `OMP_DIR` | `~/.omp` | OMP 資料目錄 |
|
|
556
|
+
| `MUSE_DIR` | `~/.local/share/muse` | Muse Code 資料目錄,應包含 `sessions` |
|
|
510
557
|
| `CORS_ALLOWED_ORIGINS` | `http://localhost:<PORT>,http://127.0.0.1:<PORT>` | 允許的 CORS 來源,逗號分隔 |
|
|
511
558
|
|
|
512
559
|
> **預設綁定 `0.0.0.0`,同一區網內的其他裝置可能連線到看板。只需在本機瀏覽時,請將 `HOST` 設為 `127.0.0.1`。**
|
|
@@ -592,7 +639,7 @@ token-usage-insights
|
|
|
592
639
|
|
|
593
640
|
| 變數 | 適用平台 | 說明 |
|
|
594
641
|
| --- | --- | --- |
|
|
595
|
-
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | 指定要安裝的 Release tag,例如 `v0.9.
|
|
642
|
+
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | 指定要安裝的 Release tag,例如 `v0.9.2`。預設 `latest` |
|
|
596
643
|
| `TOKEN_USAGE_INSIGHTS_INSTALL_DIR` | Linux / macOS | 安裝目錄,會轉交給 `install.sh` |
|
|
597
644
|
| `TOKEN_USAGE_INSIGHTS_BIN_DIR` | Linux / macOS | 執行檔連結目錄,會轉交給 `install.sh` |
|
|
598
645
|
|
|
@@ -704,9 +751,15 @@ systemctl --user reset-failed
|
|
|
704
751
|
```bash
|
|
705
752
|
ls ~/.gemini/antigravity-cli/usage
|
|
706
753
|
ls ~/.copilot/usage
|
|
754
|
+
ls ~/.copilot/data.db ~/.copilot/session-store.db
|
|
707
755
|
ls ~/.codex/sessions
|
|
708
756
|
ls ~/.codex/archived_sessions
|
|
709
757
|
ls ~/.claude/projects
|
|
758
|
+
ls ~/.cursor/projects
|
|
759
|
+
ls ~/.grok/sessions
|
|
760
|
+
ls ~/.pi/agent/sessions
|
|
761
|
+
ls ~/.omp/agent/sessions
|
|
762
|
+
ls ~/.local/share/muse/sessions
|
|
710
763
|
```
|
|
711
764
|
|
|
712
765
|
Antigravity CLI 與 Copilot CLI 還需要確認 `settings.json` 已設定 `statusLine`,且腳本具備執行權限。
|
|
@@ -716,9 +769,15 @@ Windows PowerShell 可直接檢查原生資料目錄:
|
|
|
716
769
|
```powershell
|
|
717
770
|
Get-ChildItem "$env:USERPROFILE\.gemini\antigravity-cli\usage"
|
|
718
771
|
Get-ChildItem "$env:USERPROFILE\.copilot\usage"
|
|
772
|
+
Get-ChildItem "$env:USERPROFILE\.copilot\data.db", "$env:USERPROFILE\.copilot\session-store.db"
|
|
719
773
|
Get-ChildItem "$env:USERPROFILE\.codex\sessions"
|
|
720
774
|
Get-ChildItem "$env:USERPROFILE\.codex\archived_sessions"
|
|
721
775
|
Get-ChildItem "$env:USERPROFILE\.claude\projects"
|
|
776
|
+
Get-ChildItem "$env:USERPROFILE\.cursor\projects"
|
|
777
|
+
Get-ChildItem "$env:USERPROFILE\.grok\sessions"
|
|
778
|
+
Get-ChildItem "$env:USERPROFILE\.pi\agent\sessions"
|
|
779
|
+
Get-ChildItem "$env:USERPROFILE\.omp\agent\sessions"
|
|
780
|
+
Get-ChildItem "$env:USERPROFILE\.local\share\muse\sessions"
|
|
722
781
|
```
|
|
723
782
|
|
|
724
783
|
### Status Line 腳本無法執行
|
package/README.zh-CN.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Token 战情室
|
|
2
2
|
|
|
3
|
-
**Token 战情室是本地优先的 AI Coding Agent Token 使用量与会话还原看板。** 它会读取本机上的 Google Antigravity CLI、GitHub Copilot CLI、GitHub Copilot Chat(VS Code)、Codex Desktop、Codex CLI、Claude Code、Grok Build、Pi Coding Agent 与
|
|
3
|
+
**Token 战情室是本地优先的 AI Coding Agent Token 使用量与会话还原看板。** 它会读取本机上的 Google Antigravity CLI、GitHub Copilot CLI、GitHub Copilot App、GitHub Copilot Chat(VS Code)、Codex Desktop、Codex CLI、Claude Code、Cursor、Grok Build、Pi Coding Agent、OMP 与 Muse Code 记录,集中呈现每日、月度、年度的 Token 消耗、缓存使用、推理 Token、估算费用、模型分布、项目目录分布与完整 Session 时间轴。
|
|
4
4
|
|
|
5
5
|
本项目不会代你调用 AI 供应商 API 查询数据;核心数据来源是本地日志、Status Line 收集文件与本地 SQLite。
|
|
6
6
|
|
|
@@ -48,14 +48,17 @@ http://localhost:3003
|
|
|
48
48
|
| --- | --- | --- | --- |
|
|
49
49
|
| Google Antigravity CLI | 需要 | `~/.gemini/antigravity-cli/usage/usage-YYYY-MM-DD.jsonl` | 通过 `statusline-token.sh` 或 Windows `statusline-token.ps1` 收集 Token 数据 |
|
|
50
50
|
| GitHub Copilot CLI | 需要 | `~/.copilot/usage/usage-YYYY-MM-DD.jsonl` | 通过 `statusline-token.sh` 或 Windows `statusline-token.ps1` 收集 Token 数据 |
|
|
51
|
+
| GitHub Copilot App | 不需要 | `~/.copilot/data.db`、`~/.copilot/session-store.db` | 看板直接读取 Copilot 桌面应用的本地 SQLite |
|
|
51
52
|
| GitHub Copilot Chat(VS Code) | 不需要 | VS Code `workspaceStorage/chatSessions` | 看板直接扫描 VS Code Stable 与 Insiders 的本地聊天 Session |
|
|
52
53
|
| Codex Desktop / CLI | 不需要 | `~/.codex/sessions`、`~/.codex/archived_sessions` | 看板会直接扫描 Codex 活动中与已归档的本地 Session 记录 |
|
|
53
54
|
| Claude Code | 不需要 | `~/.claude/projects` | 看板会直接扫描 Claude Code 的本地项目 Session 记录 |
|
|
55
|
+
| Cursor | 不需要 | `~/.cursor/projects` | 看板会直接扫描 Cursor 本地 transcript,并以只读方式获取可归因的模型信息 |
|
|
54
56
|
| Grok Build | 不需要 | `~/.grok/sessions` | 看板会直接扫描 Grok Build 自动保存的 `updates.jsonl` Session stream |
|
|
55
57
|
| Pi Coding Agent | 不需要 | `~/.pi/agent/sessions` | 看板会直接扫描 Pi Coding Agent 自动保存的本地 Session JSONL 文件 |
|
|
56
58
|
| OMP | 不需要 | `~/.omp/agent/sessions` | 看板会直接扫描 OMP 自动保存的本地 Session JSONL 文件 |
|
|
59
|
+
| Muse Code | 不需要 | `~/.local/share/muse/sessions` | 看板会直接扫描 Muse Code 自动保存的本地 Session JSONL 文件 |
|
|
57
60
|
|
|
58
|
-
**只使用 VS Code Copilot、Codex Desktop、Codex CLI、Claude Code、Grok Build、Pi Coding Agent 或
|
|
61
|
+
**只使用 Copilot App、VS Code Copilot、Codex Desktop、Codex CLI、Claude Code、Cursor、Grok Build、Pi Coding Agent、OMP 或 Muse Code 时,执行一行安装命令并打开看板即可。**
|
|
59
62
|
|
|
60
63
|
### Windows 原生使用
|
|
61
64
|
|
|
@@ -74,6 +77,7 @@ Windows 默认使用以下原生路径:
|
|
|
74
77
|
| Grok Build | `%USERPROFILE%\.grok` |
|
|
75
78
|
| Pi Coding Agent | `%USERPROFILE%\.pi` |
|
|
76
79
|
| OMP | `%USERPROFILE%\.omp` |
|
|
80
|
+
| Muse Code | `%USERPROFILE%\.local\share\muse` |
|
|
77
81
|
|
|
78
82
|
看板内的设置指南会在 Windows 显示 PowerShell 复制、设置与诊断命令。PowerShell collector 使用 .NET JSON 与文件 API,不依赖 Bash、`jq`、`sed` 或 `awk`。
|
|
79
83
|
|
|
@@ -105,13 +109,13 @@ Windows 默认使用以下原生路径:
|
|
|
105
109
|
|
|
106
110
|
### 界面操作
|
|
107
111
|
|
|
108
|
-
-
|
|
112
|
+
- 九种 Coding Agent 徽章切换
|
|
109
113
|
- 每日、月度、年度视图
|
|
110
114
|
- 日期、月份、年份快速切换
|
|
111
115
|
- 5 秒、10 秒、30 秒实时自动刷新
|
|
112
116
|
- 手动同步本地日志到 SQLite
|
|
113
117
|
- 深色与浅色主题
|
|
114
|
-
-
|
|
118
|
+
- 繁体中文、简体中文、英文、日文与韩文界面切换
|
|
115
119
|
- 模型费用表查看
|
|
116
120
|
|
|
117
121
|
* * *
|
|
@@ -122,7 +126,7 @@ Windows 默认使用以下原生路径:
|
|
|
122
126
|
|
|
123
127
|
| 参数 | 适用视图 | 可用值 | 说明 |
|
|
124
128
|
| --- | --- | --- | --- |
|
|
125
|
-
| `agent` | 全部 | `antigravity`、`copilot`、`codex`、`claude`、`cursor`、`grok`、`pi`、`omp` | 指定要显示的 Coding Agent。另支持 `claude-code`、`grok-build`、`pi-coding-agent` 等别名写法 |
|
|
129
|
+
| `agent` | 全部 | `antigravity`、`copilot`、`codex`、`claude`、`cursor`、`grok`、`pi`、`omp`、`muse` | 指定要显示的 Coding Agent。另支持 `claude-code`、`grok-build`、`pi-coding-agent`、`oh-my-pi`、`muse-code` 等别名写法 |
|
|
126
130
|
| `tab` | 全部 | `daily`、`monthly`、`yearly` | 指定以日(每日)、月(月度)或年(年度)视图显示 |
|
|
127
131
|
| `date` | 全部 | `daily`:`YYYY-MM-DD`;`monthly`:`YYYY-MM`;`yearly`:`YYYY` | 指定要显示的日期、月份或年份,格式会依 `tab` 自动对应 |
|
|
128
132
|
| `dir` | `daily` | 完整路径、`~` 开头的家目录路径,或唯一的路径后缀(如 `TokenUsageInsights`) | 指定每日视图的工作目录筛选。Windows 路径不区分大小写;找不到匹配目录时会显示全部 |
|
|
@@ -343,6 +347,27 @@ $env:VSCODE_USER_DATA_DIR = "C:\path\to\vscode-user-data"; & "$HOME\bin\token-us
|
|
|
343
347
|
|
|
344
348
|
* * *
|
|
345
349
|
|
|
350
|
+
## Cursor 设置
|
|
351
|
+
|
|
352
|
+
**Cursor 不需要安装 Hook、Status Line 或额外收集脚本。** 看板会直接扫描:
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
~/.cursor/projects
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Cursor 会将对话与 Agent transcript 保存到项目目录下。看板也会以只读方式扫描平台默认的 `Cursor/User/globalStorage/state.vscdb`,根据其中的 `agentKv` 记录归因实际模型;无法唯一匹配的 Session 会保留为 `Unknown Model`。
|
|
359
|
+
|
|
360
|
+
使用方式:
|
|
361
|
+
|
|
362
|
+
1. 先在 Cursor 中创建至少一个对话或 Agent Session。
|
|
363
|
+
2. 启动或刷新本项目看板。
|
|
364
|
+
3. 在左侧选择 Cursor。
|
|
365
|
+
4. 按右上角同步按钮,或等待后台同步。
|
|
366
|
+
|
|
367
|
+
Cursor 本地数据不包含精确 Token 或官方账单明细,因此 Token 根据文本内容估算;仅当 `pricing.csv` 存在对应模型时才会估算费用,结果不等同于官方账单。非默认数据位置可使用 `CURSOR_DIR` 与 `CURSOR_STATE_DB` 指定。
|
|
368
|
+
|
|
369
|
+
* * *
|
|
370
|
+
|
|
346
371
|
## Grok Build 设置
|
|
347
372
|
|
|
348
373
|
**Grok Build 不需要安装 Hook、Status Line 或额外收集脚本。** 看板会直接扫描:
|
|
@@ -408,6 +433,27 @@ OMP 的成本始终直接读取自 Session 每个 turn 自行报告的 `usage.co
|
|
|
408
433
|
|
|
409
434
|
* * *
|
|
410
435
|
|
|
436
|
+
## Muse Code 设置
|
|
437
|
+
|
|
438
|
+
**Muse Code 不需要安装 Hook、Status Line 或额外收集脚本。** 看板会直接扫描:
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
~/.local/share/muse/sessions
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
Muse Code 会将 Session 按日期与 Session ID 分层保存为 `session.jsonl`。看板会解析其中的模型完成事件,拆分输入、缓存读取、输出与推理 Token,并还原用户提示词、工具步骤与 Agent 回复时间轴。
|
|
445
|
+
|
|
446
|
+
使用方式:
|
|
447
|
+
|
|
448
|
+
1. 先正常使用 Muse Code 创建至少一个 Session。
|
|
449
|
+
2. 启动或刷新本项目看板。
|
|
450
|
+
3. 在左侧选择 Muse Code。
|
|
451
|
+
4. 按右上角同步按钮,或等待后台同步。
|
|
452
|
+
|
|
453
|
+
Muse Code 的费用会根据 Session 报告的模型与 `pricing.csv` 进行估算。如果数据不在默认位置,可设置 `MUSE_DIR` 指向包含 `sessions` 的 Muse Code 数据目录。
|
|
454
|
+
|
|
455
|
+
* * *
|
|
456
|
+
|
|
411
457
|
## 本地数据同步方式
|
|
412
458
|
|
|
413
459
|
启动服务时,后端会初始化本地 SQLite 并立即同步一次数据。服务启动后,也会每 5 秒进行一次后台同步。
|
|
@@ -430,9 +476,9 @@ GET /api/:assistant/sync
|
|
|
430
476
|
|
|
431
477
|
**一般使用请直接使用看板右上角的导出与导入按钮。** 安装版只需要浏览器即可完成跨机器数据汇总,并支持最大 200 MB 的导入文件。
|
|
432
478
|
|
|
433
|
-
|
|
479
|
+
从 v0.9.0 起,看板与 CLI 已整合为同一个 `token-usage-insights` 可执行文件。不带参数会启动看板,使用 `export`、`export-all`、`import` 子命令可操作数据;主命令与各子命令均支持 `--help`、`-h`。旧版需要更新或从源代码构建。
|
|
434
480
|
|
|
435
|
-
`--agent` 用于指定助理(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp`)。
|
|
481
|
+
`--agent` 用于指定助理(`antigravity` / `copilot` / `codex` / `claude` / `cursor` / `grok` / `pi` / `omp` / `muse`)。
|
|
436
482
|
|
|
437
483
|
### 从源代码使用 CLI
|
|
438
484
|
|
|
@@ -492,6 +538,7 @@ cargo build --release --bin token-usage-insights
|
|
|
492
538
|
| `GROK_DIR` | `~/.grok` | Grok Build 数据目录 |
|
|
493
539
|
| `PI_DIR` | `~/.pi` | Pi Coding Agent 数据目录 |
|
|
494
540
|
| `OMP_DIR` | `~/.omp` | OMP 数据目录 |
|
|
541
|
+
| `MUSE_DIR` | `~/.local/share/muse` | Muse Code 数据目录,应包含 `sessions` |
|
|
495
542
|
| `CORS_ALLOWED_ORIGINS` | `http://localhost:<PORT>,http://127.0.0.1:<PORT>` | 允许的 CORS 来源,以逗号分隔 |
|
|
496
543
|
|
|
497
544
|
> **默认绑定 `0.0.0.0`,同一局域网内的其他设备可能连接到看板。只需在本机浏览时,请将 `HOST` 设置为 `127.0.0.1`。**
|
|
@@ -567,7 +614,7 @@ token-usage-insights
|
|
|
567
614
|
|
|
568
615
|
| 变量 | 适用平台 | 说明 |
|
|
569
616
|
| --- | --- | --- |
|
|
570
|
-
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | 指定要安装的 Release tag,例如 `v0.
|
|
617
|
+
| `TOKEN_USAGE_INSIGHTS_VERSION` | Linux / macOS / Windows | 指定要安装的 Release tag,例如 `v0.9.2`。默认 `latest` |
|
|
571
618
|
| `TOKEN_USAGE_INSIGHTS_INSTALL_DIR` | Linux / macOS | 安装目录,会传递给 `install.sh` |
|
|
572
619
|
| `TOKEN_USAGE_INSIGHTS_BIN_DIR` | Linux / macOS | 可执行文件链接目录,会传递给 `install.sh` |
|
|
573
620
|
|
|
@@ -677,9 +724,15 @@ systemctl --user reset-failed
|
|
|
677
724
|
```bash
|
|
678
725
|
ls ~/.gemini/antigravity-cli/usage
|
|
679
726
|
ls ~/.copilot/usage
|
|
727
|
+
ls ~/.copilot/data.db ~/.copilot/session-store.db
|
|
680
728
|
ls ~/.codex/sessions
|
|
681
729
|
ls ~/.codex/archived_sessions
|
|
682
730
|
ls ~/.claude/projects
|
|
731
|
+
ls ~/.cursor/projects
|
|
732
|
+
ls ~/.grok/sessions
|
|
733
|
+
ls ~/.pi/agent/sessions
|
|
734
|
+
ls ~/.omp/agent/sessions
|
|
735
|
+
ls ~/.local/share/muse/sessions
|
|
683
736
|
```
|
|
684
737
|
|
|
685
738
|
Antigravity CLI 与 Copilot CLI 还需要确认 `settings.json` 已设置 `statusLine`,且脚本具有执行权限。
|
|
@@ -689,9 +742,15 @@ Windows PowerShell 可直接检查原生数据目录:
|
|
|
689
742
|
```powershell
|
|
690
743
|
Get-ChildItem "$env:USERPROFILE\.gemini\antigravity-cli\usage"
|
|
691
744
|
Get-ChildItem "$env:USERPROFILE\.copilot\usage"
|
|
745
|
+
Get-ChildItem "$env:USERPROFILE\.copilot\data.db", "$env:USERPROFILE\.copilot\session-store.db"
|
|
692
746
|
Get-ChildItem "$env:USERPROFILE\.codex\sessions"
|
|
693
747
|
Get-ChildItem "$env:USERPROFILE\.codex\archived_sessions"
|
|
694
748
|
Get-ChildItem "$env:USERPROFILE\.claude\projects"
|
|
749
|
+
Get-ChildItem "$env:USERPROFILE\.cursor\projects"
|
|
750
|
+
Get-ChildItem "$env:USERPROFILE\.grok\sessions"
|
|
751
|
+
Get-ChildItem "$env:USERPROFILE\.pi\agent\sessions"
|
|
752
|
+
Get-ChildItem "$env:USERPROFILE\.omp\agent\sessions"
|
|
753
|
+
Get-ChildItem "$env:USERPROFILE\.local\share\muse\sessions"
|
|
695
754
|
```
|
|
696
755
|
|
|
697
756
|
### Status Line 脚本无法执行
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "token-usage-insights",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Local-first AI coding agent token usage dashboard and CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"token-usage-insights": "npm/cli.cjs"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"rust",
|
|
39
39
|
"cli"
|
|
40
40
|
],
|
|
41
|
-
"author": "Will
|
|
41
|
+
"author": "Will 保哥",
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public",
|