Skip to main content

Usage

Supabase CLI provides you with tools to develop your application locally, and deploy your application to the Supabase platform.



Stop all local Supabase containers

supabase stop [flags]

Options

  -h, --help   help for stop


Show status of local Supabase containers

supabase status [flags]

Options

  -h, --help   help for status


Start containers for Supabase local development

supabase start [flags]

Options

  -h, --help   help for start


Manage Supabase secrets

Available Commands

Options

  -h, --help   help for secrets


Unset a secret(s) on Supabase

Unset a secret(s) from the linked Supabase project.

supabase secrets unset <NAME> ... [flags]

Options

  -h, --help   help for unset


Set a secret(s) on Supabase

Set a secret(s) to the linked Supabase project.

supabase secrets set [flags] <NAME=VALUE> ...

Options

      --env-file string   Read secrets from a .env file.
-h, --help help for set


List all secrets on Supabase

List all secrets in the linked project.

supabase secrets list [flags]

Options

  -h, --help   help for list


Manage Supabase projects

Available Commands

Options

  -h, --help   help for projects


List all Supabase projects

List all Supabase projects the logged-in user can access.

supabase projects list [flags]

Options

  -h, --help   help for list


Create a project on Supabase

supabase projects create <project name> [flags]

Options

      --db-password string   Database password of the project.
-h, --help help for create
-i, --interactive Enables interactive mode.
--org-id string Organization ID to create the project in.
--plan string Select a plan that suits your needs. (default "free")
--region string Select a region close to you for the best performance.


Manage Supabase organizations

Available Commands

Options

  -h, --help   help for orgs


List all organizations

List all organizations the logged-in user belongs.

supabase orgs list [flags]

Options

  -h, --help   help for list


Manage database migration scripts

Available Commands

Options

  -h, --help   help for migration


Create an empty migration script

supabase migration new <migration name> [flags]

Options

  -h, --help   help for new


List local and remote migrations

supabase migration list [flags]

Options

  -h, --help              help for list
-p, --password string Password to your remote Postgres database.


Authenticate using an access token

supabase login [flags]

Options

  -h, --help   help for login


supabase link [flags]

Options

  -h, --help                 help for link
-p, --password string Password to your remote Postgres database.
--project-ref string Project ref of the Supabase project.


Initialize a local project

supabase init [flags]

Options

  -h, --help   help for init


Run code generation tools

Available Commands

Options

  -h, --help   help for gen


Generate types from Postgres schema

Available Commands

Options

  -h, --help   help for types


Generate types for TypeScript

Generate types for TypeScript. Must specify either --local or --db-url

supabase gen types typescript [flags]

Options

      --db-url string   Generate types from a database url.
-h, --help help for typescript
--local Generate types from the local dev database.


Manage Supabase Edge functions

Available Commands

Options

  -h, --help   help for functions


Serve a Function locally

supabase functions serve <Function name> [flags]

Options

      --env-file string   Path to an env file to be populated to the Function environment.
-h, --help help for serve
--no-verify-jwt Disable JWT verification for the Function.


Create a new Function locally

supabase functions new <Function name> [flags]

Options

  -h, --help   help for new


Deploy a Function to Supabase

Deploy a Function to the linked Supabase project.

supabase functions deploy <Function name> [flags]

Options

  -h, --help                 help for deploy
--no-verify-jwt Disable JWT verification for the Function.
--project-ref string Project ref of the Supabase project.


Delete a Function from Supabase

Delete a Function from the linked Supabase project. This does NOT remove the Function locally.

supabase functions delete <Function name> [flags]

Options

  -h, --help                 help for delete
--project-ref string Project ref of the Supabase project.


Manage local Postgres databases

Available Commands

Options

  -h, --help   help for db


Resets the local database to current migrations

supabase db reset [flags]

Options

  -h, --help   help for reset


Manage remote databases

Available Commands

Options

  -h, --help              help for remote
-p, --password string Password to your remote Postgres database.


Commit remote changes as a new migration

supabase db remote commit [flags]

Options

  -h, --help   help for commit


Show changes on the remote database

Show changes on the remote database since last migration.

supabase db remote changes [flags]

Options

  -h, --help   help for changes


Push new migrations to the remote database

supabase db push [flags]

Options

      --dry-run           Print the migrations that would be applied, but don't actually apply them.
-h, --help help for push
-p, --password string Password to your remote Postgres database.


Diffs the local database for schema changes

supabase db diff [flags]

Options

  -f, --file string      Saves schema diff to a file.
-h, --help help for diff
-s, --schema strings List of schema to include. (default [public])
--use-migra Use migra to generate schema diff.


Manage local database branches

Manage local database branches. Each branch is associated with a separate local database. Forking remote databases is NOT supported.

Available Commands

Options

  -h, --help   help for branch


Switch the active branch

supabase db branch switch <branch name> [flags]

Options

  -h, --help   help for switch


List branches

supabase db branch list [flags]

Options

  -h, --help   help for list


Delete a branch

supabase db branch delete <branch name> [flags]

Options

  -h, --help   help for delete


Create a branch

supabase db branch create <branch name> [flags]

Options

  -h, --help   help for create