pgx
PGX — Lightweight Postgres for AI agents. Written in Rust. Thousands of isolated databases in one runtime. 🐘
Translation pending
Self-hosted dashboard for tracking coding agent usage, costs, and statistics with beautiful charts and insights.
DataTypeScript · CSSGitHub @i-richardwangOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Self-hosted analytics dashboard for monitoring Claude Code API usage, token consumption, and subscription value
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
A self-hosted web dashboard for tracking Claude Code usage statistics with automatic data collection and synchronization.
• 📊 Usage Analytics: Track daily usage metrics including tokens, costs, and model usage
• 🔄 Auto Sync: Automatic data collection from local Claude Code usage
• 📱 Responsive Dashboard: Clean, modern UI built with shadcn/ui components
• 🏠 Self-Hosted: Deploy on your own infrastructure
• 🔧 Easy Setup: Simple configuration and deploymentRead the full README ↗A self-hosted web dashboard for tracking Claude Code usage statistics with automatic data collection and synchronization.
This is a monorepo built with:
├── apps/
│ └── web/ # Next.js dashboard application
├── packages/
│ ├── ui/ # Shared UI components (shadcn/ui)
│ ├── ccusage-collector/ # NPM package for data collection
│ ├── eslint-config/ # Shared ESLint configurations
│ └── typescript-config/ # Shared TypeScript configurations
git clone https://github.com/i-richardwang/MyCCusage.git
cd MyCCusage
pnpm install
# Set up your PostgreSQL database
cp apps/web/.env.example apps/web/.env.local
# Configure your database URL and API key
DATABASE_URL=postgresql://username:password@localhost:5432/myccusage
API_KEY=your-secret-api-key-here
# Run database migrations
cd apps/web
pnpm db:push
pnpm dev
Visit http://localhost:3000 to see your dashboard.
Install globally with Bun (recommended):
bun add -g ccusage-collector
Or with npm:
npm install -g ccusage-collector
Or run one-off commands without installing:
bunx ccusage-collector config
bunx ccusage-collector sync
# Interactive configuration
ccusage-collector config
# Install native background sync (macOS / Linux)
ccusage-collector service install
Native scheduling uses a macOS LaunchAgent or Linux systemd user timer, with no resident collector process. Inspect it with ccusage-collector service status and ccusage-collector service logs; remove it with ccusage-collector service uninstall.
For cloud or sandbox environments, inject MYCCUSAGE_API_KEY, MYCCUSAGE_ENDPOINT, MYCCUSAGE_AGENT_TYPES, and optional device variables, then run ccusage-collector sync directly. No JSON configuration is required; see the environment-only setup.
The ccusage-collector package automatically:
amp CLI (see the collector README)To import available Claude Code, Codex, OpenCode and Antigravity history older than the regular refresh
window, run ccusage-collector sync --full-history once. Add --dry-run to inspect
the upload first. Existing old days are preserved; only missing historical dates are filled. See the
collector backfill documentation.
Deploy the Next.js app to your preferred platform:
Supported PostgreSQL providers (PostgreSQL 15 or later):
Collectors and the dashboard must speak the same sync protocol, and each refuses the other otherwise. Update in this order:
pnpm db:migrate from apps/web/, then deploy the dashboard.# Development
pnpm dev # Start development server
pnpm build # Build all packages
pnpm lint # Lint all code
pnpm format # Format code with Prettier
# Database (run from apps/web/)
pnpm db:generate # Generate migration files
pnpm db:push # Push schema changes
pnpm db:migrate # Run migrations
pnpm db:studio # Open database studio
# Web App (run from apps/web/)
pnpm dev # Start Next.js dev server
pnpm build # Build production app
pnpm start # Start production server
pnpm lint # Run ESLint
pnpm typecheck # Run TypeScript checks
pnpm dlx shadcn@latest add button -c apps/web
This places components in packages/ui/src/components/ for shared use.
DATABASE_URL=postgresql://username:password@localhost:5432/myccusage
API_KEY=your-secret-api-key-here
# Optional: account time zone for daily buckets (default Asia/Shanghai)
USAGE_TIMEZONE=Asia/Shanghai
# Interactive configuration
ccusage-collector config
# Check configuration status
ccusage-collector status
# Test configuration and connection
ccusage-collector test
# Start scheduled sync
ccusage-collector service install
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)MIT License - see LICENSE file for details.