Home

Supabase CLI

The Supabase CLI provides tools to develop your project locally and deploy to the Supabase Platform. The CLI is still under development, but it contains all the functionality for working with your Supabase projects and the Supabase Platform.

Global flags

Supabase CLI supports global flags for every command.

Flags

  • --debug
    Optional
    no type

    output debug logs to stderr

  • --experimental
    Optional
    no type

    enable experimental features

  • -h, --help
    Optional
    no type

    help for supabase

  • --workdir <string>
    Optional
    no type

    path to a Supabase project directory

$ supabase test db

Tests local database with pgTAP

1supabase test db

$ supabase stop

Stop all local Supabase containers

Flags

  • --backup
    REQUIRED
    no type

    Backs up the current database before stopping.

1supabase stop [flags]

$ supabase status

Show status of local Supabase containers

Flags

  • -o, --output <[ env | json | pretty | toml | yaml ]>
    REQUIRED
    no type

    Output format of status variables.

  • --override-name <strings>
    REQUIRED
    no type

    Override specific variable names.

1supabase status [flags]

$ supabase start

Start containers for Supabase local development

Flags

  • -x, --exclude <strings>
    REQUIRED
    no type

    Names of containers to not start. [gotrue, realtime, storage-api, imgproxy, kong, inbucket, postgrest, pgadmin-schema-diff, migra, postgres-meta, studio, deno-relay]

1supabase start [flags]

$ supabase login

Authenticate using an access token

1supabase login
1supabase link [flags]

$ supabase init

Initialize a local project

1supabase init

$ supabase gen types typescript

Generate types for TypeScript

Flags

  • --db-url <string>
    REQUIRED
    no type

    Generate types from a database url.

  • --linked
    REQUIRED
    no type

    Generate types from the linked project.

  • --local
    REQUIRED
    no type

    Generate types from the local dev database.

  • --project-id <string>
    REQUIRED
    no type

    Generate types from a project ID.

  • --schema <stringArray>
    REQUIRED
    no type

    Schemas to generate types for.

1supabase gen types typescript [flags]

$ supabase db reset

Resets the local database to current migrations

1supabase db reset

$ supabase db remote commit

Commit remote changes as a new migration

Flags

  • -p, --password <string>
    REQUIRED
    no type

    Password to your remote Postgres database.

1supabase db remote commit

$ supabase db push

Push new migrations to the remote database

Flags

  • --dry-run
    REQUIRED
    no type

    Print the migrations that would be applied, but don't actually apply them.

  • -p, --password <string>
    REQUIRED
    no type

    Password to your remote Postgres database.

1supabase db push [flags]

$ supabase db lint

Checks local database for typing error

Flags

  • --level <[ warning | error ]>
    REQUIRED
    no type

    Error level to emit.

  • -s, --schema <strings>
    REQUIRED
    no type

    List of schema to include.

1supabase db lint [flags]

$ supabase db diff

Diffs the local database for schema changes

Flags

  • -f, --file <string>
    REQUIRED
    no type

    Saves schema diff to a file.

  • --linked
    REQUIRED
    no type

    Diffs local schema against linked project.

  • -s, --schema <strings>
    REQUIRED
    no type

    List of schema to include.

  • --use-migra
    REQUIRED
    no type

    Use migra to generate schema diff.

1supabase db diff [flags]

$ supabase migration new

Create an empty migration script

1supabase migration new <migration name>

$ supabase migration list

List local and remote migrations

Flags

  • -p, --password <string>
    REQUIRED
    no type

    Password to your remote Postgres database.

1supabase migration list [flags]

$ supabase migration repair

Repairs the migration history table

Flags

  • --status <[ applied | reverted ]>
    REQUIRED
    no type

    Version status to update.

1supabase migration repair <version> [flags]

$ supabase secrets unset

Unset a secret(s) on Supabase

1supabase secrets unset <NAME> ...

$ supabase secrets set

Set a secret(s) on Supabase

Flags

  • --env-file <string>
    REQUIRED
    no type

    Read secrets from a .env file.

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

$ supabase secrets list

List all secrets on Supabase

1supabase secrets list

$ supabase projects list

List all Supabase projects

1supabase projects list

$ supabase projects create

Create a project on Supabase

