CLI Commands
This page is the complete command reference. Each command auto-detects
mountsqli.config.* from the current directory.
migrate generate
Section titled “migrate generate”Create a migration file from schema changes.
mountsqli migrate generate [--name <n>] [--dir <path>]| Option | Effect |
|---|---|
--name <n> |
custom migration name |
--dir <path> |
migrations directory override |
Output: Created migration: <file> (writes SQL, does not apply).
migrate apply
Section titled “migrate apply”Run pending migrations in transactions.
mountsqli migrate apply [--dir <path>] [--dry-run]| Option | Effect |
|---|---|
--dir <path> |
migrations directory override |
--dry-run |
print SQL, don’t execute |
Output: Applying <file> ... done per step, then Applied N migration(s).
migrate status
Section titled “migrate status”Show applied and pending migrations.
mountsqli migrate statusOutput: lists Applied: and Pending: migration names.
Run the all-in-one server: REST + storage + realtime + Studio.
mountsqli dev [--port <n>]| Option | Effect |
|---|---|
--port <n> |
port (default 3737) |
Output: REST/STORE/LIVE/STUDIO on http://localhost:<port>
analyze
Section titled “analyze”Health report: schema drift, index suggestions, plan warnings.
mountsqli analyzeOutput: a structured report (drift vs live DB, suggested indexes, warnings).
api generate
Section titled “api generate”Emit OpenAPI JSON from named QueryPlans.
mountsqli api generate [--out <path>]Reads the output path from mountsqli.config.js or defaults to openapi.json.
Scaffold a mountsqli.config.ts in the current directory.
mountsqli initBest practices
Section titled “Best practices”- Script
migrate applyinto deploys; runanalyzein CI. - Use
--dry-runbefore applying to production.
Common mistakes
Section titled “Common mistakes”- Expecting
migrate rollback(not provided — see Migrations → Rollback). - Running
devandmigrateagainst different databases (:memory:vs file).
Related
Section titled “Related”- Overview — command summary.
- mountsqli dev — the server in depth.
