How jingbiaomei/tokdash works
Tokdash is a local dashboard for token usage, cost, activity, and provider quotas across AI coding tools. The main path is CLI or dashboard access, local log discovery and parsing, usage computation and persistence, then reporting through the web UI, TUI, or desktop companions. Setup and lifecycle management are a separate capability; quota polling and multi-server companion views are additional branches. Some major modules are represented from the README and source index because their implementation excerpts were not provided, so uncertain internal links are omitted.
Main entry points: cli.py CLI · compute.py Usage computation · app.py Terminal dashboard · MultiServerTokdashClient.cs Windows multi-server client
Components 22
Entry and setup
- CLI
src/tokdash/cli.py - Setup lifecycle
src/tokdash/onboard/engine.py - Install paths
src/tokdash/onboard/paths.py - Install manifest
src/tokdash/onboard/manifest.py
Usage pipeline
- Session parsing
src/tokdash/sessions.py - Tool parsers
src/tokdash/sources/coding_tools.py - OpenClaw parser
src/tokdash/sources/openclaw.py - Client paths
src/tokdash/clientpaths.py - Usage computation
src/tokdash/compute.py - Pricing
src/tokdash/pricing.py - Usage store
src/tokdash/usage_store.py
Quota tracking
- Quota pollers
src/tokdash/sources/quota/__init__.py - Quota configuration
src/tokdash/sources/quota/config.py
Dashboard views
- Web API
src/tokdash/api.py - Terminal dashboard
src/tokdash/tui/app.py - Terminal reports
src/tokdash/tui/report.py
Desktop companions
- macOS companion
companion/macos/TokdashCompanion/CompanionStore.swift - macOS API client
companion/macos/TokdashCompanion/TokdashClient.swift - Windows companion
companion/windows/TokdashCompanion/CompanionStore.cs - Windows multi-server client
companion/windows/TokdashCompanion/MultiServerTokdashClient.cs
Other components
- User
- Tokdash service
Connections 26
- User → CLI: runs commands
README.md - CLI → Setup lifecycle: runs setup
src/tokdash/cli.py - Setup lifecycle → Install paths: resolves paths
src/tokdash/onboard/engine.py - Setup lifecycle → Install manifest: records lifecycle
src/tokdash/onboard/engine.py - CLI → Usage computation: computes usage
src/tokdash/cli.py - Usage computation → Session parsing: uses session data
src/tokdash/compute.py - Usage computation → Tool parsers: uses parsers
src/tokdash/compute.py - Usage computation → OpenClaw parser: uses parser
src/tokdash/compute.py - Usage computation → Pricing: applies rates
src/tokdash/compute.py - Usage computation → Usage store: stores usage
src/tokdash/compute.py - Session parsing → Client paths: resolves logs
src/tokdash/sessions.py - Tool parsers → Client paths: resolves logs
src/tokdash/sources/coding_tools.py - CLI → Quota pollers: loads quota
src/tokdash/cli.py - Quota pollers → Quota configuration: reads settings
src/tokdash/sources/quota/__init__.py - CLI → Web API: serves dashboard
src/tokdash/cli.py - User → Web API: views dashboard
README.md - CLI → Terminal dashboard: launches TUI
src/tokdash/cli.py - CLI → Terminal reports: runs reports
src/tokdash/cli.py - Terminal dashboard → Usage computation: loads usage
src/tokdash/tui/app.py - Terminal dashboard → Session parsing: loads sessions
src/tokdash/tui/app.py - Terminal dashboard → Usage store: reads stored data
src/tokdash/tui/app.py - macOS companion → macOS API client: fetches dashboard data
companion/macos/TokdashCompanion/CompanionStore.swift - macOS API client → Tokdash service: requests API
companion/macos/TokdashCompanion/TokdashClient.swift - Windows companion → Windows multi-server client: fetches server data
companion/windows/TokdashCompanion/CompanionStore.cs - Windows multi-server client → Windows multi-server client: fans out requests
companion/windows/TokdashCompanion/MultiServerTokdashClient.cs - Windows multi-server client → Tokdash service: requests API