Usage

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



Run tests on local Supabase containers #

Available Commands

Options

1  -h, --help   help for test


Tests local database with pgTAP #

1supabase test db [flags]

Options

1  -h, --help   help for db


Stop all local Supabase containers #

1supabase stop [flags]

Options

1      --backup   Backs up the current database before stopping.
2  -h, --help     help for stop


Show status of local Supabase containers #

1supabase status [flags]

Options

1  -h, --help   help for status


Start containers for Supabase local development #

1supabase start [flags]

Options

1  -h, --help   help for start


Manage Supabase secrets #

Available Commands

Options

1  -h, --help   help for secrets


Unset a secret(s) on Supabase #

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

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

Options

1  -h, --help   help for unset


Set a secret(s) on Supabase #

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

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

Options

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


List all secrets on Supabase #

List all secrets in the linked project.

1supabase secrets list [flags]

Options

1  -h, --help   help for list


Manage Supabase projects #

Available Commands

Options

1  -h, --help   help for projects


List all Supabase projects #

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

1supabase projects list [flags]

Options

1  -h, --help   help for list


Create a project on Supabase #

1supabase projects create <project name> [flags]

Options

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


Manage Supabase organizations #

Available Commands

Options

1  -h, --help   help for orgs


List all organizations #

List all organizations the logged-in user belongs.

1supabase orgs list [flags]

Options

1  -h, --help   help for list


Manage database migration scripts #

Available Commands

Options

1  -h, --help   help for migration


Create an empty migration script #

1supabase migration new <migration name> [flags]

Options

1  -h, --help   help for new


List local and remote migrations #

1supabase migration list [flags]

Options

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


Authenticate using an access token #

1supabase login [flags]

Options

1  -h, --help   help for login


1supabase link [flags]

Options

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


Initialize a local project #

1supabase init [flags]

Options

1  -h, --help   help for init


Run code generation tools #

Available Commands

Options

1  -h, --help   help for gen


Generate types from Postgres schema #

Available Commands

Options

1  -h, --help   help for types


Generate types for TypeScript #

Generate types for TypeScript. Must specify one of --local, --linked, --project-id, or --db-url

1supabase gen types typescript [flags]

Options

1      --db-url string        Generate types from a database url.
2  -h, --help                 help for typescript
3      --linked               Generate types from the linked project.
4      --local                Generate types from the local dev database.
5      --project-id string    Generate types from a project ID.
6      --schema stringArray   Schemas to generate types for.


Manage Supabase Edge functions #

Available Commands

Options

1  -h, --help   help for functions


Serve a Function locally #

1supabase functions serve <Function name> [flags]

Options

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


Create a new Function locally #

1supabase functions new <Function name> [flags]

Options

1  -h, --help   help for new


Deploy a Function to Supabase #

Deploy a Function to the linked Supabase project.

1supabase functions deploy <Function name> [flags]

Options

1  -h, --help                 help for deploy
2      --no-verify-jwt        Disable JWT verification for the Function.
3      --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.

1supabase functions delete <Function name> [flags]

Options

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


Manage custom domain names for Supabase projects #

Available Commands

Options

1  -h, --help                 help for domains
2      --include-raw-output   Include raw output (useful for debugging).
3      --project-ref string   Project ref of the Supabase project.


Re-verify the custom hostname config for your project. #

1supabase domains reverify [flags]

Options

1  -h, --help   help for reverify


Get the current custom hostname config. #

Retrieve the custom hostname config for your project, as stored in the Supabase platform.

1supabase domains get [flags]

Options

1  -h, --help   help for get


Deletes the custom hostname config for your project. #

1supabase domains delete [flags]

Options

1  -h, --help   help for delete


Create a custom hostname. #

Create a custom hostname for your Supabase project.

Expects your custom hostname to have a CNAME record to your Supabase project's subdomain.

1supabase domains create [flags]

Options

1      --custom-hostname string   The custom hostname to use for your Supabase project.
2  -h, --help                     help for create


Activate the custom hostname for a project. #

Activates the custom hostname configuration for a project.

This reconfigures your Supabase project to respond to requests on your custom hostname. After the custom hostname is activated, your project's auth services will no longer function on the Supabase-provisioned subdomain.

1supabase domains activate [flags]

Options

1  -h, --help   help for activate


Manage local Postgres databases #

Available Commands

Options

1  -h, --help   help for db


Resets the local database to current migrations #

1supabase db reset [flags]

Options

1  -h, --help   help for reset


Manage remote databases #

Available Commands

Options

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


Commit remote changes as a new migration #

1supabase db remote commit [flags]

Options

1  -h, --help   help for commit


Show changes on the remote database #

Show changes on the remote database since last migration.

1supabase db remote changes [flags]

Options

1  -h, --help   help for changes


Push new migrations to the remote database #

1supabase db push [flags]

Options

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


Checks local database for typing error #

1supabase db lint [flags]

Options

1  -h, --help             help for lint
2      --level string     Error level to emit. (default "warning")
3  -s, --schema strings   List of schema to include. (default [public])


Diffs the local database for schema changes #

1supabase db diff [flags]

Options

1  -f, --file string      Saves schema diff to a file.
2  -h, --help             help for diff
3      --linked           Diffs local schema against linked project.
4  -s, --schema strings   List of schema to include. (default [public])
5      --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

1  -h, --help   help for branch


Switch the active branch #

1supabase db branch switch <branch name> [flags]

Options

1  -h, --help   help for switch


List branches #

1supabase db branch list [flags]

Options

1  -h, --help   help for list


Delete a branch #

1supabase db branch delete <branch name> [flags]

Options

1  -h, --help   help for delete


Create a branch #

1supabase db branch create <branch name> [flags]

Options

1  -h, --help   help for create


Generate the autocompletion script for the specified shell #

Generate the autocompletion script for supabase for the specified shell. See each sub-command's help for details on how to use the generated script.

Available Commands

Options

1  -h, --help   help for completion


Generate the autocompletion script for zsh #

Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions in your current shell session:

source <(supabase completion zsh); compdef _supabase supabase

To load completions for every new session, execute once:

Linux:

supabase completion zsh > "${fpath[1]}/_supabase"

macOS:

supabase completion zsh > $(brew --prefix)/share/zsh/site-functions/_supabase

You will need to start a new shell for this setup to take effect.

1supabase completion zsh [flags]

Options

1  -h, --help              help for zsh
2      --no-descriptions   disable completion descriptions


Generate the autocompletion script for powershell #

Generate the autocompletion script for powershell.

To load completions in your current shell session:

supabase completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command to your powershell profile.

1supabase completion powershell [flags]

Options

1  -h, --help              help for powershell
2      --no-descriptions   disable completion descriptions


Generate the autocompletion script for fish #

Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

supabase completion fish | source

To load completions for every new session, execute once:

supabase completion fish > ~/.config/fish/completions/supabase.fish

You will need to start a new shell for this setup to take effect.

1supabase completion fish [flags]

Options

1  -h, --help              help for fish
2      --no-descriptions   disable completion descriptions


Generate the autocompletion script for bash #

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:

source <(supabase completion bash)

To load completions for every new session, execute once:

Linux:

supabase completion bash > /etc/bash_completion.d/supabase

macOS:

supabase completion bash > $(brew --prefix)/etc/bash_completion.d/supabase

You will need to start a new shell for this setup to take effect.

1supabase completion bash

Options

1  -h, --help              help for bash
2      --no-descriptions   disable completion descriptions