Skip to content

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.

bash
# 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
FlagDescription
(positional)Application name (required)
--prodDeploy 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.).

bash
optimal infra health

Reports 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.

bash
# 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
FlagDescription
--targetSupabase instance: returnpro or optimalos (required)
--dry-runPreview 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.

bash
optimal infra migrate pending --target returnpro
optimal infra migrate pending --target optimalos
FlagDescription
--targetSupabase instance: returnpro or optimalos (required)

infra migrate create

Create a new migration file.

bash
optimal infra migrate create --target returnpro --name add-budget-columns
FlagDescription
--targetSupabase instance: returnpro or optimalos (required)
--nameMigration 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.

bash
optimal infra doctor
optimal infra doctor --fix
optimal infra doctor --name oracle --fix
FlagDescription
--nameInstance name (default: hostname)
--fixAuto-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.

bash
optimal infra heartbeat
optimal infra heartbeat --name oracle
optimal infra heartbeat --install
optimal infra heartbeat --dry-run
FlagDescription
--nameInstance name (default: hostname)
--installInstall as cron job (every 5 min)
--dry-runShow payload without sending

infra instances

List registered instances and their live status.

bash
optimal infra instances
optimal infra instances --name oracle
optimal infra instances --json
FlagDescription
--nameShow detail for a single instance
--jsonOutput as JSON

infra repos

Show git repo status and Vercel deployment status.

bash
optimal infra repos
optimal infra repos --json
FlagDescription
--jsonOutput as JSON

Built by Carlos Lenis in Miami