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

When to use

Supabase CLI is the fastest way to develop against Supabase locally. If you build with Supabase — Postgres, Auth, Storage, Edge Functions — this CLI replaces the dashboard for every repeatable operation and gives you a local development stack that mirrors production.The core workflow is local-first development. Run supabase start to spin up a full Supabase stack on your machine: Postgres, GoTrue (auth), Storage, PostgREST, and the Edge Functions runtime. You get a local environment identical to production without touching the cloud. Make schema changes locally, test them, then push migrations to your hosted project with supabase db push.Type generation is where the CLI saves the most time. Run supabase gen types typescript to generate TypeScript types directly from your database schema. Every table, column, and relationship becomes a type. No manual type definitions, no drift between your schema and your code. This single command eliminates an entire category of runtime errors.For teams, the CLI makes database migrations reproducible. Schema changes live as migration files in your repo, reviewable in pull requests, and applied deterministically across environments. No more "works on my machine" database issues.Edge Functions deployment is straightforward — supabase functions deploy pushes your Deno functions to Supabase's edge network. Combined with local serving via supabase functions serve, you get a complete serverless development loop without leaving the terminal.Install it as a dev dependency in any JavaScript or TypeScript project. The npm package wraps the Go binary, so it works everywhere Node runs.

When to skip

Skip the Supabase CLI if you don't use Supabase. This is a platform-specific tool — it manages Supabase projects, not generic Postgres databases. If you use plain Postgres, look at psql, pgcli, or dbmate for migrations.If your team works exclusively through the Supabase dashboard and you have no need for local development, CI/CD pipelines, or migration-based workflows, the CLI adds complexity without benefit. The dashboard handles project creation, table editing, and function deployment with a visual interface that requires no terminal experience.For simple projects where you create tables through the dashboard and never need type generation or migration files, the CLI is overkill. The point-and-click SQL editor in the dashboard is faster for one-off schema changes than writing migration files.The local development stack requires Docker. If Docker is not available in your environment — some corporate laptops, lightweight CI runners, or low-memory machines — you cannot run supabase start. You can still use the CLI for remote operations like db push, gen types, and functions deploy, but you lose the local-first workflow.If you only deploy edge functions and nothing else, the Supabase dashboard's function editor may be sufficient. The CLI's value compounds when you use multiple Supabase features together — database, auth, storage, and functions — rather than just one.

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. The CLI itself has no cost — pricing applies only to the Supabase platform services you connect to.
Does the Supabase CLI require Docker?
Docker is required only for supabase start (local development). Remote operations like db push, gen types, functions deploy, and link work without Docker. If Docker is not installed, the CLI will prompt you to install it 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. The project reference is found in your project's dashboard URL or settings page. Once linked, commands like db push and gen types operate against that project.
Can you use the Supabase CLI in CI/CD pipelines?
Yes. Set the SUPABASE_ACCESS_TOKEN environment variable for authentication. Common CI workflows include running supabase db push to apply migrations on deploy and supabase gen types to verify type generation matches the schema. The CLI supports non-interactive mode for all commands.
What is the difference between supabase db push and supabase db pull?
db push applies local migration files to a remote database. db pull does the reverse — it reads the remote schema and generates a local migration file capturing any differences. Use push for deploying changes, pull for syncing dashboard edits into your migration history.

Last verified: Mar 14, 2026