Browse documentation

Install

npm install -g @motherbase/cli
motherbase --version
motherbase --help

During backend development, run the local binary from the backend repo:

cd Boilerplate-backend
npm run cli -- --help

Log in to the Console

Use the Platform Console URL printed by ./setup.sh.

motherbase login --url http://localhost:5500

For a VPS install:

motherbase login --url https://console.example.com

The command prompts for Console email and password, posts them to /api/auth/sign-in/email, then stores the returned token under ~/.motherbase/config.json. Pass --email/--password to skip the prompts, or --token <t> to store a token without making a request.

Check the active account:

motherbase whoami

List projects from the Console:

motherbase projects list

Link the current app directory to one project:

motherbase link todo
motherbase status

The link writes .motherbase/config.json in the current directory. From that point, resource commands route through:

<consoleUrl>/api/projects/<projectId>/admin/*

First project commands

motherbase db tables
motherbase users list
motherbase storage buckets list
motherbase functions list

Run SQL when the project allows the SQL editor/admin SQL endpoint:

motherbase db sql -e "select now()"
Warning

db sql, db restore, destructive deletes, and imports are admin operations. The CLI requires confirmation flags or prompts for destructive paths.

Deploy an edge function

motherbase functions new hello        # scaffolds functions/hello/index.ts
motherbase functions deploy hello     # or `deploy` with no name for all of them
motherbase functions invoke hello --body '{"name":"Ada"}'
motherbase functions list             # ids, for `functions logs <id>`

Edge secrets are managed separately:

motherbase secrets set STRIPE_SECRET sk_test_...
motherbase secrets list

Import from Supabase

Run a dry-run preview first:

motherbase import --from-supabase "$SUPABASE_DB_URL" --preview --json

Then import the portable parts of the Supabase project:

motherbase import --from-supabase "$SUPABASE_DB_URL" --yes

This imports the public schema, data, RLS policies, and email/password users from auth.users. Storage objects are not copied. See Migrate from Supabase.

Database migrations

Create a local SQL file:

motherbase migration new create_todo

Run SQL directly or use the server-side migration lifecycle:

motherbase db sql motherbase/migrations/20260705123000_create_todo.sql
motherbase migrations list
motherbase migrations diff

CI example

For a linked project through the Console:

MOTHERBASE_CONSOLE_URL=https://console.example.com \
MOTHERBASE_TOKEN=$MOTHERBASE_TOKEN \
MOTHERBASE_PROJECT=todo \
motherbase db tables --json

For a single project API, with no Console in the picture:

MOTHERBASE_URL=https://todo.example.com \
MOTHERBASE_ADMIN_TOKEN=$MOTHERBASE_ADMIN_TOKEN \
motherbase users list --json

Direct mode is a fallback: it wins only when the context has no Console token and no linked project. In a directory that is linked and logged in, MOTHERBASE_URL is ignored.

Local stack commands

These commands do not need Console login:

motherbase init my-project
motherbase start
motherbase logs
motherbase stop
motherbase deploy

They are thin wrappers around Docker Compose and are meant for local self-host development.