How mm7894215/tokentracker works
Token Tracker is a local-first usage and cost tracker for AI coding tools, delivered through a cross-platform CLI, dashboard, and native desktop apps. The main workflow detects tool data, syncs and serves it locally, then presents usage insights in the dashboard. Documented side capabilities include skills browsing, achievements, desktop pets, widgets, and optional cloud features. Source excerpts are partial, so edges without direct excerpt evidence rely on README statements; uncertain internal calls are omitted.
Main entry points: App.jsx Dashboard UI · DashboardPage.jsx Usage views · sync.js Usage sync · cli.js CLI entry
Components 19
Collection and serving
- CLI entry
src/cli.js - Tool usage data
- Tool hooks
src/commands/init.js - Usage sync
src/commands/sync.js - Local server
src/commands/serve.js
Dashboard experience
- Dashboard UI
dashboard/src/App.jsx - Usage API
dashboard/src/lib/api.ts - Usage views
dashboard/src/pages/DashboardPage.jsx - Skills browser
dashboard/src/pages/SkillsPage.jsx
Insights and extras
- Usage analysis
dashboard/src/ui/dashboard/components - Achievements
dashboard/src/pages/AchievementsPage.jsx - Desktop pet
dashboard/src/pages/PetPage.jsx - Native widgets
TokenTrackerBar/TokenTrackerWidget/Widgets
Desktop clients
- macOS app
TokenTrackerBar/TokenTrackerBar/Services/StatusBarController.swift - Windows app
TokenTrackerWin/TrayApplicationContext.cs - Linux app
TokenTrackerLinux/src-tauri/src/main.rs
Cloud services
- Dashboard auth
dashboard/src/contexts/InsforgeAuthContext.jsx - Cloud API
dashboard/edge-patches/tokentracker-ingest.ts
Other components
- Developer
Connections 22
- Developer → CLI entry: runs
README.md - CLI entry → Tool hooks: installs
README.md - Tool usage data → Usage sync: provides logs
README.md - Tool hooks → Usage sync: enable collection
README.md - CLI entry → Usage sync: starts sync
README.md - Usage sync → Local server: serves locally
README.md - Local server → Dashboard UI: opens dashboard
README.md - Dashboard UI → Usage API: requests data
dashboard/src/App.jsx - Usage API → Usage views: supplies usage
- Usage views → Usage analysis: presents insights
README.md - Dashboard UI → Skills browser: offers browsing
README.md - Usage views → Achievements: supports tracks
README.md - Usage views → Desktop pet: drives companion
README.md - Usage views → Native widgets: publishes snapshots
- Developer → macOS app: uses desktop app
README.md - Developer → Windows app: uses desktop app
README.md - Developer → Linux app: uses desktop app
README.md - macOS app → Dashboard UI: hosts dashboard
- Windows app → Dashboard UI: hosts dashboard
README.md - Linux app → Dashboard UI: hosts dashboard
README.md - Dashboard UI → Dashboard auth: provides sign-in
dashboard/src/App.jsx - Dashboard auth → Cloud API: optional cloud access