← Back to Leaderboard
Tjunhoyeo

junhoyeo/tokscale

Rust-powered CLI and web dashboard for cross-agent token usage and cost estimates

Engineering Health (Methodology)
A+ · 94/100
Maintenance Activity
● Updated yesterday
Latest Release
v4.24.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption19/25
Release Cadence20/20
License Clarity20/20
DockerSelf-HostedCLI
Total Stars
★ 5,949
24h Growth
+4
7d Growth
+44
Forks
489

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

junhoyeo/tokscale Star History (2025-12-20 - 2026-12-04) ALL-TIME STAR HISTORY (2025-12 – 2026-12) +5.9k in 349d · avg +17/day 6.3k 3.1k 0 2025-12-20: ★ 12026-01-17: ★ 3832026-02-14: ★ 6462026-03-14: ★ 1,1032026-04-11: ★ 1,7412026-05-09: ★ 2,6932026-06-06: ★ 3,4402026-07-04: ★ 4,0312026-08-01: ★ 4,6482026-08-29: ★ 5,1182026-09-26: ★ 5,4752026-10-24: ★ 5,6922026-11-15: ★ 5,8372026-12-04: ★ 5,949 ★ 5.9k 2025-12 2026-06 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Tokscale is a usage collector and reporting tool, not an agent runtime or an inference gateway. The tokscale npm alias installs @tokscale/cli with the required native Rust package, @tokscale/core. The core scans client-specific sources, parses usage records, and aggregates them for the Ratatui interface, plain tables, or JSON output. The sources are heterogeneous: OpenCode has SQLite and legacy message storage, Codex has live and archived JSONL rollouts, and some clients expose usage through APIs or caches.

The web frontend under packages/frontend is a separate surface for submitted usage, with public profiles at /u/[username], SVG embeds at /api/embed/[username]/svg, a leaderboard, and group pages. Docker Compose pairs the app with PostgreSQL. For integrations, the concrete interfaces are client-specific data ingestion and CLI exports; nothing in this reporting flow requires an MCP server or sending model requests through Tokscale.

Key Capabilities & Differentiators

Tokscale brings clients such as Claude Code, Codex, OpenCode, Gemini CLI, GitHub Copilot CLI, and Cursor into one reporting surface. Its ten default Ratatui views include subscription usage, models, time breakdowns, sessions, and projects; per-minute reporting is opt-in. Reports distinguish input, output, cache-read, cache-write, and reasoning tokens. Pricing is fetched from LiteLLM and cached on disk for one hour, with OpenRouter fallback and Cursor model pricing support.

Grouping choices determine what remains visible: --group-by model consolidates clients and providers, while --group-by client,provider,model keeps them separate. Workspace reports can merge Git worktrees with --merge-worktrees; machine reports can distinguish imported session folders using scanner.extraScanPaths and scanner.machineLabels. For scripts, session-and-model exports expose sessionId, and workspace exports carry workspaceKey and workspaceLabel.

Trade-offs & Limitations

Tokscale is most useful where provider dashboards are least comparable: usage spans multiple agents, and the question is which client, workspace, or session drove it. Provider billing remains authoritative for charges. Tokscale derives estimates from observed usage and price tables, so a reported cost is not an invoice or the amount paid under a subscription. Compared with a gateway that meters requests in transit, Tokscale can analyze existing records without rerouting inference traffic, but coverage depends on what each client logs or exposes.

Scan time and resource usage depend on the size and format of session histories, including any archives imported from other machines. Copying folders and assigning machine labels gives useful attribution, but is not centralized fleet collection. Local reporting also has a different exposure profile from publishing on the leaderboard: review what is submitted and displayed before using submit or autosubmit. Self-hosting gives control of the deployment, but still leaves responsibility for access, database backups, and updates with the operator.

Hardware & Deployment Guide

Run the CLI with npx tokscale@latest, bunx tokscale@latest, or deno x npm:tokscale@latest. Published packages include native binaries for supported targets. A source build uses Bun and the Rust toolchain, with bun run build:core to compile the required native component. For supported offline reports, use tokscale --offline; prefill the pricing cache while connected with tokscale pricing refresh --no-spinner if the offline reports need cost estimates.

For self-hosting, Compose uses the tokscale:latest image built by make docker/build, alongside postgres:16-alpine and a persistent postgres_data volume. The database port is bound to host loopback by default. When replacing the development credentials, keep the three POSTGRES_* settings and DATABASE_URL aligned. On the release side, v4.23.0 added Capy sync, including subscription usage without local session logs; v4.23.1 added Zed usage on ChatGPT subscriptions; v4.24.0 added custom date ranges to public profiles.

Source ingestion: Reads OpenCode SQLite and legacy message storage, Codex JSONL and compressed archives, and Copilot CLI usage events without requiring OTEL.
Archive deduplication: Counts copies of the same Codex rollout once when the same session appears in multiple archives.
Cost estimation: Uses LiteLLM pricing with a one-hour disk cache, OpenRouter fallback, and Cursor model pricing; distinguishes input, output, cache, and reasoning tokens.
Attribution: Groups reports by workspace, session, machine, or client and provider; --merge-worktrees folds Git worktrees into the parent repository for workspace reporting.
Reporting: Ratatui provides ten default views; JSON exports support scripting, and --offline runs supported local reports without network requests.
Publishing: Docker Compose pairs the web app with PostgreSQL 16; the web surface includes public profiles, SVG embeds, leaderboards, and groups.
Best For

Developers and teams using several coding agents who want to compare usage by model, workspace, session, or machine and export the results for internal reporting.

Skip If

You need invoice-grade reconciliation, enforced spending caps in the request path, or complete visibility into clients that do not log or expose usage.

Reviewed on 2026-12-04 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedCLI
# Run directly with npx
npx tokscale@latest

# Or use bunx
bunx tokscale@latest

# Or use Deno without installing an alias
deno x npm:tokscale@latest

# Light mode (table rendering only)
npx tokscale@latest --light

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/junhoyeo/tokscale.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

junhoyeo/tokscale Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about tokscale

How do I feed Tokscale data into an internal reporting pipeline?

Start with tokscale models --json for model totals or tokscale sessions --json --today for session records. For model-level joins, tokscale models --json --group-by session,model includes a top-level sessionId in each row. These are CLI exports; they do not require an MCP server.

Does Tokscale need a GPU, and what drives resource usage?

The CLI parses and aggregates usage records rather than running model inference, so there is no model-driven GPU or VRAM requirement. Size CPU, memory, and disk I/O around the volume of session history you scan, especially when importing archives from multiple machines. For self-hosting, size the web app and PostgreSQL separately.

Can a company self-host or modify Tokscale?

The repository is MIT-licensed, which permits commercial use and modification subject to the license terms, including retaining the required copyright and license notices when distributing copies. That license does not resolve data-handling or trademark questions. Review what the instance publishes before allowing submissions or enabling autosubmit.

When should I use Tokscale instead of a provider billing or quota dashboard?

Use provider billing for invoice reconciliation and provider or client quota views for entitlement checks. Use Tokscale to compare recorded activity across supported agents or attribute it to workspaces and sessions. Its estimates can be useful for investigation without matching the amount you actually paid.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining junhoyeo/tokscale? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature junhoyeo/tokscale on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare