Browse documentation

@motherbase/cli builds every help screen and every dispatch from a single command registry in packages/cli/src/commands. The sections below are the commands with something to explain beyond their usage line; every command at the bottom of this page is generated from that same registry, so it cannot be a subset of what the CLI ships.

Global flags

motherbase <command> [subcommand] [args] [flags]
motherbase -h
motherbase --version
FlagDescription
-o, --outputpretty (default), json, yaml or env
--jsonShorthand for --output json. The two stay in step: --json sets the format, and --output json sets --json
--yes, -ySkip confirmation prompts where supported
--project, -p, --project-refSelect a project without reading .motherbase/config.json. --project-ref is Supabase's spelling, accepted as an alias
--url, -uSelect the Platform Console URL
--tokenUse or store a Console token without reading global config
--workdirResolve the project link and any relative path from this directory instead of the current one
--debugOne line per HTTP request on stderr, never the body. Same as MOTHERBASE_DEBUG=1
-h, --helpShow help
-v, --versionShow version

--version is only read as the version flag when no command was given, because motherbase migration squash --version <v> is Supabase's own flag and has to keep working.

Connection

motherbase login [--url <consoleUrl>] [--email <email>] [--password <password>] [--token <token>]
motherbase logout [--url <consoleUrl>]
motherbase whoami
motherbase link [projectNameOrId]
motherbase unlink
motherbase status

login posts to /api/auth/sign-in/email on the Console and stores the returned token. Omit --email/--password and it prompts. With --token it stores a token directly and makes no request, which is the CI form.

link writes .motherbase/config.json in the current directory. status prints Console URL, login state, active mode, linked project, and project health.

Where admin commands go. Everything below that touches a project resolves its base URL from the link file:

ModeBase
Console (linked project)<consoleUrl>/api/projects/<projectId>/admin
Direct (--url of a project API)<projectUrl>/api/admin

The /api/admin/... paths named per section are the direct-mode form; the Console proxies the same routes.

Projects

motherbase projects list
motherbase projects create <name> [--domain <domain>]
motherbase projects start <id>
motherbase projects stop <id>
motherbase projects restart <id>
motherbase projects update <id>
motherbase projects rebuild <id>
motherbase projects delete <id> --confirm <id>
motherbase projects logs <id> [-f]
motherbase projects info <id>
motherbase projects limits <id> [--api-cpus n --api-mem mb --db-cpus n --db-mem mb --minio-cpus n --minio-mem mb]

