Install
npm install -g @motherbase/cli
motherbase --version
motherbase --helpDuring backend development, run the local binary from the backend repo:
cd Boilerplate-backend
npm run cli -- --helpLog in to the Console
Use the Platform Console URL printed by ./setup.sh.
motherbase login --url http://localhost:5500For a VPS install:
motherbase login --url https://console.example.comThe 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 whoamiLink a project
List projects from the Console:
motherbase projects listLink the current app directory to one project:
motherbase link todo
motherbase statusThe 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 listRun SQL when the project allows the SQL editor/admin SQL endpoint:
motherbase db sql -e "select now()"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 listImport from Supabase
Run a dry-run preview first:
motherbase import --from-supabase "$SUPABASE_DB_URL" --preview --jsonThen import the portable parts of the Supabase project:
motherbase import --from-supabase "$SUPABASE_DB_URL" --yesThis 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_todoRun SQL directly or use the server-side migration lifecycle:
motherbase db sql motherbase/migrations/20260705123000_create_todo.sql
motherbase migrations list
motherbase migrations diffCI 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 --jsonFor 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 --jsonDirect 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 deployThey are thin wrappers around Docker Compose and are meant for local self-host development.