@zhangferry-dev/tokendash 1.3.0 → 1.4.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # tokendash
2
2
 
3
- A beautiful, local web dashboard for visualizing your Claude Code, Codex, and OpenClaw token usage statistics.
3
+ A beautiful, local web dashboard for visualizing your Claude Code, Codex, OpenClaw, and OpenCode token usage statistics.
4
4
 
5
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
 
@@ -8,15 +8,17 @@ It runs locally and parses token usage data directly from local session files, p
8
8
 
9
9
  ## Features
10
10
 
11
- - **Multi-Agent Support:** View usage for Claude Code, Codex, and OpenClaw.
11
+ - **Multi-Agent Support:** View usage for Claude Code, Codex, OpenClaw, and OpenCode.
12
12
  - **Direct JSONL Parsing:** Reads `~/.claude/projects/` JSONL files directly — no `ccusage` CLI dependency, 100x faster data loading.
13
13
  - **Detailed Metrics:** Track total tokens, cost (USD), active days, cache hit rates, and output/input ratio.
14
+ - **Today by Hour:** 24-hour token consumption panel showing hourly breakdown for the current day.
14
15
  - **Code Analytics:** Visualize code change trends, tool call frequency, and productivity KPIs (Claude Code & OpenClaw only).
15
16
  - **Pricing Transparency:** Toggle Cost metric to see per-model pricing formula and rates.
16
17
  - **Interactive Charts:** Bar/line/area charts with tooltips, model breakdowns, and time range filtering.
17
18
  - **24-Hour Heatmap:** Activity distribution by hour and day of week, with timezone awareness.
18
19
  - **Model & Project Distribution:** See which models and projects drive your usage.
19
20
  - **Persistent Filters:** Your selected time range, project, and metric mode are saved automatically.
21
+ - **macOS Menu Bar App:** Native tray icon with real-time token usage, popover dashboard, and agent filtering — runs silently in the background.
20
22
  - **Test Coverage:** Unit tests (Vitest) and E2E tests (Playwright) for reliability.
21
23
 
22
24
  ## Requirements
@@ -43,6 +45,16 @@ By default, the backend server runs on port `3456`. When running the production
43
45
 
44
46
  During development (`npm run dev`), Vite starts a separate development server on port `5173` with hot-module replacement. You should access the dashboard at `http://localhost:5173` while developing.
45
47
 
48
+ ### macOS Menu Bar App
49
+
50
+ Download the latest `TokenDash.dmg` from [GitHub Releases](https://github.com/zhangferry/tokendash/releases). Open the DMG and drag TokenDash to your Applications folder.
51
+
52
+ The menu bar app shows real-time token usage in the status bar. Click the icon to open a compact popover dashboard with:
53
+ - Today's token count and cost breakdown
54
+ - Hourly consumption chart
55
+ - Agent filter (show only Claude Code, Codex, etc.)
56
+ - Settings: launch at login, check for updates, quit
57
+
46
58
  ### Command Line Options
47
59
 
48
60
  ```bash
@@ -87,12 +99,28 @@ If you want to contribute or modify the dashboard locally:
87
99
 
88
100
  - **Frontend:** React 19, Recharts, Tailwind CSS (via Vite plugin), built with Vite.
89
101
  - **Backend:** Express, TypeScript.
90
- - **Data Source:** All agent data is parsed directly from local session files (`~/.claude/projects/`, `~/.codex/sessions/`). No external CLI dependencies.
102
+ - **Data Source:** All agent data is parsed directly from local session files (`~/.claude/projects/`, `~/.codex/sessions/`) and OpenCode's SQLite database (`~/.local/share/opencode/opencode.db`). No external CLI dependencies.
91
103
  - **Caching:** Persistent disk cache (`/tmp/tokendash-cache/`) with stale-while-revalidate pattern for snappy UI updates.
92
104
  - **Testing:** Vitest (unit), Playwright (E2E). Run with `npm test` and `npm run test:e2e`.
105
+ - **CI:** GitHub Actions pipeline for automated testing on every push and PR.
93
106
 
94
107
  ## Changelog
95
108
 
109
+ ### v1.4.0
110
+ - **macOS Menu Bar App** — native tray icon with real-time token count and cost in the status bar
111
+ - **Popover Dashboard** — click the tray icon for a compact dashboard with hourly chart, agent filter, and settings
112
+ - **Native Swift Tray Helper** — lightweight binary for macOS 26+ compatibility, drawn SVG icon
113
+ - **Agent Filter** — choose which agents to display in both popover and tray badge, persisted across sessions
114
+ - **Settings Panel** — launch at login, check for updates (via GitHub Releases), quit
115
+ - **Update Checker** — automatic version check against GitHub Releases
116
+
117
+ ### v1.3.0
118
+ - **Added OpenCode agent support** — parses SQLite database at `~/.local/share/opencode/opencode.db`
119
+ - **Added Today by Hour panel** — 24-hour token consumption breakdown for the current day
120
+ - **E2E test overhaul** — comprehensive Playwright test suite with fixture-based test data
121
+ - **Added CI pipeline** — GitHub Actions for automated testing on push and PR
122
+ - **Fixed model trend chart** — included `cacheReadTokens` in model trend calculations
123
+
96
124
  ### v1.2.0
97
125
  - **Replaced `ccusage` CLI** with direct JSONL parser — data loads in 1-2ms instead of 12-30s
98
126
  - **Added code analytics** — code change trend, tool call trend, daily KPIs
package/bin/tokendash.js CHANGED
@@ -1,2 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import "../dist/server/index.js";
2
+ import { main } from "../dist/server/index.js";
3
+ main().catch((error) => {
4
+ console.error('Fatal error:', error);
5
+ process.exit(1);
6
+ });