@diogonzafe/tokenwatch 0.4.0 → 0.5.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 +21 -6
- package/dist/cli.js +785 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -547,13 +547,17 @@ Budget webhook payload:
|
|
|
547
547
|
## CLI
|
|
548
548
|
|
|
549
549
|
```bash
|
|
550
|
-
npx tokenwatch sync
|
|
551
|
-
npx tokenwatch prices
|
|
552
|
-
npx tokenwatch report
|
|
553
|
-
npx tokenwatch
|
|
550
|
+
npx tokenwatch sync # force update cached prices from remote
|
|
551
|
+
npx tokenwatch prices # list all models and current prices
|
|
552
|
+
npx tokenwatch report # show usage report from ~/.tokenwatch/usage.db
|
|
553
|
+
npx tokenwatch dashboard # open local web dashboard (default port: 4242)
|
|
554
|
+
npx tokenwatch dashboard --port 8080
|
|
555
|
+
npx tokenwatch help # show help
|
|
554
556
|
```
|
|
555
557
|
|
|
556
|
-
`tokenwatch report`
|
|
558
|
+
### `tokenwatch report`
|
|
559
|
+
|
|
560
|
+
Reads the local SQLite database and prints:
|
|
557
561
|
|
|
558
562
|
```
|
|
559
563
|
── tokenwatch report ──────────────────────────────
|
|
@@ -574,7 +578,18 @@ npx tokenwatch help # show help
|
|
|
574
578
|
───────────────────────────────────────────────────
|
|
575
579
|
```
|
|
576
580
|
|
|
577
|
-
|
|
581
|
+
### `tokenwatch dashboard`
|
|
582
|
+
|
|
583
|
+
Spins up a local web server and opens a dark-themed dashboard with real-time cost data:
|
|
584
|
+
|
|
585
|
+
- **Overview cards** — total cost, tokens, calls, burn rate per hour
|
|
586
|
+
- **Cost over time** — line chart bucketed by time (5min / 1h / 1day depending on filter)
|
|
587
|
+
- **Model breakdown** — doughnut chart + table with cost share per model
|
|
588
|
+
- **By user / feature** — collapsible tables, hidden when empty
|
|
589
|
+
- **Cost forecast** — projected daily and monthly spend based on recent burn rate
|
|
590
|
+
- **Time filter tabs** — 1h | 24h | 7d | 30d | All; updates chart and tables in real-time via SSE
|
|
591
|
+
|
|
592
|
+
Data updates automatically every 3 seconds without refreshing the page. Requires `storage: 'sqlite'` in your app and `better-sqlite3` installed. Zero external dependencies — pure Node.js HTTP server with Chart.js loaded from CDN.
|
|
578
593
|
|
|
579
594
|
---
|
|
580
595
|
|