terminal-agents-usage
v0.2.1
Published
Unified usage dashboard for terminal AI coding agents (Claude Code, Codex, OpenClaw, etc.)
Maintainers
Readme
terminal-agents-usage
Unified usage tracker for terminal AI coding agents — scan local agent logs, store usage data in SQLite, and view dashboards with token counts and cost estimates.
Supported agents: Claude Code, OpenAI Codex, OpenClaw, DeepCode, Cursor, Gemini.
Install
npm install -g terminal-agents-usageOr run directly:
npx terminal-agents-usage scanTip: After global install, you can use either
terminal-agents-usageor the shorter aliasusage. Both are equivalent. Examples below useusagefor brevity.
Quick Start
The fastest way to get started — just launch the interactive terminal dashboard. It auto-scans your agent logs on first run:
npx terminal-agents-usage tuiPress s to re-scan anytime, r to refresh, ←/→ to switch tabs, q to quit.
Commands
scan
Scan local agent log files and populate the database.
usage scan # scan all agents
usage scan --agent claude # scan a specific agent
usage scan --rebuild # clear and re-scan from scratchData is stored in ~/.config/terminal-agents/usage.db by default. Override with --db-path.
today
Show today's token usage summary (terminal UI).
usage today
usage today --agent claudeweek
Show the last 7 days of usage, grouped by day and agent.
usage weekstats
Show all-time statistics — total sessions, total tokens, first/last usage per agent.
usage statsdashboard
Start a web dashboard with interactive Chart.js charts.
usage dashboard
usage dashboard --port 3000Open http://localhost:8080 to view daily charts, top projects, agent breakdowns, and cost estimates.
tui
Start the interactive terminal dashboard (built with Ink/React). Auto-scans on first run if no data exists. Press s to manually re-scan.
usage tuiHow it works
- Each agent keeps local log files (JSONL, JSON) of conversations with token usage metadata.
scanreads those files via agent-specific adapters and writes structured records into a local SQLite database.tuiauto-scans on first run, so you can jump straight in withnpx terminal-agents-usage tui.today/week/stats/dashboard/tuiquery the database and present the data.
Pricing
Cost estimates are calculated from published API pricing (Anthropic, OpenAI, Google). Pricing data is embedded in the tool and sent to the frontend for the web dashboard.
License
MIT
