Skip to content

bluvenr/tokenowl

Repository files navigation

TokenOwl

TokenOwl

AI Coding Cost Tracker — CC Switch's Data Analysis Partner

English | 中文

Tauri v2 React 19 Rust 2021 MIT License


Overview

TokenOwl is a desktop application for tracking AI coding assistant costs by analyzing proxy data from CC Switch. It provides detailed usage analytics, budget management, and cost attribution across multiple AI providers.

Features

  • Dashboard — Real-time usage summary with cost, token count, and request statistics
  • Cost Attribution — Break down costs by model, provider, and token type (input/output/cache)
  • Budget Management — Set daily/weekly/monthly spending limits with configurable alert thresholds
  • Provider Analytics — Track usage distribution and health across AI providers
  • CC Switch Integration — One-click data sync from CC Switch proxy logs
  • Tray Mini Mode — Compact always-on-top widget showing today's token usage and budget progress
  • Data Export — Export usage data as CSV or JSON
  • i18n — Full English and Chinese language support with system auto-detection
  • Auto Update — Built-in update checker for new releases

Tech Stack

Layer Technology
Framework Tauri v2
Frontend React 19 + TypeScript
UI TailwindCSS 4 + Radix UI + Lucide Icons
State Zustand 5
Charts Recharts
i18n i18next
Backend Rust (rusqlite, tokio, reqwest)
Database SQLite (bundled)

Development

Prerequisites

Setup

# Clone the repository
git clone https://github.com/bluvenr/tokenowl.git
cd tokenowl

# Install dependencies
pnpm install

# Start development
pnpm tauri dev

# Build for production
pnpm tauri build

Project Structure

app/
├── src/                    # Frontend source
│   ├── components/         # React components
│   │   ├── dashboard/      # Dashboard widgets
│   │   └── settings/       # Settings tabs
│   ├── pages/              # Page components (App, TrayPopup)
│   ├── stores/             # Zustand state stores
│   ├── i18n/               # Translation files (en, zh-CN)
│   ├── lib/                # Utilities and API wrappers
│   └── styles/             # Global CSS
├── src-tauri/              # Rust backend
│   ├── src/
│   │   ├── commands/       # Tauri command handlers
│   │   ├── storage/        # SQLite database layer
│   │   ├── ccswitch/       # CC Switch integration
│   │   ├── pricing/        # Price registry
│   │   └── ...
│   ├── capabilities/       # Tauri v2 permissions
│   └── tauri.conf.json     # Tauri configuration
└── public/                 # Static assets

License

MIT

About

AI Coding Cost Tracker — CC Switch's Data Analysis Partner(AI 编码成本追踪器 — CC Switch 数据分析伙伴)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors