tokenleak 2.0.0 → 2.1.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.
Files changed (3) hide show
  1. package/README.md +39 -6
  2. package/package.json +1 -1
  3. package/tokenleak +1092 -195
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  See where your AI tokens actually go. Tokenleak reads usage data from **Claude Code**, **Codex**, **Cursor**, **Pi (`pi-mono`)**, and **OpenCode**, then renders terminal dashboards, heatmaps, compare reports, explain/focus reports, and shareable image cards from the CLI.
4
4
 
5
- ![Tokenleak preview card](./docs/preview.png)
5
+ ![Tokenleak OpenTUI overview](./docs/tui-overview.png)
6
6
 
7
7
  ## Overview
8
8
 
@@ -49,6 +49,7 @@ In an interactive TTY, plain `tokenleak` launches a full-screen TUI dashboard wi
49
49
  - **Compare** — side-by-side period comparison with deltas
50
50
  - **Export** — save PNG, Wrapped PNG, or launch a live server
51
51
  - **Wrapped** — Spotify-Wrapped-style stats card with achievements and usage breakdown
52
+ - **Replay** — chronological session timeline with flow blocks, pulse chart, and flow/think ratio
52
53
 
53
54
  Use `tokenleak --legacy` to open the classic interactive launcher instead.
54
55
 
@@ -110,6 +111,10 @@ tokenleak -o card.png
110
111
  tokenleak explain 2026-03-10
111
112
  tokenleak explain 2026-03-10 --format json
112
113
 
114
+ # Replay a day's session timeline
115
+ tokenleak replay
116
+ tokenleak replay 2026-03-10 --format json
117
+
113
118
  # Rank deep-work sessions
114
119
  tokenleak focus
115
120
  tokenleak focus --provider codex --days 30
@@ -123,7 +128,7 @@ tokenleak --list-providers
123
128
 
124
129
  ### Analysis commands
125
130
 
126
- Tokenleak ships two dedicated investigation commands in addition to the main dashboard flow:
131
+ Tokenleak ships three dedicated investigation commands in addition to the main dashboard flow:
127
132
 
128
133
  ```bash
129
134
  # Explain what drove a specific day
@@ -137,10 +142,17 @@ tokenleak focus --days 30
137
142
 
138
143
  # Focus report as JSON
139
144
  tokenleak focus --format json --provider pi --output focus.json
145
+
146
+ # Replay today's session timeline
147
+ tokenleak replay
148
+
149
+ # Replay a specific day with JSON output
150
+ tokenleak replay 2026-03-10 --format json --output replay.json
140
151
  ```
141
152
 
142
153
  - `tokenleak explain <date>` builds a narrative day report with top providers, sessions, projects, models, and anomaly flags.
143
154
  - `tokenleak focus` ranks sessions by a deep-work score derived from duration, token density, and project streak.
155
+ - `tokenleak replay [date]` shows a chronological timeline of all sessions for a day, clustering events into flow blocks with a pulse chart and flow/think ratio. Defaults to today.
144
156
 
145
157
  ### Cursor commands
146
158
 
@@ -270,6 +282,10 @@ When you use `--format png` or `--format svg`, Tokenleak enables expanded compar
270
282
 
271
283
  Generate a Spotify-Wrapped-style story card as a tall PNG image showing your AI coding stats, streaks, model usage, habits, achievements, and more.
272
284
 
285
+ Current wrapped card generated from the latest Tokenleak build:
286
+
287
+ ![Tokenleak AI Wrapped card](./docs/wrapped-card.png)
288
+
273
289
  ```bash
274
290
  # Generate your wrapped card (dark theme, opens automatically)
275
291
  tokenleak --format wrapped --open
@@ -302,7 +318,9 @@ tokenleak --wrapped-live --days 365 --claude
302
318
  tokenleak --wrapped-live --provider claude-code,codex
303
319
  ```
304
320
 
