pgx
PGX — Lightweight Postgres for AI agents. Written in Rust. Thousands of isolated databases in one runtime. 🐘
翻译准备中
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Self-hosted analytics dashboard for monitoring Claude Code API usage, token consumption, and subscription value
翻译准备中
取自仓库 README
正在加载完整 README。 以下为已保存的摘录。
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 deployment查看完整 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.