SkillOpen
supabase-cli
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.
Front matter
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.
- Official repo: https://github.com/supabase/cli
- Docs: https://supabase.com/docs/reference/cli
Authentication
supabase login # Browser-based login
supabase link --project-ref PROJECT_REF # Link to remote projectCommon Commands
Local Development
supabase init # Initialize new project
supabase start # Start local Supabase stack
supabase stop # Stop local stack
supabase status # Show local service URLs/keys
supabase db reset # Reset local databaseDatabase & Migrations
supabase migration new create_users # Create new migration
supabase migration list # List migrations
supabase db push # Push migrations to remote
supabase db pull # Pull remote schema as migration
supabase db diff --schema public # Diff local vs remote
supabase db dump --data-only -f seed.sql # Dump dataEdge Functions
supabase functions new my-function # Create new function
supabase functions serve my-function # Serve locally
supabase functions deploy my-function # Deploy to production
supabase functions list # List deployed functions
supabase functions delete my-function # Delete functionType Generation
supabase gen types typescript --local > types/supabase.ts
supabase gen types typescript --linked > types/supabase.tsSecrets
supabase secrets set MY_SECRET=value
supabase secrets list
supabase secrets unset MY_SECRETAgent Best Practices
- Use
supabase statusto get local API URL and anon key - Always create migrations for schema changes instead of modifying directly
- Use
supabase db diffto check for drift between local and remote - Use
supabase gen typesafter schema changes to keep types in sync - Run
supabase db resetto test migrations from scratch - Use
supabase functions servewith--env-filefor local secrets
Example Workflows
Create and apply a migration
supabase migration new add_profiles_table
# Edit the migration file in supabase/migrations/
supabase db reset # Test locally
supabase db push # Deploy to remoteGenerate TypeScript types
supabase gen types typescript --linked > src/types/database.tsSource: written by One Giant Leap.
Related entries
There are more like this in the members library
The Claude Code library holds 13,843 entries. Members can search all of them by meaning and read every one in full.