clispec: '001' info: id: cli version: 3.4.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: [] flags: - id: agent name: --agent <[ auto | yes | no ]> description: 'Override agent detection: yes, no, or 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: 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, 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; hosted changes only accept this flag or SUPABASE_YES exported in your shell, never supabase/.env or another .env file default_value: 'false' commands: - id: supabase-backups title: supabase backups summary: Manage Supabase physical backups description: Manage Supabase physical backups. tags: [] 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 --remote= tags: [] links: [] usage: supabase backups list [flags] subcommands: [] flags: - id: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: [] 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: [] 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: 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - 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: [] 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: [] links: [] subcommands: - supabase-config-convert - supabase-config-diff - supabase-config-pull - supabase-config-push - supabase-config-validate flags: [] - id: supabase-config-convert title: supabase config convert summary: Convert config.toml to config.jsonc, or back with --to toml description: | Converts `supabase/config.toml` to `supabase/config.jsonc` and moves the TOML file to `supabase/config.toml.bak`. Comments are carried over as `//` comments and the document gets a `$schema` entry, so editors validate it against the hosted config schema. `--to json` is the default. For `--to toml`, see [Convert back to TOML](#convert-back-to-toml). The conversion reads the file as written: values keep their meaning, `env(NAME)` references are copied as text, and nothing is resolved from your environment. Numbers are written in JSON form, so `0x1F` becomes `31` and `1_000` becomes `1000`. The converted document is parsed again and compared with the original before anything is written; if the two differ, the file is not valid UTF-8, or it holds a value JSON cannot represent (a TOML date, `inf` or `nan`), the command refuses and leaves `config.toml` untouched. Comments keep their place by these rules: a comment directly above a key or table leads it; a comment block directly below a key or table, followed by a blank line or another table, trails it; a comment block with blank lines on both sides leads the next entry, or the commented-out example that follows it; a comment on the same line as a key or table header stays on that line. Comments inside a multi-line array of plain values stay beside their elements. Comments inside nested arrays or inline tables cannot be placed, so this command does not keep them in place: they move to the line above their key and the command lists each one. Commented-out TOML examples become commented-out JSONC members, so removing the `//` from one member gives valid JSONC. A commented `# key = value` stays in the object it follows as `// "key": value,`. A commented table (`# [auth.hook.custom_access_token]` and the keys under it) is written as a commented object inside the nearest enclosing table that exists, merged with other examples under the same missing parent, and moves with the comment lines directly above it; it sits before the first later-defined entry of that table, or at the end of the table when none follows. Comments that do not parse as a single TOML key or table header stay as plain `//` comments. Two kinds of commented example are copied as plain comments or need care when uncommented. Examples inside an array of tables (`[[name]]`, commented or not) stay as plain `//` comments. When a table lists alternative values for the same key (`# key = "a"` then `# key = "b"`), both become commented members, so uncomment only one of them. `--dry-run` prints the converted document to stdout and writes nothing. If the project has `.vscode/settings.json`, the command also adds the schema domain to `json.schemaDownload.trustedDomains` there, keeping its comments; the file is never created. Everyone on the project needs Supabase CLI 3.1.0 or later: older CLIs ignore `config.jsonc` and run with defaults. The command ends with a summary of the files it created, moved and updated, any relocated comments, this compatibility note and the undo command; with `--dry-run` the same summary, as a preview, goes to stderr. If only `supabase/config.json` or `supabase/config.jsonc` exists, the command reports that there is nothing to convert and exits 0; pass `--to toml` to convert it back. It fails when `config.toml` and a JSON config both exist, because the JSON file takes precedence; delete it first to convert `config.toml` again. The legacy global `-o`/`--output` flag is not supported; use `--output-format json|stream-json` for a machine-readable result. ## Convert back to TOML `--to toml` converts `supabase/config.jsonc` or `supabase/config.json` to `supabase/config.toml` and moves the JSON file to a backup such as `supabase/config.jsonc.bak`. If that backup name is taken, the CLI uses a numbered name such as `config.jsonc.2.bak`. It works for any project, including one created on JSONC. The `$schema` entry becomes a `#:schema` line. The CLI carries comments over as `#` comments. Members commented out with `//` become TOML comments such as `# key = value` or `# [section]`. When a value must be inline, such as an array mixing tables and scalars, the CLI moves the original commented-out member above the key. A member inside a `/* */` block comment keeps its JSON syntax behind `#`. Comments that TOML has no place for, such as one inside an array or inline table, move to a nearby line and the command lists each one. Before writing, the CLI parses the TOML and compares its values with the original. If they differ, it stops without writing. It also stops without writing if the file contains `null`, a whole number too large to convert exactly, or nesting too deep to convert. If `supabase/config.toml` already exists, the command fails, because converting would overwrite it; move or delete it first. If the project is already on `config.toml`, it reports that there is nothing to convert and exits 0. `--dry-run` prints the TOML to stdout and the summary to stderr in text mode; with `--output-format json`, the TOML is in the result's `content` field. The printed undo command restores the JSON file. In an interactive terminal, unless you've opted out of telemetry, the command then asks what made you switch back. The answer is optional and is recorded with the command's telemetry. `--reason editor|third-party-tool|older-cli|ci-or-deploy|ai-agent|preference|other` answers it without the prompt, and requires `--to toml`. ## Undo Move the backup back and remove the JSONC file: ```sh mv -- supabase/config.toml.bak supabase/config.toml && rm -- supabase/config.jsonc ``` If a backup from an earlier conversion already exists, the command uses the next free name (`config.toml.2.bak`, and so on). The printed undo command names that backup, with paths relative to the directory you ran the command from; on Windows it is the PowerShell equivalent. ## After converting - Delete `supabase/config.toml.bak` once you no longer need the undo, so it is not committed. It stays outside `supabase/.temp` because `supabase unlink` and `supabase projects delete` remove that directory. - Commit the conversion on its own. The history of the old file stays available with `git log -- supabase/config.toml`. - Search the repository, CI workflows and Dockerfiles for `config.toml` and update any references. - Bump pinned Supabase CLI versions (for example `supabase/setup-cli`) to 3.1.0 or later. examples: - id: example-1 name: Preview the converted config.jsonc without writing it code: supabase config convert --dry-run - id: example-2 name: Convert supabase/config.toml to supabase/config.jsonc code: supabase config convert - id: example-3 name: Convert supabase/config.jsonc back to supabase/config.toml code: supabase config convert --to toml tags: [] links: [] usage: supabase config convert [flags] subcommands: [] flags: - id: dry-run name: --dry-run description: Print the converted configuration to stdout without writing files. default_value: 'false' - id: reason name: --reason description: Why you're switching back to TOML. The CLI uses this choice only for usage telemetry. default_value: '' accepted_values: - id: editor name: editor type: string - id: third-party-tool name: third-party-tool type: string - id: older-cli name: older-cli type: string - id: ci-or-deploy name: ci-or-deploy type: string - id: ai-agent name: ai-agent type: string - id: preference name: preference type: string - id: other name: other type: string - id: to name: --to <[ json | toml ]> description: Choose json to write supabase/config.jsonc or toml to write supabase/config.toml. default_value: json accepted_values: - id: json name: json type: '[ json | toml ]' - id: toml name: toml type: '[ json | toml ]' - 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 `--remote=` 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. `--project-ref` still works in v3 but is deprecated and removed in v4; use `--remote`. 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. `target` identifies the compared project: `kind` (`linked`), `project_ref`, `project_name` and `environment` (`production`, `branch` or `unverified`) when known, `parent_project_ref` for a branch, `branch` when it was named, and `local_scope` (`base` or `remotes.`). 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 --exit-code --remote=staging 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: remote name: --remote[=] description: 'Target another project: `--remote=`. Defaults to the linked project.' default_value: 'false' - id: supabase-config-pull title: supabase config pull summary: Pull remote config into the project config file 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 `--remote=` 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. `--project-ref` still works in v3 but is deprecated and removed in v4; use `--remote`. 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 — `--remote=` naming a project directly, or the linked project (a bare `--remote` or no flag) 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.