Supabase CLI v3: local is the new default, and your CI needs --remote --yes

Supabase CLI v3 targets the local database by default and asks before touching your hosted project. What breaks in CI and how to migrate.

Igor Calabraro

· 7 min read

In this post

If you run Supabase with Next.js, there is probably a supabase db push or a supabase gen types sitting in some package.json or GitHub Actions workflow that nobody looks at anymore. On November 2, CLI v3.0.0 became the default install on npm, Scoop, the Linux packages and the supabase/setup-cli action; Homebrew followed on November 3. The official changelog, dated November 4, flags it as a breaking change. My take: v3 flips the CLI's default from "implicitly remote" to "local unless you say otherwise", which is a safety upgrade that costs you a review of every script that talks to your hosted project.

#What changed, in one table

Areav2v3
Target of db push, db pull, db dump, migration list, gen types, storageLinked project or a specific flagLocal stack, unless you pass --remote
Pointing at the remote--linked, --project-ref, --db-url--remote, --remote=<ref> or --remote=<postgres-url> (the old flags are deprecated)
Changes to the hosted projectRun right awayAsk for confirmation, defaulting to "No"
CI with no interactive terminalWorksFails with HostedMutationConsentRequiredError without --yes
echo y | to confirmWorksNo longer confirms anything
Schema diff (db diff, db pull)migrapg-delta by default
[inbucket] in config.tomlAcceptedRenamed to [local_smtp]

Commands that require confirmation when they change the hosted project include db push, functions deploy, secrets set and config push. Removed commands and flags exit with code 1 and print their replacement, so at least the failure is explicit.

#Why the flip makes sense

With v2, forgetting a flag could mean running a migration against production when you meant to test locally. With v3, the likely mistake is the opposite: the command runs against the local database and the remote stays untouched. Annoying, but reversible.

That matters more today because it is not only people typing commands. Coding agents run the CLI in a terminal, and automation scripts run unattended. In my view, "local by default plus explicit consent for remote" is exactly the kind of guardrail you want when an agent or a CI job holds the project token. The catch is the side effect: a pipeline that used to push migrations may now "succeed" against a local database that doesn't even exist on the runner, or stop on a consent error.

#Step 1: find every CLI call

Start with an inventory. These commands look for CLI calls and changed flags in the places they usually live:

# calls that now depend on --remote and/or --yes
grep -rnE "supabase (db (push|pull|dump|diff)|migration|gen types|storage|functions deploy|secrets set|config push)" \
  .github package.json scripts 2>/dev/null

# deprecated flags, removed commands and piped confirmations
grep -rnE -- "--linked|--project-ref|--project-id|--db-url|db remote|gen keys|echo y \|" \
  .github package.json scripts 2>/dev/null

Each hit falls into one of three buckets: the command should run locally (usually nothing to do), it should run against the remote (needs --remote), or it changes the hosted project (needs --remote and --yes).

#Step 2: rewrite the commands

The most common conversions, according to the official migration guide:

Before (v2)After (v3)
supabase db pushsupabase db push --yes --remote
supabase db push --db-url "$DB_URL"supabase db push --yes --remote="$DB_URL"
supabase gen types typescript --project-id "$REF"supabase gen types typescript --remote="$REF"
supabase gen types typescript --localsupabase gen types typescript
supabase functions deploysupabase functions deploy --yes
supabase secrets set ...supabase secrets set ... --yes
supabase db remote commitsupabase db pull --remote

Two details trip people up: --remote with a value needs the =, and when a command takes a positional argument, --remote goes last, as in supabase migration repair 20240101000000 --status reverted --remote. secrets unset also changed: it now requires --all to delete every secret.

A migration deploy workflow updated for v3 looks like this:

# .github/workflows/db-deploy.yml
name: Database deploy
on:
  push:
    branches: [master]
    paths: ["supabase/migrations/**"]
permissions:
  contents: read
jobs:
  migrate:
    runs-on: ubuntu-latest
    env:
      SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
      SUPABASE_DB_URL: ${{ secrets.SUPABASE_DB_URL }}
    steps:
      - uses: actions/checkout@v6
      - uses: supabase/setup-cli@v3
        with:
          version: latest
      # --remote targets the hosted database; --yes confirms the change without a prompt
      - run: supabase db push --yes --remote="$SUPABASE_DB_URL"

The database URL comes from a secret instead of living in the YAML. And --yes only shows up on the step that changes the hosted project, which makes it obvious in PR review where the risk is.

#Step 3: review config and schema diffs

v3 also changes configuration precedence: flag, then shell variable, then project env files, then config.toml, then the default. In v2, a [remotes.<name>] section in config.toml beat the SUPABASE_* variables; now the variable wins, and the CLI warns you. The guide recommends running supabase config diff before your first config push and setting SUPABASE_ENV in CI. There is also a behavior fix: [auth.sms] enable_confirmations is now applied exactly as written, so double-check that value before pushing config.

For schema diffs, pg-delta is now the default engine for db diff and db pull, so the generated SQL may differ from what migra produced. If you want to compare calmly before adopting it, you can switch back to migra with [experimental.pgdelta] enabled = false in config.toml or the --use-migra flag.

#Migration checklist

  1. Upgrade to the latest v2 and resolve every deprecation warning.
  2. Rename [inbucket] to [local_smtp] in config.toml (recent v2 releases already read the new name).
  3. Run the grep commands from step 1 and add --remote and --yes where they belong.
  4. Review the SUPABASE_* variables in CI and run supabase config diff.
  5. If config.toml has no project_id, run supabase stop before upgrading.
  6. Generate a db diff with pg-delta on a branch and compare it with the previous output before merging.

#Conclusion

  • v3 targets the local database by default. Anything that must talk to the hosted project gets --remote, and anything that changes it gets --yes.
  • Take inventory before your next deploy. Two grep commands find the calls and flags that changed, and the official guide has the conversion table.
  • If you're short on time, pin v2 with the v2.stable channel, clear the deprecation warnings and migrate calmly, reviewing the SQL pg-delta generates.

#Sources

Want this level of care in your project?

Free 30-minute diagnosis: I look at your stack and tell you what needs attention.

Get my diagnosis

Liked it? Get the next one by email

One email when a new post is out. No spam — unsubscribe in one click.

By subscribing, you agree to the privacy policy.

Keep reading

All posts

Rather have me handle this in your project?

The same care as the posts, applied to your product. Free 30-minute diagnosis, no strings attached.