Skip to content

Supabase CLI

1.6k stars
official open-source Has MCP Cross-platform macOS Linux Windows Actively maintained

The official CLI for Supabase. Run Supabase locally, manage database migrations, deploy edge functions, and generate TypeScript types from your schema.

Supabase CLI has both a CLI and an MCP server. See when to use each

Part of the Supabase CLI tools for AI agents

What your agent can do

You build a perfect RLS policy in the Supabase dashboard. It works. Now you need to make it reproducible. There's no "export as migration" button. You copy-paste the SQL, manually create a migration file, hope you got everything. Forget one `ALTER DEFAULT PRIVILEGES` statement and your policy silently fails in production, returning empty arrays instead of errors. Your agent runs `supabase db diff --use-migra` and generates a clean migration file automatically.Your agent runs `supabase start` to spin up a full Supabase stack locally: Postgres, GoTrue (auth), Storage, PostgREST, and the Edge Functions runtime. The exact same environment as production, on your machine. Make schema changes locally, test them, then push migrations with `supabase db push`. No schema drift between environments. No "works on my machine" database bugs.Type generation eliminates runtime errors. Your agent runs `supabase gen types typescript` and every table, column, and relationship in your database becomes a TypeScript type. No manual type definitions, no drift between schema and code. One command, always in sync.Edge Functions develop locally with `supabase functions serve` (hot reload, instant feedback) and deploy with `supabase functions deploy`. Your agent handles the complete serverless loop without touching the dashboard.The insider detail: `supabase db diff` uses SQL syntax understanding (not text diff) to compare schema states. But the default output includes every default privilege, making migrations 10x more verbose than necessary. The `--use-migra` flag fixes this, but it's undocumented in the getting-started guides. Experienced Supabase developers always use it. Your agent knows to add it automatically.

Limitations

The local development stack (`supabase start`) requires Docker. Without Docker, remote-only operations still work (`db push`, `gen types`, `functions deploy`), but you lose the local-first workflow. Supabase-specific, with no support for plain Postgres or other BaaS platforms. Project creation and billing remain dashboard-only.

Key Commands

supabase start Start the local Supabase development stack (Postgres, Auth, Storage, Edge Functions)
supabase db push Push pending migrations to a remote Supabase database
supabase db pull Pull schema changes from a remote database into a local migration file
supabase gen types Generate TypeScript types from your database schema
supabase functions deploy Deploy an edge function to your Supabase project
supabase migration new Create a new blank migration file with a timestamped name
supabase bootstrap Set up a new Supabase project from a starter template

GitHub Stats

repo supabase/cli
stars 1.6k
language Go
license MIT
last commit Mar 10, 2026

FAQ

Is the Supabase CLI free?
Yes. The Supabase CLI is free and open-source under the MIT license. It works with all Supabase plans including the free tier. You pay for Supabase platform services, not the CLI. Install via `npm i supabase` as a dev dependency or `brew install supabase/tap/supabase` globally.
Does the Supabase CLI require Docker?
Docker is required only for `supabase start` (local development stack). Remote operations (`db push`, `gen types`, `functions deploy`, `link`) work without Docker. If Docker is not installed, the CLI prompts you when you first run `supabase start`.
How do you connect the CLI to a Supabase project?
Run `supabase login` to authenticate, then `supabase link --project-ref your-project-ref` to connect to a specific project. Find the project reference in your dashboard URL or settings page. Once linked, your agent runs `db push`, `gen types`, and `functions deploy` against that project automatically.
Can you use the Supabase CLI in CI/CD pipelines?
Yes. Set `SUPABASE_ACCESS_TOKEN` for authentication. Your agent runs `supabase db push` to apply migrations on deploy and `supabase gen types typescript` to verify types match the schema. All commands support non-interactive mode. Common in GitHub Actions and GitLab CI workflows.
What is the difference between supabase db push and supabase db pull?
`db push` applies local migration files to a remote database. `db pull` reads the remote schema and generates a local migration capturing any differences. Your agent uses `push` to deploy changes and `pull` to sync dashboard edits into your migration history. Always use `--use-migra` with `db diff` for clean output.

Last verified: Mar 14, 2026