feat(cli): add express checkup command with direct PostgreSQL health checks + fix H004 and A003
Summary
Adds express checkup command to the CLI that generates PostgreSQL health check reports directly from the database, without requiring Prometheus infrastructure.
Key features:
- New
postgresai checkupcommand for direct database health analysis - Support for 11 check types: A002, A003, A004, A007, A013, D004, F001, G001, H001, H002, H004
- Automatic upload to PostgresAI Console (optional, requires API key)
- JSON output mode for scripting and automation
- Build-time embedding of SQL metrics for smaller bundle size
Changes
CLI (cli/)
- Added
checkupcommand with connection handling, SSL fallback, and progress spinner - Added
set-default-projectcommand for storing upload preferences - New modules:
checkup.ts(report generators),checkup-api.ts(RPC client),metrics-loader.ts - Build script to embed metrics.yml at compile time
- Preserves
defaultProjecton re-authentication
Reporter (reporter/)
- Added
generation_modefield to distinguish "express" vs "full" reports - Added
redundant_toarray to H004 schema for better index relationship tracking - New helper methods for filtering A003 settings by report type (D004, F001, G001)
Metrics (config/pgwatch-prometheus/metrics.yml)
- Enhanced
settingsmetric withsetting_normalizedandunit_normalizedfields - Updated
redundant_indexesto outputredundant_to_jsonwith index sizes - Added
index_definitiontounused_indexesmetric
Edited by Nikolay Samokhvalov