Infrastructure Commands
The infra command group manages deployments, service health checks, and Supabase database migrations across the Optimal platform.
Commands
infra deploy
Deploy an application to Vercel.
# Deploy to preview
optimal infra deploy optimalos
# Deploy to production
optimal infra deploy optimalos --prod
# Deploy a different app
optimal infra deploy dashboard-returnpro --prod| Flag | Description |
|---|---|
| (positional) | Application name (required) |
--prod | Deploy to production (default is preview) |
TIP
Preview deployments generate a unique URL for testing. Only use --prod when the changes are verified and ready for production traffic.
infra health
Check the health of all registered services (OptimalOS, n8n, Strapi, Cloudflare Tunnel, etc.).
optimal infra healthReports the status of each service including response time and any errors. Useful for a quick overview of the platform's operational state.
infra migrate push
Run pending Supabase migrations against a target instance.
# Push migrations to ReturnPro
optimal infra migrate push --target returnpro
# Preview without applying
optimal infra migrate push --target returnpro --dry-run
# Push to OptimalOS instance
optimal infra migrate push --target optimalos| Flag | Description |
|---|---|
--target | Supabase instance: returnpro or optimalos (required) |
--dry-run | Preview migrations without applying |
WARNING
Always use --dry-run first to review migration SQL before applying to production databases.
infra migrate pending
List migrations that have not yet been applied.
optimal infra migrate pending --target returnpro
optimal infra migrate pending --target optimalos| Flag | Description |
|---|---|
--target | Supabase instance: returnpro or optimalos (required) |
infra migrate create
Create a new migration file.
optimal infra migrate create --target returnpro --name add-budget-columns| Flag | Description |
|---|---|
--target | Supabase instance: returnpro or optimalos (required) |
--name | Migration name (used in the filename, required) |
This creates a timestamped SQL file in the appropriate migrations directory, ready for you to add your schema changes.
infra doctor
Setup, diagnose, and maintain this optimal-cli instance.
optimal infra doctor
optimal infra doctor --fix
optimal infra doctor --name oracle --fix| Flag | Description |
|---|---|
--name | Instance name (default: hostname) |
--fix | Auto-fix issues (install cron, register instance, etc.) |
TIP
optimal doctor is a top-level alias for optimal infra doctor.
infra heartbeat
Send an instance heartbeat to the monitoring dashboard.
optimal infra heartbeat
optimal infra heartbeat --name oracle
optimal infra heartbeat --install
optimal infra heartbeat --dry-run| Flag | Description |
|---|---|
--name | Instance name (default: hostname) |
--install | Install as cron job (every 5 min) |
--dry-run | Show payload without sending |
infra instances
List registered instances and their live status.
optimal infra instances
optimal infra instances --name oracle
optimal infra instances --json| Flag | Description |
|---|---|
--name | Show detail for a single instance |
--json | Output as JSON |
infra repos
Show git repo status and Vercel deployment status.
optimal infra repos
optimal infra repos --json| Flag | Description |
|---|---|
--json | Output as JSON |