ai-tracker
v0.1.8
Published
AI Tracker is a local-first Next.js application designed to monitor, analyze, and estimate costs for your AI CLI tools. By reading the local log files generated by AI assistants, it provides a unified dashboard to track your usage and expenses.
Downloads
431
Readme
AI Tracker
AI Tracker is a local-first Next.js application designed to monitor, analyze, and estimate costs for your AI CLI tools. By reading the local log files generated by AI assistants, it provides a unified dashboard to track your usage and expenses.
Features
- Multi-CLI Support: Currently tracks usage from:
- Antigravity CLI (
~/.gemini/antigravity-cli/brain) - Claude Projects (
~/.claude/projects)
- Antigravity CLI (
- Cost Estimation: Calculates approximate token usage and costs based on the specific pricing models of the underlying AI tools (e.g., Gemini 1.5 Pro, Claude 3.5 Sonnet), including cache hits.
- Filtering: Filter sessions by specific CLI tools and time ranges (Today, Last 7 Days, All Time).
- Currency Toggle: View estimated costs in USD or EUR.
- Privacy-First: All data parsing happens locally on your machine. No logs are uploaded to any external servers.
How It Works
Because the application needs to read logs from your system's home directory (like ~/.gemini or ~/.claude), it runs as a local Next.js server. The backend API (src/app/api/stats/route.ts) directly accesses the file system to parse .jsonl transcript files, aggregates the token counts, and calculates the costs before sending the data to the frontend dashboard.
Quick Start (NPM)
The easiest way to use AI Tracker is to run it directly via npx (no installation required):
npx ai-trackerAlternatively, you can install it globally on your system so it's always available:
npm install -g ai-tracker
# or
pnpm add -g ai-tracker
# Then run:
ai-trackerOnce running, the dashboard will automatically open in your browser at http://localhost:14832.
Local Development
If you want to modify the code or contribute to the project:
- Clone the repository and install dependencies:
pnpm install- Start the development server:
pnpm devOpen http://localhost:14832 with your browser to see your stats dashboard.