305
- The presentation uses the same 12 sections as the static wrapped card but rendered as navigable slides with an obsidian-and-gold design. Use arrow keys, click the nav buttons, or swipe on touch devices to move between slides.
321
+ `tokenleak --format wrapped` is the static export path: it writes a tall PNG you can attach to docs, posts, or issues. `tokenleak --wrapped-live` uses the same underlying stats, but serves them as a browser deck that is better for demos, screenshares, and walking through each section interactively.
322
+
323
+ The Wrapped Live server starts on `http://localhost:3456` and automatically increments to the next free port if `3456` is already taken. The presentation uses the same 12 sections as the static wrapped card but rendered as navigable slides with an obsidian-and-gold design. Use arrow keys, click the nav buttons, or swipe on touch devices to move between slides.
306
324
 
307
325
  The classic launcher (`tokenleak --legacy`) includes Wrapped Live as a menu option.
308
326
 
@@ -381,6 +399,18 @@ tokenleak --format json --upload gist
381
399
 
382
400
  In a real TTY, `tokenleak` launches a full-screen terminal dashboard built with [@opentui/core](https://www.npmjs.com/package/@opentui/core). The TUI provides 8 views with keyboard and mouse navigation:
383
401
 
402
+ Latest OpenTUI screenshots from the current dashboard build:
403
+
404
+ | Overview | Matrix (page 4) |
405
+ | --- | --- |
406
+ | ![Overview view](./docs/tui-overview.png) | ![Matrix view](./docs/tui-matrix.png) |
407
+ | Advisor | Focus |
408
+ | ![Advisor view](./docs/tui-advisor.png) | ![Focus view](./docs/tui-focus.png) |
409
+ | Explain | Compare |
410
+ | ![Explain view](./docs/tui-explain.png) | ![Compare view](./docs/tui-compare.png) |
411
+ | Export | Wrapped |
412
+ | ![Export view](./docs/tui-export.png) | ![Wrapped view](./docs/tui-wrapped.png) |
413
+
384
414
  | Key | Action |
385
415
  | --- | --- |
386
416
  | `←` / `→` | Switch between views |
@@ -420,8 +450,9 @@ Subcommands:
420
450
 
421
451
  - `tokenleak explain <date>` supports `--format terminal|json`, `--output`, `--width`, and the standard provider filters.
422
452
  - `tokenleak focus` supports `--format terminal|json`, `--output`, `--width`, and the standard provider/date filters.
453
+ - `tokenleak replay [date]` supports `--format terminal|json`, `--output`, `--width`, and the standard provider filters. Date defaults to today.
423
454
  - `tokenleak cursor --help` prints the Cursor auth/cache command help text.
424
- - `tokenleak explain --help` and `tokenleak focus --help` print the subcommand-specific help text.
455
+ - `tokenleak explain --help`, `tokenleak focus --help`, and `tokenleak replay --help` print the subcommand-specific help text.
425
456
 
426
457
  | Flag | Alias | Default | Description |
427
458
  | --- | --- | --- | --- |
@@ -591,10 +622,12 @@ The dedicated analysis commands also support JSON output:
591
622
  ```bash
592
623
  tokenleak explain 2026-03-10 --format json
593
624
  tokenleak focus --format json
625
+ tokenleak replay 2026-03-10 --format json
594
626
  ```
595
627
 
596
- - `tokenleak explain ... --format json` returns an explain report with headline, summary bullets, evidence tables, and anomaly flags.
597
- - `tokenleak focus ... --format json` returns a ranked focus report with deep-work scores, durations, densities, streaks, and rationales per session.
628
+ - An explain report (`tokenleak explain ... --format json`) includes a headline, summary bullets, evidence tables for providers/models/sessions, and anomaly flags.
629
+ - `tokenleak focus ... --format json` produces a ranked focus report with deep-work scores, durations, token densities, project streaks, and per-session rationales.
630
+ - Use `tokenleak replay ... --format json` to get a replay report containing flow blocks, a token velocity time series, model switch annotations, and a day summary with flow/think ratio.
598
631
 
599
632
  When `--compare` is used with `--format json`, the output is a compare payload with:
600
633
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenleak",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Visualise your AI coding-assistant token usage across providers — heatmaps, dashboards, and shareable cards.",
5
5
  "type": "module",
6
6
  "bin": {