These commands call /api/platform/* on the Platform Console. Deleting a project requires --confirm <id>. logs -f polls the snapshot endpoint every 3 seconds.

Local stack

motherbase init [dir]
motherbase start
motherbase stop
motherbase deploy
motherbase logs [service...]

These commands are local Docker Compose wrappers and do not require Console login.

init scaffolds a directory that actually starts: a docker-compose.yml whose images build from the public repository (so no checkout and no registry are needed), and a .env with secrets generated for this install. It prints the Studio URL and the first operator's credentials.

FlagEffect
--portAPI and Studio port, default 5001
--postgres-portHost port for PostgreSQL, default 55432, bound to loopback
--repo / --refBuild images from another repository or branch
--admin-emailFirst operator account, default admin@example.com
--admin-passwordPassword for that account. Omit it and one is generated and printed
--forceOverwrite an existing .env and compose file

--force discards the secrets in the existing .env, which is the only copy of the key your existing data was encrypted with. Without it, existing files are kept and reported rather than replaced.

start, stop, deploy and logs refuse to run in a directory with no compose file, and name motherbase init as the fix.

Database

motherbase db tables
motherbase db sql -e "select 1"
motherbase db sql <file.sql>
motherbase db dump [file]
motherbase db restore <file> --confirm
motherbase db restore --key <remoteKey> --confirm
motherbase db backups
motherbase db backups list
motherbase db backups config
motherbase db backups config --set key=value --set key2=value2

db sql uses /api/admin/sql; projects can disable raw SQL with CONSOLE_SQL_ENABLED=false. Backups use /api/admin/backups/*.

Migrations

motherbase migration new <name>
motherbase migrations list
motherbase migrations diff
motherbase migrations get <id>
motherbase migrations create --name <name> --up <file.sql> [--down <file.sql>]
motherbase migrations apply <id>
motherbase migrations rollback <id>

migration new creates a local timestamped SQL file. migrations * uses the server-side schema migration API.

Supabase import

motherbase import --from-supabase <connectionString>   [--service-role-key <key>] [--management-token <sbp_...>]   [--preview] [--no-data] [--no-auth] [--no-storage] [--no-edge-functions] [--no-secrets]

Imports a Supabase project into the linked Motherbase project. Six sections, three credentials:

CredentialUnlocks
--from-supabase (required)public schema, table data, RLS policies, email/password users, bucket catalog
--service-role-keyThe storage objects' bytes. Without it, buckets are created empty
--management-tokenEdge functions (ported from Deno) and project secrets

Each section is independent. A missing credential downgrades that section to a note instead of failing the import, and a failing section never takes another down. --preview is a dry run. Without --yes the CLI asks for confirmation first.

None of the three credentials is logged, written to disk, or echoed back in the summary.

See Migrate from Supabase for the full migration workflow.

Port the application code

motherbase migrate codemod <dir> [--write]

Rewrites @supabase/supabase-js to @motherbase/client and @supabase/ssr to @motherbase/ssr in every source file under <dir>, and reports the calls this SDK does not implement, with a line number and what to do instead.

Without --write nothing is touched — it prints what it would rewrite. Run it that way first.

Deliberately a text pass rather than an AST pass, so the CLI does not carry a TypeScript parser: import specifiers and method names do not need one. The cost is that a match inside a comment or a string still gets reported, which is the right direction to be wrong in for a list a human reads.

RLS

motherbase rls list
motherbase rls enable <table>
motherbase rls disable <table>
motherbase rls policy create --table <table> --name <name> --command <SELECT|INSERT|UPDATE|DELETE|ALL> [--using <expr>] [--check <expr>] [--roles anon,authenticated]
motherbase rls policy delete <table> <name>
 
motherbase rls preset <table> <preset> [--owner-column c] [--org-column c] [--org-claim c] [--deleted-column c] [--replace]
motherbase rls simulate --sql "select * from t" [--as anon|authenticated|<userId>] [--claims '{"org_id":"x"}'] [--limit n]
motherbase rls lint [--level critical|warning|info]

Policies are real PostgreSQL policies, the same objects shown in Project Studio -> Policies.

rls preset applies one of the shipped policy sets in a single step: starter, public_crud, authenticated_crud, admin_only, blocked, owner_only, org_scoped, public_read_owner_write, soft_delete. --replace drops the table's existing policies first instead of adding to them.

rls simulate runs a query as a given caller and shows what RLS actually lets through — the CLI form of the Studio's policy simulator. rls lint runs the same security and performance advisor as motherbase inspect advisor, filtered by level.

Users

motherbase users list
motherbase users get <id>
motherbase users create --email <email> --password <password> [--name <name>] [--role USER|ADMIN]
motherbase users update <id> [--email <email>] [--name <name>] [--role USER|ADMIN]
motherbase users delete <id>
motherbase users reset-password <id> [--password <password>]
motherbase users promote <id>
motherbase users demote <id>
motherbase users revoke-sessions <id>

These commands operate project auth users through /api/admin/users/*.

Storage

motherbase storage buckets list
motherbase storage buckets create <slug> [--name <name>] [--visibility public|private]
motherbase storage buckets delete <slug> [--force]
motherbase storage ls [bucket]
motherbase storage cp <local-file> <bucket[:path]> [--visibility public|private]
motherbase storage cp <fileId> <local-file>
motherbase storage rm <id>

Uploads go through /api/admin/storage/files; downloads stream /api/admin/storage/files/:id/raw. Object identity is the server file id.

Edge functions

motherbase functions list
motherbase functions get <id>
motherbase functions new <name>
motherbase functions deploy [name] [--memory <mb>] [--timeout <ms>]
motherbase functions deploy --file <file.ts> --route <route> [--name <name>]
motherbase functions pull [name]
motherbase functions serve [name]
motherbase functions delete <id>
motherbase functions invoke <route> [--body <json>]
motherbase functions logs <id>

new scaffolds functions/<name>/index.ts and, the first time, writes functions/motherbase.d.ts next to it: the declarations for the globals the runtime injects (env, context, sendMail), so an editor stops flagging them. The file is generated and never overwritten — delete it and scaffold again to refresh it.

invoke runs a deployed function as you, the operator: it looks the route up and calls POST /admin/edge-functions/:id/invoke, the same call as Studio's Run, so it needs no EDGE_INVOKE_TOKEN and works whether or not public invocation is enabled. The public /api/edge/<route> URL is for the function's own callers, and the Console proxy strips your session before forwarding there.

deploy with no argument deploys every function under the local functions/ directory; with a name, just that one. The --file form is the older single-file path and is still supported. Either way the deploy upserts by route: it patches the existing function when the route is already taken, otherwise it creates one.

pull writes deployed function source back to disk — the inverse of deploy, and the way to recover a function that was edited in Studio. serve watches local function files and redeploys on every save, which is the local development loop.

Secrets

motherbase secrets list
motherbase secrets set <NAME> <value>
motherbase secrets unset <NAME>

Secrets are injected into edge functions when EDGE_SECRETS_ENABLED=true.

API keys

motherbase keys list
motherbase keys create <NAME> [--type publishable|secret]
motherbase keys revoke <ID>

A publishable key identifies the project and is safe in a browser bundle; a secret key runs requests as service_role and bypasses row level security. --type defaults to secret. A secret key is printed once at creation and stored hashed, so it can never be shown again.

Different from secrets above: those are values an edge function reads, these are what a client presents to reach the project. See API Keys.

Realtime

motherbase realtime config
motherbase realtime config --models todo,products
motherbase realtime channels

Realtime config maps to /api/admin/realtime/config. channels lists active server-side realtime channels.

Webhooks

motherbase webhooks list
motherbase webhooks create --name <name> --url <url> --events event.a,event.b
motherbase webhooks delete <id>
motherbase webhooks test <id>

Webhooks are project admin resources under /api/admin/webhooks/*.

Cron

motherbase cron list
motherbase cron list --app
motherbase cron create --name nightly --schedule "0 3 * * *" --command "select cleanup();"
motherbase cron delete <id>
motherbase cron toggle <id> --active <true|false>

Without --app, cron commands manage pg_cron jobs through /api/admin/cron/pg/jobs. --app lists code-defined app jobs read-only.

Config and diagnostics

motherbase config list
motherbase config get <group>
motherbase config set <group> key=value [key2=value2 ...]
 
motherbase inspect logs [--limit n]
motherbase inspect stats
motherbase inspect performance
motherbase inspect requests
motherbase inspect advisor
motherbase inspect shield

Settings map to /api/admin/settings/:group. Diagnostics map to admin logs, metrics, advisor, and shield endpoints.


Codegen

motherbase gen types typescript [--schema public] [--local] [--output database.types.ts] [--check]

Generates the Database type for the SDK from the live schema:

FlagEffect
--schemaSchema to emit, default public
--outputFile to write. Omit it and the file goes to stdout, so … > database.types.ts works
--localBypass the Console proxy and talk straight to a project API on this machine (default http://localhost:5001) — no console account or link file needed
--checkFail when the file on disk differs from what would be generated, for CI

The server owns the emitter (apps/server/services/admin/typegen); the CLI is a transport that asks GET /admin/schema/types for the rendered file. That is deliberate: re-implementing it here would drift from the Studio download and the schema tools within a release.

import type { Database } from './database.types'
const client = createClient<Database>(url, anonKey)
motherbase gen types zod [--schema public] [--local] [--output database.schemas.ts] [--check]

Same catalog, rendered as runtime zod schemas instead of types. TypeScript types vanish at runtime, so a form post, a webhook body or a row from an untyped source is any in practice and the mistake first shows up as a column constraint violation in production.

Emits <Relation>Row, <Relation>Insert and <Relation>Update per table and view, camel-cased and capitalised (order_items becomes OrderItemsRow). Optionality matches the TypeScript Insert / Update types exactly, so a value that passes the schema is a value the REST layer accepts. Enum columns become z.enum([...]); a type the emitter does not model becomes z.unknown() rather than a guess that would reject valid data.

Output is deterministic — stable order, no timestamps, LF endings — which is what makes --check usable in CI. See the SDK reference.

AI agents

motherbase mcp [--write]

Serves the linked project to an AI agent over the Model Context Protocol, on stdio. Read-only by default: schema, policies, the advisor lint, the RLS simulator, logs and generated types. --write adds apply_migration (real DDL, recorded and rollbackable) and raw SQL writes.

Authentication is the CLI's own context, so an MCP session reaches exactly what a motherbase command could. See MCP Server.

Every command

Generated from packages/cli/src/commands — the same registry motherbase --help renders — by npm run docs:cli in the backend. packages/cli/test/docs.test.js fails when the committed table no longer matches the registry, so a command added to the CLI cannot stay missing from this page.

Connection

CommandUsageWhat it does
loginmotherbase login [--url <consoleUrl>] [--email <email>]Log in to a Motherbase Console (email/password → session token)
logoutmotherbase logout [--url <consoleUrl>]Remove the stored token for the current (or --url) console
whoamimotherbase whoamiShow the current console, account and platform info
linkmotherbase link [projectNameOrId]Link the current directory to a project (writes ./.motherbase/config.json)
unlinkmotherbase unlinkRemove the project link from the current directory
statusmotherbase statusShow connection status: console, link, and a project health probe

Orgs & projects (Console)

CommandUsageWhat it does
orgsmotherbase orgs <list|create> ...Manage organizations on the Platform Console
orgs listmotherbase orgs listList the organizations you belong to
orgs createmotherbase orgs create <name>Create an organization
projectsmotherbase projects <list|create|start|stop|restart|update|rebuild|delete|logs|info|limits|api-keys> ...Manage projects on the Platform Console
projects listmotherbase projects listList all projects on the console
projects createmotherbase projects create <name> [--domain <domain>]Create a new project
projects deletemotherbase projects delete <id> --confirm <name>Delete a project (requires --confirm <name>)
projects logsmotherbase projects logs <id> [-f]Show recent logs for a project
projects infomotherbase projects info <id>Show project details and DNS checks
projects limitsmotherbase projects limits <id> [--api-cpus n --api-mem mb --db-cpus n --db-mem mb --minio-cpus n --minio-mem mb]Get or set per-project resource limits
projects startmotherbase projects start <id>start a project
projects stopmotherbase projects stop <id>stop a project
projects restartmotherbase projects restart <id>restart a project
projects updatemotherbase projects update <id>update a project
projects rebuildmotherbase projects rebuild <id>rebuild a project
projects api-keysmotherbase projects api-keys [--project-ref <id>]List project API keys
branchesmotherbase branches <create|list|get|update|delete|pause|unpause|reset|merge|rebase|switch> ...Manage preview branches of the linked project
branches createmotherbase branches create <name> [--git-branch <ref>] [--with-data]Create a preview branch of the linked project
branches listmotherbase branches listList the branches of the linked project, main first
branches getmotherbase branches get <name>Show one branch, with the migrations it is ahead and behind
branches updatemotherbase branches update <name> --git-branch <ref>Change a branch's git branch
branches deletemotherbase branches delete <name>Delete a branch and its whole stack
branches pausemotherbase branches pause <name>Stop a branch's stack, keeping its data
branches unpausemotherbase branches unpause <name>Start a paused branch again
branches resetmotherbase branches reset <name>Recreate a branch from the parent as it is now (its changes are lost)
branches mergemotherbase branches merge <name>Apply the branch's new migrations to the parent
branches rebasemotherbase branches rebase <name>Apply the parent's newer migrations to the branch
branches switchmotherbase branches switch <name|main>Point this directory's link at a branch (or back at main)
domainsmotherbase domains <create|get|reverify|activate|delete> ...Custom domain for the linked project's API
domains createmotherbase domains create --custom-hostname <api.example.com>Start using a custom hostname (prints the DNS records to publish)
domains getmotherbase domains getShow the custom hostname and its verification state
domains reverifymotherbase domains reverifyCheck the DNS records again
domains activatemotherbase domains activateServe the API on the verified hostname (TLS is issued on first request)
domains deletemotherbase domains deleteStop using the custom hostname
vanity-subdomainsmotherbase vanity-subdomains <get|check-availability|activate|delete> ...Vanity subdomain under the platform domain
vanity-subdomains getmotherbase vanity-subdomains getShow the active vanity subdomain
vanity-subdomains check-availabilitymotherbase vanity-subdomains check-availability --desired-subdomain <name>Is a subdomain free?
vanity-subdomains activatemotherbase vanity-subdomains activate --desired-subdomain <name>Serve the API on <name>.<platform domain> as well
vanity-subdomains deletemotherbase vanity-subdomains deleteRemove the vanity subdomain

Local self-host

CommandUsageWhat it does
initmotherbase init [dir] [--port 5001] [--repo URL] [--ref BRANCH] [--force]Scaffold a runnable local stack (compose file, .env, generated secrets)
startmotherbase startStart the local docker compose stack
stopmotherbase stopStop the local docker compose stack
deploymotherbase deployRebuild and start the local docker compose stack
logsmotherbase logs [service...]Follow logs from the local docker compose stack

Database

CommandUsageWhat it does
dbmotherbase db <push|pull|diff|reset|dump|seed|tables|sql|backup|restore|backups|lint|indexes|types|roles|column-privileges|publications> ...Database: tables, SQL, dumps, restores, indexes, types, roles, publications
db tablesmotherbase db tablesList database tables
db sqlmotherbase db sql -e "select 1" | motherbase db sql <file.sql>Run SQL from -e "..." or a file
db backupmotherbase db backup [file]Create a database backup on the server
db restoremotherbase db restore <file> | --key <remoteKey> --confirmRestore the database from a server dump or offsite key
db backupsmotherbase db backups [list] | motherbase db backups config [--set key=value ...]List backups, or manage backup config (db backups config)
db pushmotherbase db push [--dry-run] [--include-seed] [--include-all]Apply pending local migrations to the linked project
db pullmotherbase db pull [name]Create a migration from the remote schema changes local files lack
db diffmotherbase db diff [-f <name>]Diff the remote schema against local migrations
db resetmotherbase db reset --confirm [--no-seed]Reset the linked database to local migrations and seeds
db dumpmotherbase db dump [-f <file>] [--schema-only | --data-only] [--schema a,b] [--use-copy]Dump the linked database (app schemas) to a local file or stdout
db seedmotherbase db seedRun the seed files against the linked database
db indexesmotherbase db indexes <list|create|drop> ...Indexes across a schema: list, create, drop
db typesmotherbase db types <list|create|add-value|rename-value|drop> ...Enumerated types: list, create, add-value, rename-value, drop
db rolesmotherbase db roles <list|create|alter|drop> ...Postgres roles: list, create, alter, drop
db column-privilegesmotherbase db column-privileges <list|grant|revoke> <[schema.]table> ...Column-level GRANT / REVOKE per role
db publicationsmotherbase db publications <list|create|alter|drop> ...Logical-replication publications: list, create, alter, drop
db lintmotherbase db lint [--level critical|warning|info]Run the security and performance advisor
backupsmotherbase backups <list|restore> ...List and restore database backups
backups listmotherbase backups listList database backups
backups restoremotherbase backups restore <file> | --key <remoteKey> --confirmRestore the database from a server dump or offsite key
migrationsmotherbase migrations <new|list|up|down|repair|squash|fetch|diff|get|create|apply|rollback> ... (alias of migration)Schema migrations: local files and the remote history
migrations newmotherbase migration new <name>Scaffold a local migration .sql file
migrations listmotherbase migration listList local and remote migrations side by side
migrations diffmotherbase migration diffShow a diff between live schema and migrations
migrations getmotherbase migration get <id>Show a single migration
migrations createmotherbase migration create --name <name> --up <file.sql> [--down <file.sql>]Create a migration from up/down SQL files
migrations applymotherbase migration apply <id>Apply a migration
migrations rollbackmotherbase migration rollback <id>Roll back a migration
migrations upmotherbase migration up [--include-all] [--dry-run]Apply pending local migrations to the linked project
migrations downmotherbase migration down [--last <n>] [--yes]Roll back the last n applied migrations with their down SQL
migrations repairmotherbase migration repair <version...> --status applied|revertedMark migrations applied or reverted in the remote history, without running them
migrations squashmotherbase migration squash [--version <v>] [--linked]Squash local migrations into one file
migrations fetchmotherbase migration fetch [--force]Write the remote migration history into local files
migrationmotherbase migration <new|list|up|down|repair|squash|fetch|diff|get|create|apply|rollback> ...Schema migrations: local files and the remote history
migration newmotherbase migration new <name>Scaffold a local migration .sql file
migration listmotherbase migration listList local and remote migrations side by side
migration diffmotherbase migration diffShow a diff between live schema and migrations
migration getmotherbase migration get <id>Show a single migration
migration createmotherbase migration create --name <name> --up <file.sql> [--down <file.sql>]Create a migration from up/down SQL files
migration applymotherbase migration apply <id>Apply a migration
migration rollbackmotherbase migration rollback <id>Roll back a migration
migration upmotherbase migration up [--include-all] [--dry-run]Apply pending local migrations to the linked project
migration downmotherbase migration down [--last <n>] [--yes]Roll back the last n applied migrations with their down SQL
migration repairmotherbase migration repair <version...> --status applied|revertedMark migrations applied or reverted in the remote history, without running them
migration squashmotherbase migration squash [--version <v>] [--linked]Squash local migrations into one file
migration fetchmotherbase migration fetch [--force]Write the remote migration history into local files
importmotherbase import --from-supabase <connectionString> [--service-role-key <key>] [--management-token <sbp_…>] [--preview] [--no-data] [--no-auth] [--no-storage] [--no-edge-functions] [--no-secrets]Import a Supabase project (schema, data, auth, storage, edge functions, secrets)
testmotherbase test db [file.sql ...]Run database tests (pgTAP)
test dbmotherbase test db [file.sql ...]Run pgTAP tests from motherbase/tests against the linked database
postgres-configmotherbase postgres-config <get|update|delete> ...Postgres configuration (statement_timeout, work_mem, max_connections, ...)
postgres-config getmotherbase postgres-config get [--all]Show Postgres config overrides (--all for every managed setting)
postgres-config updatemotherbase postgres-config update --config key=value [--config ...] [--scope database|role|system] [--role r] [--replace-existing-overrides]Set Postgres config values
postgres-config deletemotherbase postgres-config delete --config key1,key2 [--scope database|role|system] [--role r]Remove Postgres config overrides, restoring the defaults

Resources

CommandUsageWhat it does
rlsmotherbase rls <list|enable|disable|policy|preset|simulate|lint> ...Row-level security (tables, policies, presets, simulator, lint)
rls listmotherbase rls listList tables with RLS status and policies
rls enablemotherbase rls enable <table>Enable RLS on a table
rls disablemotherbase rls disable <table>Disable RLS on a table
rls policymotherbase rls policy create --table <t> --name <n> --command <SELECT|INSERT|UPDATE|DELETE|ALL> [--using <expr>] [--check <expr>] [--roles a,b] | motherbase rls policy delete <table> <name>Manage RLS policies
rls presetmotherbase rls preset <table> <starter|public_crud|authenticated_crud|admin_only|blocked|owner_only|org_scoped|public_read_owner_write|soft_delete> [--owner-column c] [--org-column c] [--org-claim c] [--deleted-column c] [--replace]Apply a policy preset to a table
rls simulatemotherbase rls simulate --sql "select * from t" [--as anon|authenticated|<userId>] [--claims '{"org_id":"x"}'] [--limit n]Run a query as a given caller and show what RLS lets through
rls lintmotherbase rls lint [--level critical|warning|info]Run the security and performance advisor
usersmotherbase users <list|get|create|update|delete|reset-password|promote|demote|revoke-sessions|audit> ...Project auth users
users listmotherbase users listList project users
users getmotherbase users get <id>Get a user by id
users createmotherbase users create --email <e> --password <p> [--name <n>] [--role <r>]Create a user
users updatemotherbase users update <id> [--email ...] [--name ...] [--role ...]Update a user
users deletemotherbase users delete <id>Delete a user
users reset-passwordmotherbase users reset-password <id> [--password <p>]Reset a user password
users promotemotherbase users promote <id>Promote a user to ADMIN
users demotemotherbase users demote <id>Demote a user to USER
users revoke-sessionsmotherbase users revoke-sessions <id>Revoke all sessions for a user
users auditmotherbase users audit [--action <a>] [--actor <email|id>] [--type <log type>] [--from <iso>] [--to <iso>] [--limit <n>]Read the auth audit log, newest first
storagemotherbase storage <buckets|ls|cp|mv|rm> ...Storage buckets and objects (ss:///bucket/key paths)
storage bucketsmotherbase storage buckets <list|create|delete> ...Manage storage buckets
storage lsmotherbase storage ls [ss:///bucket/prefix] [-r]List buckets, or the objects under a path
storage cpmotherbase storage cp <src> <dst> [-r] e.g. cp ./a.png ss:///media/ | cp -r ss:///media/img ./imgCopy between local paths and ss:///bucket/key (upload, download or in-bucket copy)
storage mvmotherbase storage mv <ss:///bucket/src> <ss:///bucket/dst> [-r]Move objects within a bucket
storage rmmotherbase storage rm <ss:///bucket/key | fileId>... [-r]Delete objects by path (or a file by id)
functionsmotherbase functions <list|get|new|deploy|pull|download|serve|delete|invoke|logs> ...Edge functions (repo files, deploy, invoke, logs)
functions listmotherbase functions listList edge functions
functions getmotherbase functions get <id>Get an edge function by id
functions newmotherbase functions new <name> [--template hello-world|stripe-webhook|openai|resend-email|image-transform|websocket|storage-upload]Scaffold functions/<name>/index.ts
functions deploymotherbase functions deploy [name] [--memory <mb>] [--timeout <ms>] [--file <f> --route <r>]Deploy local functions (all of them, or one by name)
functions pullmotherbase functions pull [name]Write deployed function source back to disk
functions servemotherbase functions serve [name]Watch local functions and redeploy on every save
functions deletemotherbase functions delete <id>Delete an edge function by id
functions invokemotherbase functions invoke <route> [--body <json>]Invoke a deployed edge function by route, as the operator
functions logsmotherbase functions logs <id>Show logs for an edge function
functions downloadmotherbase functions download [name]Write deployed function source back to disk
secretsmotherbase secrets <list|set|unset> ...Edge function secrets
secrets listmotherbase secrets listList edge secrets (names only)
secrets setmotherbase secrets set NAME=VALUE [NAME=VALUE ...] [--env-file .env]Set one or more secrets
secrets unsetmotherbase secrets unset <NAME>Remove a secret
keysmotherbase keys <list|create|revoke> ...Project API keys (publishable and secret)
keys listmotherbase keys listList project API keys
keys createmotherbase keys create <NAME> [--type publishable|secret]Create a key. A secret key is printed once and never again
keys revokemotherbase keys revoke <ID>Revoke a key by id
realtimemotherbase realtime <config|channels> ...Realtime configuration and channels
realtime configmotherbase realtime config [--models a,b,c]Show realtime config, or set enabled models with --models a,b,c
realtime channelsmotherbase realtime channelsList active realtime channels
webhooksmotherbase webhooks <list|create|delete|test> ...Outgoing webhooks
webhooks listmotherbase webhooks listList webhooks
webhooks createmotherbase webhooks create --name <n> --url <u> --events a,bCreate a webhook
webhooks deletemotherbase webhooks delete <id>Delete a webhook
webhooks testmotherbase webhooks test <id>Send a test event to a webhook
cronmotherbase cron <list|create|delete|toggle> ...Scheduled jobs (pg_cron)
cron listmotherbase cron list [--app]List pg_cron jobs (and app jobs with --app)
cron createmotherbase cron create --name <n> --schedule "<cron>" --command "<sql>"Create a pg_cron job
cron deletemotherbase cron delete <id>Delete a pg_cron job by numeric id
cron togglemotherbase cron toggle <id> --active <true|false>Enable/disable a pg_cron job
queuesmotherbase queues <list|enable|expose|create|drop|send|read|archive|purge> ...Message queues (pgmq)
queues listmotherbase queues listList queues with their depth
queues enablemotherbase queues enableInstall pgmq for this project
queues exposemotherbase queues expose <true|false>Expose queues to the client SDK through pgmq_public (or hide them)
queues createmotherbase queues create <name> [--type basic|unlogged|partitioned] [--rls true|false]Create a queue
queues dropmotherbase queues drop <name>Drop a queue and its messages
queues sendmotherbase queues send <name> '<json>' [--delay seconds]Send a JSON message
queues readmotherbase queues read <name> [--qty 1] [--vt 30]Read messages, hiding them from other readers for the visibility timeout
queues archivemotherbase queues archive <name> <msg-id>Move a message to the archive
queues purgemotherbase queues purge <name>Delete every message in a queue
vaultmotherbase vault <list|enable|create|update|reveal|delete> ...Encrypted secrets (Vault)
vault listmotherbase vault listList Vault secrets (names and metadata, never values)
vault enablemotherbase vault enableInstall the Vault for this project
vault createmotherbase vault create <name> --secret <value> [--description <text>]Store an encrypted secret
vault updatemotherbase vault update <id> [--name <n>] [--secret <value>] [--description <text>]Rename a secret, change its value or its description
vault revealmotherbase vault reveal <id>Print the decrypted value of a secret
vault deletemotherbase vault delete <id>Delete a secret
wrappersmotherbase wrappers <list|enable|create-server|drop-server|credentials|import|create-table|drop-table> ...Foreign data wrappers (postgres_fdw, file_fdw)
wrappers listmotherbase wrappers listList wrappers, foreign servers and foreign tables
wrappers enablemotherbase wrappers enable <postgres_fdw|file_fdw>Install a wrapper extension
wrappers create-servermotherbase wrappers create-server <name> --wrapper <postgres_fdw|file_fdw> [--option k=v ...] [--user <u> --password <p>]Create a foreign server; the password goes to the Vault
wrappers drop-servermotherbase wrappers drop-server <name>Drop a foreign server
wrappers credentialsmotherbase wrappers credentials <server> --user <u> --password <p>Replace the remote credentials of a foreign server
wrappers importmotherbase wrappers import <server> --remote-schema <s> --local-schema <s> [--tables a,b]Import a remote schema as foreign tables
wrappers create-tablemotherbase wrappers create-table <schema>.<table> --server <s> --column <name>:<type> ... [--option k=v ...]Create one foreign table
wrappers drop-tablemotherbase wrappers drop-table <schema>.<table>Drop a foreign table
configmotherbase config <list|get|set> ...Project settings groups
config listmotherbase config listList setting groups
config getmotherbase config get <group>Get a settings group
config setmotherbase config set <group> key=value [key2=value2 ...]Set values in a settings group
inspectmotherbase inspect <db|report|logs|stats|performance|index-advisor|requests|advisor|shield>Diagnostics: database inspection, report, logs, stats, index-advisor, advisor, shield
inspect dbmotherbase inspect db <bloat|blocking|calls|db-stats|index-stats|locks|long-running-queries|outliers|replication-slots|role-stats|table-stats|traffic-profile|vacuum-stats>Inspect the database: bloat, locks, slow queries, index and table stats
inspect reportmotherbase inspect report [--output-dir <dir>]Write every inspect query to a CSV in a dated folder
inspect logsmotherbase inspect logs [--limit n] [--source api|rest|postgres|pooler|auth|storage|realtime|edge-function|cron|platform]Recent server logs
inspect index-advisormotherbase inspect index-advisor --sql "<select ...>" | motherbase inspect index-advisor --enableSuggest indexes for a statement (hypopg + index_advisor)
inspect statsmotherbase inspect statsStats overview
inspect performancemotherbase inspect performancePerformance metrics
inspect requestsmotherbase inspect requestsRequest metrics
inspect advisormotherbase inspect advisorAdvisor findings
inspect shieldmotherbase inspect shieldSecurity shield report
snippetsmotherbase snippets <list|download> ...SQL Editor snippets
snippets listmotherbase snippets listList SQL snippets (yours and the ones shared with the project)
snippets downloadmotherbase snippets download <id>Print a snippet as plain SQL (redirect it to a file to save it)
network-restrictionsmotherbase network-restrictions <get|update> ...IP ranges allowed to connect to the database directly
network-restrictions getmotherbase network-restrictions getShow the allowed ranges
network-restrictions updatemotherbase network-restrictions update --db-allow-cidr <cidr> [--db-allow-cidr <cidr> ...]Replace the allowed ranges (repeat --db-allow-cidr; IPv4 and IPv6 are told apart)
ssl-enforcementmotherbase ssl-enforcement <get|update> ...Require TLS for direct database connections
ssl-enforcement getmotherbase ssl-enforcement getShow whether TLS is enforced
ssl-enforcement updatemotherbase ssl-enforcement update --enable-db-ssl-enforcement | --disable-db-ssl-enforcementTurn enforcement on or off

Codegen

CommandUsageWhat it does
genmotherbase gen <types|signing-key|bearer-jwt|keys> ...Generate code from the live schema, and signing keys, tokens and secrets
gen typesmotherbase gen types [--lang typescript|zod] [flags] | motherbase gen types <typescript|zod> [flags]Generate types from the database schema
gen signing-keymotherbase gen signing-key [--algorithm ES256|RS256|EdDSA] [--append] [--key-file motherbase/signing_keys.json]Generate a JWT signing key (a private JWK) to import into a project
gen bearer-jwtmotherbase gen bearer-jwt --sub <user id> [--role authenticated] [--valid-for 1h | --exp <unix>] [--payload <json>] [--issuer <url>] [--key-file <file>]Sign an access token with a local signing key, for calling the API as a user
gen keysmotherbase gen keys [-o env]Generate a fresh set of secrets for a local stack (use -o env)

AI agents

CommandUsageWhat it does
mcpmotherbase mcp [--write]Serve the linked project and console to an AI agent over MCP (stdio)

Shell

CommandUsageWhat it does
completionmotherbase completion <bash|zsh|fish>Generate the autocompletion script for a shell

Ungrouped

CommandUsageWhat it does
migratemotherbase migrate codemod <dir> [--write]Port an application from Supabase
migrate codemodmotherbase migrate codemod <dir> [--write]Rewrite Supabase imports and report what this SDK does not support