CLI Commands & Flags
Subcommands
Section titled “Subcommands”microbase serve(default) — Start HTTP API server and embedded Admin UI.microbase init-config [--path <path>] [--force]— Generatemicrobase.conf(mode0600) with freshJWT_SECRETandENCRYPTION_KEY.microbase update [--check] [--dry-run] [--to vX.Y.Z]— Check, dry-run verify SHA-256, or self-update/rollback binary.microbase superuser [--config <path>] [--db <url>] upsert <email> <password>— Create or reset a superuser account.microbase migrate [--config <path>] [--migrationsDir ./mb_migrations] <up|down|status|create <name>|snapshot>— Run file-based migrations.microbase version(or-v,--version) — Print current version and exit.
Serve Flags
Section titled “Serve Flags”| Flag | Env Var | Default | Description |
|---|---|---|---|
-c, --config <path> |
— | auto | Path to microbase.conf |
--db <url> |
DATABASE_URL |
— | Override PostgreSQL URL |
--dir <path> |
DATA_DIR |
./storage |
Local storage directory |
--http <addr> |
— | 0.0.0.0:3000 |
Listen address (host:port) |
--host / --port |
HOST / PORT |
0.0.0.0 / 3000 |
Listen host and port |
--origins <list> |
CORS_ORIGINS |
* |
Comma-separated CORS origins |
--no-ui |
DISABLE_ADMIN_UI=true |
false |
Headless API-only mode |
--dev |
DEV=true |
false |
Verbose debug logging |
--hooksDir <path> |
HOOKS_DIR |
./mb_hooks |
JS hooks directory |
--migrationsDir <p> |
MIGRATIONS_DIR |
./mb_migrations |
Migrations directory |