| name | supabase-cli |
| description | Use the Supabase CLI to manage databases, run migrations, manage auth, storage, edge functions, and local development. Use this instead of the Supabase MCP server. |
Supabase CLI
Official CLI for Supabase. Manage PostgreSQL databases, auth, storage, edge functions, and local development.
Authentication
supabase login
supabase link --project-ref PROJECT_REF
Common Commands
Local Development
supabase init
supabase start
supabase stop
supabase status
supabase db reset
Database & Migrations
supabase migration new create_users
supabase migration list
supabase db push
supabase db pull
supabase db diff --schema public
supabase db dump --data-only -f seed.sql
Edge Functions
supabase functions new my-function
supabase functions serve my-function
supabase functions deploy my-function
supabase functions list
supabase functions delete my-function
Type Generation
supabase gen types typescript --local > types/supabase.ts
supabase gen types typescript --linked > types/supabase.ts
Secrets
supabase secrets set MY_SECRET=value
supabase secrets list
supabase secrets unset MY_SECRET
Agent Best Practices
- Use
supabase status to get local API URL and anon key
- Always create migrations for schema changes instead of modifying directly
- Use
supabase db diff to check for drift between local and remote
- Use
supabase gen types after schema changes to keep types in sync
- Run
supabase db reset to test migrations from scratch
- Use
supabase functions serve with --env-file for local secrets
Example Workflows
Create and apply a migration
supabase migration new add_profiles_table
supabase db reset
supabase db push
Generate TypeScript types
supabase gen types typescript --linked > src/types/database.ts