{"id":47979682,"url":"https://github.com/pdajoy/tokendashboard","last_synced_at":"2026-04-24T04:04:11.455Z","repository":{"id":346311929,"uuid":"1189294043","full_name":"pdajoy/tokendashboard","owner":"pdajoy","description":"Exquisite token usage panel, view and track your codex, cursor, claude code historical usage in GUI mode, beautiful sharing cards. ","archived":false,"fork":false,"pushed_at":"2026-03-23T08:20:20.000Z","size":5467,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T11:39:25.232Z","etag":null,"topics":["ai","claude-code","clawbot","codex","cursor","gemini-cli","openclaw","opencode"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pdajoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-23T07:08:04.000Z","updated_at":"2026-03-23T08:20:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pdajoy/tokendashboard","commit_stats":null,"previous_names":["pdajoy/tokendashboard"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pdajoy/tokendashboard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdajoy%2Ftokendashboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdajoy%2Ftokendashboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdajoy%2Ftokendashboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdajoy%2Ftokendashboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pdajoy","download_url":"https://codeload.github.com/pdajoy/tokendashboard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pdajoy%2Ftokendashboard/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32208480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","claude-code","clawbot","codex","cursor","gemini-cli","openclaw","opencode"],"created_at":"2026-04-04T11:02:15.426Z","updated_at":"2026-04-24T04:04:11.450Z","avatar_url":"https://github.com/pdajoy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Tokscale Dashboard\n\n**[中文文档](README.zh-CN.md)**\n\nA powerful, beautiful analytics dashboard for tracking AI coding assistant token usage and costs. Built on top of [tokscale](https://github.com/junhoyeo/tokscale) data with a zero-dependency Node.js server and React frontend.\n\n![Overview - Dark Mode](docs/screenshots/overview-dark.png)\n\n## Why Tokscale Dashboard?\n\nIf you use AI coding assistants like **Cursor**, **Codex CLI**, **Claude Code**, or **Gemini CLI**, you're likely spending significant amounts on AI tokens without clear visibility. Tokscale Dashboard gives you:\n\n- **Complete cost visibility** — Know exactly where every dollar goes across all your AI tools\n- **Model-level analytics** — Compare costs, token usage, and message counts across 60+ models\n- **Platform vs API pricing** — See if your platform subscription is actually saving you money compared to direct API costs\n- **Beautiful share cards** — Generate stunning PNG cards to share your AI usage stats\n\n## Screenshots\n\n| Dark Mode | Light Mode | Pricing Comparison |\n|:-:|:-:|:-:|\n| ![Dark](docs/screenshots/overview-dark.png) | ![Light](docs/screenshots/overview-light.png) | ![Pricing](docs/screenshots/pricing-dark.png) |\n\n### Share Cards\n\nGenerate beautiful PNG cards to share your AI usage stats:\n\n| Overview Card | Streak Card | Badge Card |\n|:-:|:-:|:-:|\n| ![Overview](docs/screenshots/share-overview.png) | ![Streak](docs/screenshots/share-streak.png) | ![Badge](docs/screenshots/share-badge.png) |\n\n## Quick Start\n\nRun the dashboard directly — no clone, no install:\n\n```bash\n# With bun\nbunx tokscale-dashboard\n\n# With npm\nnpx tokscale-dashboard\n\n# Custom port\nnpx tokscale-dashboard --port 3000\n```\n\nThen open \u003chttp://localhost:8787\u003e.\n\nOn first launch, the dashboard will:\n1. Use the bundled pre-built frontend assets\n2. Create `~/.tokscale-dashboard/data/` to store graph, pricing, and settings\n3. Call the `tokscale` CLI (via `bunx tokscale@latest` by default) to collect the initial data set\n\nAll data refresh and tokscale runner configuration happens in the in-app Settings panel — no external scripts needed.\n\n## Features\n\n### Analytics \u0026 Visualization\n- **Summary Dashboard** — Total cost, tokens, messages, active days, peak day, and cache stats at a glance\n- **Monthly Cost Trends** — Interactive line charts tracking cost and message volume over time\n- **Monthly Breakdown** — Expandable rows showing per-model usage for each month\n- **Daily Activity Heatmap** — GitHub-style contribution graph for your AI usage\n- **Provider \u0026 Source Breakdown** — Pie charts showing cost distribution by provider\n- **Top Models Ranking** — Ranked list of your most-used (and most expensive) models\n- **Token Type Analysis** — Monthly breakdown with stacked (vertical) and grouped (horizontal) bar layouts\n- **Daily Usage Charts** — Granular daily cost and token analysis, expandable by model\n\n### Pricing Intelligence\n- **Model Price List** — Real-time pricing data from LiteLLM and OpenRouter for 56+ models\n- **Cost Comparison** — Platform cost vs estimated direct API cost for every model\n- **Cost Ratio Analysis** — Instantly see which models are cheaper on your platform vs direct API\n- **Automatic Model Mapping** — Maps platform-specific model names to their public API equivalents\n\n### Settings \u0026 Data Refresh\n- **In-app settings modal** — Configure the tokscale runner (`bunx` / `npx`), package spec (`tokscale@latest`, pinned versions, etc.), and extra CLI arguments\n- **Granular refresh** — Refresh everything, token data only, or pricing only — all from the UI\n- **Live log output** — See each step of the refresh as it happens\n\n### Shareable Cards\n- **9 Card Templates** — Overview, Compact, Top Models, Activity, Monthly, Providers, Tokens, Streak, Badge\n- **PNG Export** — High-resolution 2x PNG download for any card\n\n### Theming \u0026 UX\n- **Dark \u0026 Light Mode** — Full theme support with persistent preference\n- **Glass Morphism UI** — Modern frosted glass design with smooth animations\n- **Responsive Layout** — Works on desktop and tablet\n- **CSV Export** — One-click full data export\n\n## Tech Stack\n\n| Layer | Technology |\n|---|---|\n| Runtime | Node.js 18+ (zero runtime dependencies) |\n| Frontend | React 19 + TypeScript + Vite |\n| Styling | Tailwind CSS v4 |\n| Charts | Recharts |\n| Icons | Lucide React |\n| Image Export | html-to-image |\n| Data Source | [tokscale](https://github.com/junhoyeo/tokscale) CLI |\n\n## Local Development\n\n```bash\ngit clone https://github.com/pdajoy/tokendashboard.git\ncd tokendashboard\n\n# Install frontend deps + build dist\nnpm run build\n\n# Start the combined Node.js server (API + static frontend)\nnpm start\n# Open http://localhost:8787\n```\n\n### Dev mode with hot reload\n\n```bash\nnpm run dev\n# Vite dev server: http://localhost:5173\n# API server:     http://localhost:8787\n```\n\n## Environment Variables\n\n| Variable | Description | Default |\n|---|---|---|\n| `PORT` | HTTP port | `8787` |\n| `DATA_DIR` | Directory for `graph.json`, `pricing.json`, `settings.json` | `./data` (dev) / `~/.tokscale-dashboard/data` (installed) |\n| `FRONTEND_DIR` | Built frontend directory | `./frontend/dist` |\n| `API_ONLY` | Set to `1` to disable static serving (used in dev) | — |\n\n## API Endpoints\n\n| Endpoint | Method | Description |\n|---|---|---|\n| `/api/models` | GET | Model usage details, derived on the fly from `graph.json` |\n| `/api/monthly` | GET | Monthly summary, derived on the fly from `graph.json` |\n| `/api/graph` | GET | Daily contribution data |\n| `/api/pricing` | GET | Model pricing data |\n| `/api/meta` | GET | Data update timestamp |\n| `/api/export/csv` | GET | Export all data as CSV |\n| `/api/settings` | GET/POST | Read or update settings (tokscale runner, spec, extra args) |\n| `/api/refresh` | POST | Trigger data refresh. Body: `{ \"target\": \"all\" \\| \"graph\" \\| \"pricing\" }` |\n| `/api/health` | GET | Health check |\n\n## Project Structure\n\n```\ntokscale-dashboard/\n├── scripts/\n│   ├── server.mjs           # HTTP server + API routes + SPA serving\n│   ├── data-utils.mjs       # JSON derivation utilities (no deps)\n│   ├── data-refresh.mjs     # Internal data refresh (spawns tokscale CLI)\n│   ├── pricing-resolver.mjs # LiteLLM + OpenRouter pricing resolver \u0026 cache\n│   ├── settings.mjs         # Settings read/write\n│   └── dev.mjs              # Dev mode launcher (Vite + API)\n├── frontend/                # React app (Vite)\n│   ├── src/\n│   └── dist/                # Pre-built output (shipped with npm package)\n├── data/                    # Runtime data (local dev)\n└── docs/                    # Screenshots\n```\n\n## License\n\nMIT\n\n## Credits\n\n- Data powered by [tokscale](https://github.com/junhoyeo/tokscale) by Junho Yeo\n- Inspired by [token-insight](https://github.com/mo2g/token-insight)\n- Pricing data from [LiteLLM](https://github.com/BerriAI/litellm) and [OpenRouter](https://openrouter.ai)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdajoy%2Ftokendashboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpdajoy%2Ftokendashboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpdajoy%2Ftokendashboard/lists"}