Skip to content

Commands

Provisioning

CommandWhat it does
backoffice:setupCreate the backoffice schema and run satellite migrations. Idempotent.
tenant:create <name> <email>Insert a tenant row and queue InstallTenant.
tenant:listList tenants with current status. --all includes soft-deleted.
tenant:activate <id>Activate a suspended or failed tenant.
tenant:suspend <id>Block all API access without dropping the schema.
tenant:destroy <id>Soft-delete and tear down. --force skips prompt; --keep-schema preserves storage during retention.

Migrations

CommandWhat it does
migration:tenant:run / tenant:migrateRun pending migrations against one or all tenants. --dry-run, --disable-locks, --verbose.
migration:tenant:rollback / tenant:migrate:rollbackRoll back the last migration batch.
tenant:migrate:freshDROP and recreate per-tenant storage, then re-run migrations. Destructive. --force, --seed.
tenant:seeddb:seed per tenant. --files cherry-picks specific seeders, --continue-on-error keeps going.

Operations

CommandWhat it does
tenant:backupOne-shot backup for one or all active tenants (synchronous).
tenant:backups:runCron-friendly: backs up tenants whose tier interval has elapsed, then applies retention. --dry-run, --no-retention.
tenant:backup:listList available backups.
tenant:restore --tenant=<id> --file=<name>Restore a tenant schema from a .dump file.
tenant:import --tenant=<id> --file=<path>Import a pg_dump .sql file into a tenant schema.
tenant:clone --source=<id> --name=<name> --email=<email>Provision a new tenant by cloning an existing one. --schema-only, --clear-sessions.
tenant:queue:statsBullMQ queue statistics.

Doctor

tenant:doctor is the operational health command. Ten built-in checks, --fix to auto-recover, --json for CI gates, --watch for a live TUI.

bash
# Run every check, table output
node ace tenant:doctor

# Limit to one tenant
node ace tenant:doctor --tenant=<id>

# Run a specific check; --check=list prints available checks
node ace tenant:doctor --check=schema_drift,backups

# Auto-fix what's fixable
node ace tenant:doctor --fix

# CI gate: exits non-zero if anything is unhealthy
node ace tenant:doctor --json

# Live dashboard, refreshes every 5 s
node ace tenant:doctor --watch --interval=5000

Exec-under-tenant

bash
# Run any ace command inside one or more tenant contexts
node ace tenant:exec list:routes
node ace tenant:exec --tenant=<id> make:migration users
node ace tenant:exec --status=active db:seed
FlagPurpose
--tenant=<id...>Target one or more tenants. Omit to iterate every tenant.
--status=<status...>Filter (active, provisioning, suspended, failed, deleted).
--include-deletedInclude soft-deleted in the iteration.
--limit=<n>Stop after N tenants.
--batch-size=<n>Cursor batch size (default 100).
--continue-on-errorDon't bail on a tenant failure.
--dry-runReport which tenants would run.

Maintenance and impersonation

CommandWhat it does
tenant:maintenance <id>Toggle maintenance mode (independent of suspended). --off exits, --message="…" shows a custom 503 message.
tenant:impersonate <tenantId> <userId>Issue an admin impersonation token. --admin=<id>, --duration=<seconds>, --reason="…", --path=<path>.

Background tasks

CommandWhat it does
tenant:webhooks:retryProcess pending webhook retries. Cron: * * * * *.
tenant:metrics:flushFlush Redis metric counters to the database. Cron: 0 1 * * *.
tenant:purge-expiredDrop schemas of soft-deleted tenants past their retention window. Cron: 0 3 * * *.

Billing

Available when --with=billing is configured. Full reference in the Billing satellite.

CommandWhat it does
tenant:billing:syncReconcile Stripe subscriptions with the local mirror; recovers from missed webhooks. Flags: --dry-run, --tenant=<id>, --since=<iso>, --json. Cron: 0 4 * * *.
tenant:billing:backfillSeed tenant_plans rows with the default plan for every tenant that doesn't have one. Flags: --dry-run, --force, --plan=<name>.
tenant:billing:replayRe-dispatch a failed webhook event after the underlying issue is fixed. Flags: --event-id=<evt>, --all-failed.
tenant:billing:cleanupPurge stripe_processed_events older than webhook.idempotencyTtlDays. Flag: --batch-size=<n>. Cron: 0 4 * * *.
tenant:billing:doctorDiagnose Stripe config + recent webhook health. Exit 1 on any error (pipeline-friendly). Flag: --json.
tenant:billing:test-webhook <event>Generate and POST a signed synthetic Stripe event. Flags: --url=<url>, --object=<file>. Useful in CI without stripe listen.

REPL

bash
node ace tenant:repl <tenantId>

Drops you into a REPL with tenant, db, audit, metrics, and the rest of the satellite services preloaded against the chosen tenant context.

  • Doctor; see above; the killer feature.
  • Cookbook; recipes that compose multiple commands.

Was this page helpful?

Released under the MIT License.