Files
Dani 7cb214e083 feat: Add command usage tracking system to Neon Database
This update adds comprehensive tracking of CLI command executions
to understand community usage patterns of the npm package.

**What's New:**
- Command usage logging in Neon Database with PostgreSQL
- Tracks: --chats, --analytics, --health-check, --plugins, --sandbox, and more
- API endpoint: /api/track-command-usage with validation
- Comprehensive test suite (18/18 tests passing)
- Fire-and-forget tracking (non-blocking, respects privacy)
- Auto-aggregated statistics with PostgreSQL triggers
- Useful views: daily usage, platform distribution, popular commands

**Technical Details:**
- Database: Neon PostgreSQL (separate from Supabase component downloads)
- Endpoint: https://www.aitmpl.com/api/track-command-usage
- Privacy: Respects CCT_NO_TRACKING environment variable
- Metadata: Includes tunnel usage, platform, Node version, etc.

**Files Changed:**
- api/track-command-usage.js - New endpoint for command tracking
- database/migrations/002_create_command_usage_logs.sql - Database schema
- cli-tool/src/tracking-service.js - Added trackCommandExecution()
- cli-tool/src/index.js - Integrated tracking for 10+ commands
- api/__tests__/endpoints.test.js - Added comprehensive tests

🤖 Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-01 15:21:28 -04:00
..