---
title: "Supabase CLI v2: Config as Code"
description: "Supabase CLI v2 adds configuration as code: a committed `config.toml` declares Auth redirect URLs, Edge Function settings, Storage buckets seeded from local files, Postgres settings and experimental database webhooks, and these are promoted across preview, staging and production environments. `supabase link` diffs local config against the remote project to detect drift."
url: "https://swe.quest/articles/supabase-cli-v2-config-as-code-bd9ba93f5cb80d9d"
canonical: "https://supabase.com/blog/cli-v2-config-as-code"
source: "Supabase"
published: "2024-12-04"
difficulty: "medium"
kind: "Release"
reading_minutes: 5
tags: ["configuration","infrastructure-as-code","developer-tools","deployment","postgres"]
---

# Supabase CLI v2: Config as Code

A post on [Supabase](https://swe.quest/sources/supabase.md), published 2024-12-04, 5 min read, Release. Original: [https://supabase.com/blog/cli-v2-config-as-code](https://supabase.com/blog/cli-v2-config-as-code)

## Summary

Supabase CLI v2 adds configuration as code: a committed \`config.toml\` declares Auth redirect URLs, Edge Function settings, Storage buckets seeded from local files, Postgres settings and experimental database webhooks, and these are promoted across preview, staging and production environments. \`supabase link\` diffs local config against the remote project to detect drift. With Branching enabled, config syncs automatically to ephemeral branches, and \`\[remotes\]\` blocks keyed by project ID override settings for persistent branches. The Management API decides whether a Postgres setting needs a restart or can be applied with a reload signal. Edge Function secrets still have to be set manually on branches, and v2 has no breaking changes.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Configuration management](https://swe.quest/tags/configuration.md) (Reliability & operations)
- [Infrastructure as code](https://swe.quest/tags/infrastructure-as-code.md) (Infrastructure)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [PostgreSQL](https://swe.quest/tags/postgres.md) (Data & databases)

## Prerequisites

- Supabase basics
- CI/CD pipelines ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))
- TOML configuration ([easy posts on Configuration management](https://swe.quest/tags/configuration.md?difficulty=easy))

## Keywords

Supabase CLI, config.toml, Supabase Branching, Edge Functions, Vercel, GitHub Actions

## Related posts

- [Supabase CLI v1 and Management API Beta](https://swe.quest/articles/supabase-cli-v1-and-management-api-beta-40e0f641270aa760.md): Supabase · 2022-08-15 · Medium · 4 min read · Schema migrations, Developer tools, PostgreSQL, CI/CD, API design
  Supabase CLI v1 leaves beta with commands to manage organizations, projects and Edge Functions, plus database migration tooling, CI/CD workflows and TypeScript type generation.
- [Faster config, migrations and functions on branches](https://swe.quest/articles/faster-config-migrations-and-functions-on-branches-f64718202c9feaa6.md): Supabase · 2026-10-15 · Medium · 7 min read · PostgreSQL, Schema migrations, Deployment, CI/CD, Serverless
  Supabase preview branches are separate projects that become ready in about 20 seconds (median) by running three mostly parallel workflows: copying configuration, applying migrations, and deploying Edge Functions.
- [Supabase Branching](https://swe.quest/articles/supabase-branching-4fbb0c9896d51627.md): Supabase · 2023-12-13 · Medium · 5 min read · Schema migrations, PostgreSQL, CI/CD, Deployment
  Supabase Branching gives each Git branch an isolated hosted Preview environment with its own Postgres database, Auth, Storage, Realtime, Edge Functions and APIs, plus separate credentials.
- [The Vibe Coder's Guide to Supabase Environments](https://swe.quest/articles/the-vibe-coder-s-guide-to-supabase-environments-2ce71129a08af138.md): Supabase · 2025-08-17 · Medium · 10 min read · Schema migrations, CI/CD, Deployment, PostgreSQL, Identity & auth
  Separate Supabase projects for development and production, with all schema changes captured as timestamped SQL migrations in a Git-tracked supabase/ directory, keep a fast workflow from breaking live data.
- [Supabase Local Dev: migrations, branching, and observability](https://swe.quest/articles/supabase-local-dev-migrations-branching-and-observability-770def662fe57683.md): Supabase · 2023-08-08 · Easy · 6 min read · PostgreSQL, Developer tools, Schema migrations, Testing, Deployment
  Supabase's CLI gains a batch of Postgres local-development features: \`supabase inspect db\` with 19 diagnostic commands adapted from Heroku's pg-extras, \`db dump\` backups built on pg\_dump, migration squashing and diffing via migra, pgTAP testing with \`supabase test\`, plpgsql\_check linting, seeding, and TypeScript type generation that now detects foreign-key relationships.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
