clispec: '001' info: id: cli version: 2.119.0 title: Supabase CLI language: sh source: https://github.com/supabase/cli bugs: https://github.com/supabase/cli/issues spec: https://github.com/supabase/spec/cli_v1_commands.yaml description: Supabase CLI provides you with tools to develop your application locally, and deploy your application to the Supabase platform. tags: - id: quick-start title: Quick Start - id: local-dev title: Local Development - id: management-api title: Management APIs - id: other-commands title: Additional Commands flags: - id: agent name: --agent <[ auto | yes | no ]> description: 'Override agent detection: yes, no, or auto (default auto)' default_value: auto accepted_values: - id: auto name: auto type: '[ auto | yes | no ]' - id: 'yes' name: 'yes' type: '[ auto | yes | no ]' - id: 'no' name: 'no' type: '[ auto | yes | no ]' - id: create-ticket name: --create-ticket description: create a support ticket for any CLI error default_value: 'false' - id: debug name: --debug description: output debug logs to stderr default_value: 'false' - id: dns-resolver name: --dns-resolver <[ native | https ]> description: lookup domain names using the specified resolver default_value: native accepted_values: - id: native name: native type: '[ native | https ]' - id: https name: https type: '[ native | https ]' - id: experimental name: --experimental description: enable experimental features default_value: 'false' - id: help name: -h, --help description: Show help information default_value: 'false' - id: network-id name: --network-id description: use the specified docker network instead of a generated one default_value: '' - id: output name: -o, --output <[ env | pretty | json | toml | yaml ]> description: output format of status variables default_value: pretty accepted_values: - id: env name: env type: '[ env | pretty | json | toml | yaml ]' - id: pretty name: pretty type: '[ env | pretty | json | toml | yaml ]' - id: json name: json type: '[ env | pretty | json | toml | yaml ]' - id: toml name: toml type: '[ env | pretty | json | toml | yaml ]' - id: yaml name: yaml type: '[ env | pretty | json | toml | yaml ]' - id: output-format name: --output-format <[ text | json | stream-json ]> description: 'Output format: text (default), json, or stream-json (NDJSON)' default_value: text accepted_values: - id: text name: text type: '[ text | json | stream-json ]' - id: json name: json type: '[ text | json | stream-json ]' - id: stream-json name: stream-json type: '[ text | json | stream-json ]' - id: profile name: --profile description: use a specific profile for connecting to Supabase API default_value: supabase - id: workdir name: --workdir description: path to the directory containing your supabase/ folder; used exactly as given, with no ancestor directory search (defaults to searching upward from the current directory) default_value: '' - id: 'yes' name: --yes description: answer yes to all prompts default_value: 'false' commands: - id: supabase-backups title: supabase backups summary: Manage Supabase physical backups description: Manage Supabase physical backups. tags: - management-api links: [] subcommands: - supabase-backups-list - supabase-backups-restore flags: [] - id: supabase-backups-list title: supabase backups list summary: Lists available physical backups description: Lists available physical backups examples: - id: example-1 name: List all physical backups code: supabase backups list - id: example-2 name: List backups for a specific project code: supabase backups list --project-ref tags: [] links: [] usage: supabase backups list [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: supabase-backups-restore title: supabase backups restore summary: Restore to a specific timestamp using PITR description: Restore to a specific timestamp using PITR examples: - id: example-1 name: Restore to the given Unix epoch timestamp code: supabase backups restore --timestamp 1707407047 tags: [] links: [] usage: supabase backups restore [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: timestamp name: -t, --timestamp description: The recovery time target in seconds since epoch. default_value: '0' - id: supabase-bootstrap title: supabase bootstrap summary: Bootstrap a Supabase project from a starter template description: Bootstrap a Supabase project from a starter template. tags: - quick-start links: [] usage: supabase bootstrap [template] [flags] subcommands: [] flags: - id: password name: -p, --password description: Password to your remote Postgres database. default_value: '' - id: supabase-branches title: supabase branches summary: Manage preview branches description: Manage Supabase preview branches. tags: - management-api links: [] subcommands: - supabase-branches-create - supabase-branches-delete - supabase-branches-get - supabase-branches-list - supabase-branches-pause - supabase-branches-unpause - supabase-branches-update flags: [] - id: supabase-branches-create title: supabase branches create summary: Create a preview branch description: Create a preview branch for the linked project. tags: [] links: [] usage: supabase branches create [name] [flags] subcommands: [] flags: - id: git-branch name: --git-branch description: Associate a git branch with the new preview branch. default_value: '' - id: notify-url name: --notify-url description: URL to notify when branch is active healthy. default_value: '' - id: persistent name: --persistent description: Whether to create a persistent branch. default_value: 'false' - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: region name: --region description: Select a region to deploy the branch database. default_value: '' accepted_values: - id: ap-east-1 name: ap-east-1 type: string - id: ap-northeast-1 name: ap-northeast-1 type: string - id: ap-northeast-2 name: ap-northeast-2 type: string - id: ap-south-1 name: ap-south-1 type: string - id: ap-southeast-1 name: ap-southeast-1 type: string - id: ap-southeast-2 name: ap-southeast-2 type: string - id: ca-central-1 name: ca-central-1 type: string - id: eu-central-1 name: eu-central-1 type: string - id: eu-central-2 name: eu-central-2 type: string - id: eu-north-1 name: eu-north-1 type: string - id: eu-west-1 name: eu-west-1 type: string - id: eu-west-2 name: eu-west-2 type: string - id: eu-west-3 name: eu-west-3 type: string - id: sa-east-1 name: sa-east-1 type: string - id: us-east-1 name: us-east-1 type: string - id: us-east-2 name: us-east-2 type: string - id: us-west-1 name: us-west-1 type: string - id: us-west-2 name: us-west-2 type: string - id: size name: --size description: Select a desired instance size for the branch database. default_value: '' accepted_values: - id: large name: large type: string - id: medium name: medium type: string - id: micro name: micro type: string - id: 12xlarge name: 12xlarge type: string - id: 16xlarge name: 16xlarge type: string - id: 24xlarge name: 24xlarge type: string - id: 24xlarge_high_memory name: 24xlarge_high_memory type: string - id: 24xlarge_optimized_cpu name: 24xlarge_optimized_cpu type: string - id: 24xlarge_optimized_memory name: 24xlarge_optimized_memory type: string - id: 2xlarge name: 2xlarge type: string - id: 48xlarge name: 48xlarge type: string - id: 48xlarge_high_memory name: 48xlarge_high_memory type: string - id: 48xlarge_optimized_cpu name: 48xlarge_optimized_cpu type: string - id: 48xlarge_optimized_memory name: 48xlarge_optimized_memory type: string - id: 4xlarge name: 4xlarge type: string - id: 8xlarge name: 8xlarge type: string - id: small name: small type: string - id: xlarge name: xlarge type: string - id: with-data name: --with-data description: Whether to clone production data to the branch database. default_value: 'false' - id: supabase-branches-delete title: supabase branches delete summary: Delete a preview branch description: Delete a preview branch by its name or ID. tags: [] links: [] usage: supabase branches delete [name] [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: supabase-branches-get title: supabase branches get summary: Retrieve details of a preview branch description: |- Retrieve details of the specified preview branch. Note: For the main branch, password-dependent fields (POSTGRES_URL, POSTGRES_URL_NON_POOLING) are not populated because production database credentials are not retrievable via API. tags: [] links: [] usage: supabase branches get [name] [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: supabase-branches-list title: supabase branches list summary: List all preview branches description: List all preview branches of the linked project. tags: [] links: [] usage: supabase branches list [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: supabase-branches-pause title: supabase branches pause summary: Pause a preview branch description: Pause a preview branch. tags: [] links: [] usage: supabase branches pause [name] [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: supabase-branches-unpause title: supabase branches unpause summary: Unpause a preview branch description: Unpause a preview branch. tags: [] links: [] usage: supabase branches unpause [name] [flags] subcommands: [] flags: - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: supabase-branches-update title: supabase branches update summary: Update a preview branch description: Update a preview branch by its name or ID. tags: [] links: [] usage: supabase branches update [name] [flags] subcommands: [] flags: - id: git-branch name: --git-branch description: Change the associated git branch. default_value: '' - id: name name: --name description: Rename the preview branch. default_value: '' - id: notify-url name: --notify-url description: URL to notify when branch is active healthy. default_value: '' - id: persistent name: --persistent description: Switch between ephemeral and persistent branch. default_value: 'false' - id: project-ref name: --project-ref description: Project ref of the Supabase project. default_value: '' - id: status name: --status description: Override the current branch status. default_value: '' accepted_values: - id: RUNNING_MIGRATIONS name: RUNNING_MIGRATIONS type: string - id: MIGRATIONS_PASSED name: MIGRATIONS_PASSED type: string - id: MIGRATIONS_FAILED name: MIGRATIONS_FAILED type: string - id: FUNCTIONS_DEPLOYED name: FUNCTIONS_DEPLOYED type: string - id: FUNCTIONS_FAILED name: FUNCTIONS_FAILED type: string - id: supabase-completion title: supabase completion summary: Generate the autocompletion script for the specified shell description: |- 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. tags: - other-commands links: [] subcommands: - supabase-completion-bash - supabase-completion-fish - supabase-completion-powershell - supabase-completion-zsh flags: [] - id: supabase-completion-bash title: supabase completion bash summary: Generate the autocompletion script for bash description: |- 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. tags: [] links: [] usage: supabase completion bash [flags] subcommands: [] flags: - id: no-descriptions name: --no-descriptions description: disable completion descriptions default_value: 'false' - id: supabase-completion-fish title: supabase completion fish summary: Generate the autocompletion script for fish description: |- 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. tags: [] links: [] usage: supabase completion fish [flags] subcommands: [] flags: - id: no-descriptions name: --no-descriptions description: disable completion descriptions default_value: 'false' - id: supabase-completion-powershell title: supabase completion powershell summary: Generate the autocompletion script for powershell description: |- 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. tags: [] links: [] usage: supabase completion powershell [flags] subcommands: [] flags: - id: no-descriptions name: --no-descriptions description: disable completion descriptions default_value: 'false' - id: supabase-completion-zsh title: supabase completion zsh summary: Generate the autocompletion script for zsh description: |- 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) 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. tags: [] links: [] usage: supabase completion zsh [flags] subcommands: [] flags: - id: no-descriptions name: --no-descriptions description: disable completion descriptions default_value: 'false' - id: supabase-config title: supabase config summary: Manage project configurations description: Manage Supabase project configurations. tags: - management-api links: [] subcommands: - supabase-config-diff - supabase-config-pull - supabase-config-push flags: [] - id: supabase-config-diff title: supabase config diff summary: Diff local config against a remote project description: | Shows the configuration differences between the local `supabase/config.toml` and the effective configuration of a remote project or branch. Read-only: it never modifies the local file or any remote configuration. Pass `--project-ref` to compare against a specific project, or the name (or UUID) of a branch of the currently linked project — values that are exactly 20 lowercase letters are always treated as project refs. Without it, the linked project is the target. When the target ref matches a `[remotes.*]` block's `project_id`, that block's merged config is the local side of the comparison. Only platform-managed properties are compared. Local-stack-only sections — `[studio]`, `[analytics]`, `[functions]`, `[edge_runtime]`, port numbers, image version pins, `[db.migrations]`, and similar — have no hosted counterpart and are never reported, whether or not your file declares them. Each difference is classified as `update` (the file declares a value that differs remotely), `remote-only` (the remote differs while the file is silent — the shown local value is the schema default a `config push` would write), or `local-only` (the file declares a value the remote did not report). `(unset)` means the local side has no value at all; `(not returned)` means the response did not carry the property. Secret values are never compared — the platform only reports digests — and are listed in a masked-credentials note instead, as are declared properties that `config push` cannot communicate and any block the response omitted entirely. Local values are shown as the configuration your file would produce once pushed, not its literal spelling: a duration written as `"1m"` renders as `"1m0s"`, and byte sizes are shown in the units you wrote. With `--exit-code`, the command exits `2` when any difference is found, keeping exit `1` for errors — so scripts can distinguish drift from failure. Machine-readable output is available through `--output-format json|stream-json` — a versioned payload (`schema_version`, `config_schema`, `target`, `scope`, `changes[]`, `masked[]`, `unmanaged[]`, `counts`) with per-change `path`s as segment arrays. The legacy global `-o`/`--output` flag is not supported by this command; use `--output-format json|stream-json` instead. examples: - id: example-1 name: Diff against the linked project code: supabase config diff - id: example-2 name: Diff against the 'staging' branch, exiting 2 on drift code: supabase config diff --project-ref staging --exit-code tags: [] links: [] usage: supabase config diff [flags] subcommands: [] flags: - id: exit-code name: --exit-code description: Exit with status 2 when any difference is found (errors keep exiting 1). default_value: 'false' - id: project-ref name: --project-ref description: Project ref of the Supabase project, or the name (or UUID) of one of its branches. Values that are exactly 20 lowercase letters are always treated as project refs. default_value: '' - id: supabase-config-pull title: supabase config pull summary: Pull remote config into supabase/config.toml description: | Writes the effective configuration of a remote project or branch into the local `supabase/config.toml`/`config.json` — the write side of `supabase config diff`. Every write is a surgical, format-preserving edit: comments, key ordering, and quoting elsewhere in the file are left untouched, and only the values that actually change are rewritten. Pass `--project-ref` to pull from a specific project, or the name (or UUID) of a branch of the currently linked project — values that are exactly 20 lowercase letters are always treated as project refs. Without it, the linked project is the target. Where a pulled value lands depends on whether the target is already tracked by a `[remotes.*]` block, not on how you named it: if any block's `project_id` already matches the resolved ref, that block is reused — whatever its own label — and every value lands there. Otherwise, if the target was named as a branch, a new `[remotes.]` block is created (a branch resolved by UUID falls back to the project ref itself as its label). Only when neither applies — a bare `--project-ref` naming a project directly, or the linked project with no branch involved — do values land at the config root. `--remote-label` overrides the block config pull would otherwise reuse or create; naming a block that already tracks a different project, or naming nothing while a different block already tracks this exact ref, is an error rather than a silent overwrite. A `[remotes.*]` block whose `project_id` is an `env(...)` reference that merely _resolves_ to the target ref is never reused or rewritten — that is a hard error naming the variable, since a value written there would never actually take effect on the next load. Creating a new block always writes its `project_id`, even when every value it would otherwise carry already matches the local defaults — otherwise the block could never be reused on a later pull. Writing to the config root can also affect `supabase start`: a handful of root-scoped settings — `auth.site_url`, `db.settings.*`, `db.major_version` (which changes what `supabase start` boots), `db.pooler.*`, and similar — also govern the local stack, so pulling a hosted value into them is a real change to local dev behavior, not just a record of the hosted project's own setting. `config pull` warns about this rather than refusing; writing the same value into a `[remotes.*]` block is unaffected. Passing `--remote-label` is the escape hatch: it diverts what would otherwise be a root-bound pull into a `[remotes.