The Supabase CLI is a command line program that runs a copy of Supabase on your own computer and moves database changes to your live project. Install it with Homebrew, Scoop or npm, run supabase init and supabase start, then supabase link and supabase db push to send migrations to the hosted project.
| System | Command |
|---|---|
| macOS or Linux (Homebrew) | brew install supabase/tap/supabase |
| Windows (Scoop) | scoop bucket add supabase https://github.com/supabase/scoop-bucket.git, then scoop install supabase |
| Any project (npm) | npm install supabase --save-dev, then run npx supabase |
| Linux packages | .apk, .deb or .rpm from the releases page |
Updated
Type part of a command or a word like types, or pick a group, to narrow the table below. Every row is a command from the official CLI reference with a short note on when a site owner reaches for it.
Search commands. Group: All, Setup, Local stack, Database, Types, Edge Functions
16 commands shown
| Command | What it does |
|---|---|
supabase login | Signs the CLI in to your Supabase account in the browser, or with --token. |
supabase init | Creates the supabase folder and config file in the current project. |
supabase link --project-ref <project-ref> | Connects this folder to a hosted project by its reference ID. |
supabase start | Boots the local stack in containers and prints the local URLs and keys. |
supabase stop | Shuts the local stack down. Add --no-backup to discard local data. |
supabase status | Shows the local URLs and keys again. Add -o env to print them as environment variables. |
supabase migration new <name> | Makes an empty, timestamped SQL file in supabase/migrations for your change. |
supabase db reset | Rebuilds the local database from the migrations and runs the seed file. |
supabase db push | Applies new local migrations to the linked database. Try --dry-run first. |
supabase db pull | Writes the remote schema into a new migration file. Needs a running Docker daemon. |
supabase db diff -f <name> | Compares schemas and saves the difference as a migration with -f. |
supabase gen types --lang typescript --linked > database.types.ts | Writes TypeScript types for your tables. Use --local for the local database. |
supabase functions new <name> | Creates a new Edge Function folder with starter code. |
supabase functions serve | Runs your Edge Functions locally while you test. |
supabase functions deploy <name> | Uploads an Edge Function to the hosted project. |
supabase secrets set NAME=VALUE | Stores a secret, such as a payment key, for your hosted Edge Functions. |
Run these in your project folder. Replace the reference ID with the one in your project's settings.
The order matters: create the migration, check it locally with a reset, then push it.
npx supabase init
npx supabase start
npx supabase migration new add_orders_table
# write your SQL in the new file under supabase/migrations
npx supabase db reset
npx supabase login
npx supabase link --project-ref abcdefghijklmnopqrst
npx supabase db push --dry-run
npx supabase db push
npx supabase gen types --lang typescript --linked > database.types.ts
A migration is a numbered SQL file that records one change to your database. Keeping changes in files means you can test them locally, review them, and replay them on a fresh project in the same order.
Dashboard edits still happen. When they do, supabase db diff or supabase db pull turns the difference into a migration so your files catch up.
For the local stack, yes, or another container runtime. The guide names OrbStack, Rancher Desktop, Podman and colima as alternatives and mentions an experimental native runtime for Linux and Apple silicon Macs.
The official guide says the npm package adds the CLI to a single project rather than a global command. Use Homebrew or Scoop for a system-wide install.
db push sends your local migration files to a database. db pull reads the schema of a remote database and writes it into a new migration file, which is handy when changes were made in the dashboard.
Run supabase gen types --lang typescript with --local for the local database or --linked for the hosted one, and redirect the output into a file in your project.
Create one with supabase functions new and a name, then run supabase functions deploy with that name. Set its secrets with supabase secrets set NAME=VALUE.
Related: Supabase Auth guide, Supabase pricing, Supabase MCP server, Supabase vs Firebase.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
We.Inc is an AI-powered website builder you can resell under your own brand. Launch a branded client dashboard, bill on Stripe Connect, and deliver AI-generated websites in minutes. White-label plans start at $99 a month for 25 client sites, with a 7-day free trial and no per-site fees.