@zhangferry-dev/tokendash 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -7
- package/dist/client/assets/index-D-RErhSy.js +121 -0
- package/dist/client/assets/index-x7K7fQX4.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/server/agentDetection.d.ts +2 -0
- package/dist/server/agentDetection.js +4 -0
- package/dist/server/index.js +8 -3
- package/dist/server/opencodeParser.d.ts +22 -0
- package/dist/server/opencodeParser.js +292 -0
- package/dist/server/routes/analytics.js +1 -1
- package/dist/server/routes/api.js +3 -0
- package/dist/server/routes/blocks.js +4 -0
- package/dist/server/routes/daily.js +4 -0
- package/dist/server/routes/projects.js +4 -0
- package/package.json +6 -3
- package/dist/client/assets/index-92lvfG3S.css +0 -1
- package/dist/client/assets/index-DJOsmILU.js +0 -121
package/README.md
CHANGED
|
@@ -2,18 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
A beautiful, local web dashboard for visualizing your Claude Code, Codex, and OpenClaw token usage statistics.
|
|
4
4
|
|
|
5
|
-
It runs locally and parses token usage data directly from local session files, presenting it in a clean, interactive React dashboard.
|
|
5
|
+
It runs locally and parses token usage data directly from local session files, presenting it in a clean, interactive React dashboard. No external CLI dependencies required.
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- **Multi-Agent Support:** View usage for
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
11
|
+
- **Multi-Agent Support:** View usage for Claude Code, Codex, and OpenClaw.
|
|
12
|
+
- **Direct JSONL Parsing:** Reads `~/.claude/projects/` JSONL files directly — no `ccusage` CLI dependency, 100x faster data loading.
|
|
13
|
+
- **Detailed Metrics:** Track total tokens, cost (USD), active days, cache hit rates, and output/input ratio.
|
|
14
|
+
- **Code Analytics:** Visualize code change trends, tool call frequency, and productivity KPIs (Claude Code & OpenClaw only).
|
|
15
|
+
- **Pricing Transparency:** Toggle Cost metric to see per-model pricing formula and rates.
|
|
16
|
+
- **Interactive Charts:** Bar/line/area charts with tooltips, model breakdowns, and time range filtering.
|
|
17
|
+
- **24-Hour Heatmap:** Activity distribution by hour and day of week, with timezone awareness.
|
|
18
|
+
- **Model & Project Distribution:** See which models and projects drive your usage.
|
|
16
19
|
- **Persistent Filters:** Your selected time range, project, and metric mode are saved automatically.
|
|
20
|
+
- **Test Coverage:** Unit tests (Vitest) and E2E tests (Playwright) for reliability.
|
|
17
21
|
|
|
18
22
|
## Requirements
|
|
19
23
|
|
|
@@ -83,7 +87,21 @@ If you want to contribute or modify the dashboard locally:
|
|
|
83
87
|
|
|
84
88
|
- **Frontend:** React 19, Recharts, Tailwind CSS (via Vite plugin), built with Vite.
|
|
85
89
|
- **Backend:** Express, TypeScript.
|
|
86
|
-
- **Data Source:**
|
|
90
|
+
- **Data Source:** All agent data is parsed directly from local session files (`~/.claude/projects/`, `~/.codex/sessions/`). No external CLI dependencies.
|
|
91
|
+
- **Caching:** Persistent disk cache (`/tmp/tokendash-cache/`) with stale-while-revalidate pattern for snappy UI updates.
|
|
92
|
+
- **Testing:** Vitest (unit), Playwright (E2E). Run with `npm test` and `npm run test:e2e`.
|
|
93
|
+
|
|
94
|
+
## Changelog
|
|
95
|
+
|
|
96
|
+
### v1.2.0
|
|
97
|
+
- **Replaced `ccusage` CLI** with direct JSONL parser — data loads in 1-2ms instead of 12-30s
|
|
98
|
+
- **Added code analytics** — code change trend, tool call trend, daily KPIs
|
|
99
|
+
- **Added persistent disk cache** with stale-while-revalidate pattern
|
|
100
|
+
- **Fixed heatmap** — cost metric now shows real data (was always $0)
|
|
101
|
+
- **Fixed timezone handling** — correct date/hour grouping for non-UTC users
|
|
102
|
+
- **Added pricing info popup** — shows per-model pricing formula in Cost mode
|
|
103
|
+
- **Added test suite** — 49 unit tests + 6 E2E tests
|
|
104
|
+
- **Layout improvements** — model trend bar chart, side-by-side analytics panels
|
|
87
105
|
|
|
88
106
|
## License
|
|
89
107
|
|