Flags

  • --db-password <string>
    REQUIRED
    no type

    Database password of the project.

  • -i, --interactive
    REQUIRED
    no type

    Enables interactive mode.

  • --org-id <string>
    REQUIRED
    no type

    Organization ID to create the project in.

  • --plan <[ free | pro ]>
    REQUIRED
    no type

    Select a plan that suits your needs.

  • --region <string>
    REQUIRED
    no type

    Select a region close to you for the best performance.

1supabase projects create <project name> [flags]

$ supabase orgs list

List all organizations

1supabase orgs list

$ supabase functions serve

Serve a Function locally

Flags

  • --env-file <string>
    REQUIRED
    no type

    Path to an env file to be populated to the Function environment.

  • --import-map <string>
    REQUIRED
    no type

    Path to import map file.

  • --no-verify-jwt
    REQUIRED
    no type

    Disable JWT verification for the Function.

1supabase functions serve <Function name> [flags]

$ supabase functions new

Create a new Function locally

1supabase functions new <Function name>

$ supabase functions deploy

Deploy a Function to Supabase

Flags

  • --import-map <string>
    REQUIRED
    no type

    Path to import map file.

  • --legacy-bundle
    REQUIRED
    no type

    Use legacy bundling mechanism.

  • --no-verify-jwt
    REQUIRED
    no type

    Disable JWT verification for the Function.

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase functions deploy <Function name> [flags]

$ supabase functions delete

Delete a Function from Supabase

Flags

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase functions delete <Function name> [flags]

$ supabase domains reverify

Re-verify the custom hostname config for your project

Flags

  • --include-raw-output
    REQUIRED
    no type

    Include raw output (useful for debugging).

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase domains reverify

$ supabase domains get

Get the current custom hostname config

Flags

  • --include-raw-output
    REQUIRED
    no type

    Include raw output (useful for debugging).

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase domains get

$ supabase domains delete

Deletes the custom hostname config for your project

Flags

  • --include-raw-output
    REQUIRED
    no type

    Include raw output (useful for debugging).

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase domains delete

$ supabase domains create

Create a custom hostname

Flags

  • --custom-hostname <string>
    REQUIRED
    no type

    The custom hostname to use for your Supabase project.

  • --include-raw-output
    REQUIRED
    no type

    Include raw output (useful for debugging).

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase domains create [flags]

$ supabase domains activate

Activate the custom hostname for a project

Flags

  • --include-raw-output
    REQUIRED
    no type

    Include raw output (useful for debugging).

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase domains activate

$ supabase vanity-subdomains check-availability

Checks if a desired subdomain is available for use

Flags

  • --desired-subdomain <string>
    REQUIRED
    no type

    The desired vanity subdomain to use for your Supabase project.

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase vanity-subdomains check-availability [flags]

$ supabase vanity-subdomains activate

Activate a vanity subdomain

Flags

  • --desired-subdomain <string>
    REQUIRED
    no type

    The desired vanity subdomain to use for your Supabase project.

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase vanity-subdomains activate [flags]

$ supabase vanity-subdomains delete

Deletes a project's vanity subdomain

Flags

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase vanity-subdomains delete

$ supabase vanity-subdomains get

Get the current vanity subdomain

Flags

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase vanity-subdomains get

$ supabase network-restrictions get

Get the current network restrictions

Flags

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase network-restrictions get

$ supabase network-restrictions update

Update network restrictions

Flags

  • --bypass-cidr-checks
    REQUIRED
    no type

    Bypass some of the CIDR validation checks.

  • --db-allow-cidr <strings>
    REQUIRED
    no type

    CIDR to allow DB connections from.

  • --project-ref <string>
    REQUIRED
    no type

    Project ref of the Supabase project.

1supabase network-restrictions update [flags]

$ supabase completion zsh

Generate the autocompletion script for zsh

Flags

  • --no-descriptions
    REQUIRED
    no type

    disable completion descriptions

1supabase completion zsh [flags]

$ supabase completion powershell

Generate the autocompletion script for powershell

Flags

  • --no-descriptions
    REQUIRED
    no type

    disable completion descriptions

1supabase completion powershell [flags]

$ supabase completion fish

Generate the autocompletion script for fish

Flags

  • --no-descriptions
    REQUIRED
    no type

    disable completion descriptions

1supabase completion fish [flags]

$ supabase completion bash

Generate the autocompletion script for bash

Flags

  • --no-descriptions
    REQUIRED
    no type

    disable completion descriptions

1supabase completion bash
Need some help?

Not to worry, our specialist engineers are here to help. Submit a support ticket through the Dashboard.