Local-first usage tracker for AI coding assistants.
Website · Docs · Leaderboard · English | 中文
Track tokens, cost, sessions, models, projects, tool calls, and quota pressure across 20+ AI coding tools in one local dashboard. Local use needs no account, sends no telemetry, and does not require cloud sync.
Requirements: Node.js 20+ on macOS, Linux, or Windows.
npm install -g @juliantanx/aiusage
aiusage serve
Open http://127.0.0.1:3847 to use the dashboard. serve starts the local web UI immediately and parses local logs in the background during startup.
Prefer pnpm:
pnpm add -g @juliantanx/aiusage
Use Docker:
docker run -d \
-p 3847:3847 \
-e AIUSAGE_DASHBOARD_PASSWORD=change-me \
-v ~/.aiusage:/root/.aiusage \
juliantanx/aiusage
The container binds to 0.0.0.0 so it is reachable from outside Docker, and startup is refused unless AIUSAGE_DASHBOARD_PASSWORD is set to a non-empty value; replace change-me with your own password. Docker persists AIUsage data with the ~/.aiusage mount. To parse AI tool logs from the host, also mount each source log directory and configure the matching AIUSAGE_*_PATH variable. See the Docker docs.
| Command | What it does |
|---|---|
aiusage / aiusage summary | Print a terminal summary |
aiusage parse | Parse supported local AI tool logs |
aiusage serve | Start the local dashboard on port 3847 |
aiusage status | Show data source and local database status |
aiusage export --range month | Export usage data |
aiusage init | Configure optional sync |
aiusage github login --repo OWNER/REPO | Connect GitHub sync with the GitHub App |
aiusage sync | Sync with the configured backend |
aiusage sync --repair | Inspect and repair cross-device sync contamination (dry run by default) |
aiusage widget | Launch the desktop tray widget |
aiusage leaderboard | View public leaderboard rankings |
aiusage login / aiusage upload | Authorize this device and upload aggregate leaderboard data |
aiusage pm2-start | Run dashboard and widget as PM2 background services |
Full CLI reference: aiusage.jtanx.com/docs#cli-reference.
Claude Code | Codex | OpenCode | Cursor | Hermes |
Qoder | OpenClaw | KiloCode | Kelivo | Copilot |
Gemini CLI | Kimi Code | CodeBuddy | Kiro | Grok Build |
Antigravity | Roo Code | Zed | Goose | oh-my-pi |
pi | Craft | Droid | ZCode | CodeFuse |
Trae |
Default paths and environment variable overrides are documented in Data Sources and Source Env Vars.
The dashboard binds to 127.0.0.1 by default. Use aiusage serve --host ::1 for IPv6 loopback. Local access can remain passwordless; set AIUSAGE_DASHBOARD_PASSWORD to require authentication for detailed APIs, including the detailed summary, quotas, and settings. Only the aggregate totals shown on the home page stay public, through the minimal /api/home-summary endpoint.
| Shell | Command |
|---|---|
| macOS / Linux | AIUSAGE_DASHBOARD_PASSWORD="change-me" aiusage serve |
| Windows PowerShell | $env:AIUSAGE_DASHBOARD_PASSWORD="change-me"; aiusage serve |
| Windows CMD | set AIUSAGE_DASHBOARD_PASSWORD=change-me && aiusage serve |
To allow network access, explicitly use aiusage serve --host 0.0.0.0 (or --host :: for IPv6) and set a non-empty AIUSAGE_DASHBOARD_PASSWORD; startup is refused without it. The Docker image uses this explicit network binding, so the password is mandatory there. For remote access, use HTTPS through a trusted reverse proxy that preserves the browser-facing Host header and replaces X-Forwarded-Proto with the browser-facing scheme.
The API accepts same-origin browser requests only; cross-origin integrations are no longer supported. Native local clients can omit Origin. Credential settings show configured state and accept replacements; existing secret values and credential references are never returned. Blank credential fields keep the saved value. See local API security and compatibility.
For PM2 background services, pass the same variable when starting aiusage pm2-start, and use pm2 restart aiusage-server --update-env after changing it. Details: Dashboard Password and PM2.
AIUsage is designed to be local-first.
~/.aiusage/cache.db.Security issues should be reported privately when possible. See SECURITY.md.
Sync and leaderboard are independent optional features.
aiusage init, then run aiusage sync.
GitHub sync prefers aiusage github login --repo OWNER/REPO or Connect GitHub in local settings, using a least-privilege GitHub App without an AIUsage account. Fine-grained PATs remain an advanced fallback. See GitHub App setup and migration.aiusage login, then aiusage init --backend cloud and aiusage sync.aiusage sync --repair to inspect them before applying cleanup. See the sync repair guide. Every device namespace is an authoritative snapshot of that device; see the sync model.aiusage login, then run aiusage upload.The official site handles accounts, OAuth login, profile settings, authorized devices, upload review status, and admin moderation. The CLI handles local parsing, local dashboards, sync, terminal summaries, and signed uploads.
Install the optional tray/menu-bar widget:
npm install -g @juliantanx/aiusage-widget
aiusage-widget
The widget reads the same local AIUsage database and can open the full dashboard from its tray menu. See Widget docs.
git clone https://github.com/juliantanx/aiusage.git
cd aiusage
pnpm install
pnpm build
pnpm test
pnpm dev
pnpm dev builds the shared packages and starts only the local dashboard at http://127.0.0.1:3847. To develop account, authorization, or cloud-sync flows against the local official site, run pnpm dev:site separately on port 4000 and set SITE_URL=http://localhost:4000 in packages/cli/.env. Without that override, the CLI uses https://aiusage.jtanx.com.
Project layout:
| Path | Purpose |
|---|---|
packages/core | Shared types, schema, pricing, and utilities |
packages/cli | Published CLI, parsers, local API server, sync, PM2 helpers |
packages/web | Local dashboard UI bundled into the CLI |
packages/widget | Electron tray/menu-bar widget |
packages/site | Official website, docs, accounts, uploads, leaderboard |
Contributions are welcome. Read CONTRIBUTING.md, use the issue templates, and run pnpm test before opening a PR.
Thanks to these wonderful people (emoji key):
Julian 💻 📖 🚇 🔧 | Fiveonine 💻 | joyshan1986 💻 | zhaolu83949426-hub 💻 | Mnoisec 💻 | jlxyfll 💻 | Harlan Hu 💻 |
Mingde 🐛 | Aaron C 💻 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!
linux.do - thanks to the linux.do community for support and inspiration during the development of this project.
Content type
Image
Digest
sha256:7ccbf0ea0…
Size
239.4 MB
Last updated
about 23 hours ago
docker pull juliantanx/aiusage