Supabase CLI
$ supabase Official High RiskSupabase CLI manages local Docker-backed Supabase environments, database migrations, schema diffs, TypeScript type generation, and Edge Functions. Supports --dry-run on db push and --output json on project management commands.
brew install supabase/tap/supabase Use supabase CLI for local migrations, gen types, and db diff; Supabase MCP is great for natural-language SQL exploration against a linked project.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --output json on listing/inspection commands, --dry-run on db push, and --yes non-interactive flags.
- Supports
--output json,--dry-run, and--yesacross key workflows
Local-first workflow plus db push --dry-run reduces migration surprises, though db reset and --linked remote commands require care.
--localvs--linkedseparation anddb push --dry-run- Destructive reset commands exist for local/linked DBs
Single Go binary via Homebrew/npx; full local stack commands require a local container runtime.
- Go binary distributed via
supabase/cli;supabase startrequires Docker
Covers migrations, schema diffing, typegen, and Edge Functions cleanly in one tool.
gen types typescriptanddb diffintegrate directly into coding loops
Official Supabase CLI (supabase/cli) with frequent releases under MIT.
- Official
supabase/clirepository
Complete CLI command reference in Supabase official documentation.
- Published reference at supabase.com/docs/reference/cli
Security, Auth & Guardrails
Access token stored in OS keychain/config or passed via SUPABASE_ACCESS_TOKEN env var.
CLI is MIT open-source; hosted Supabase projects follow free/pro plan limits.
# Supabase CLI Agent Rules - Always run `supabase db push --dry-run` before `supabase db push`. - Prefer `--local` for `gen types` and `db diff` during feature work. - NEVER run `supabase db reset --linked` or `supabase projects delete` autonomously.
Agent-Ready Command Recipes
Safe Read-Only Queries
supabase gen types typescript --local > src/types/supabase.ts
Keeps frontend/backend types synced with Postgres without touching remote prod.
--dry-run supabase db push --dry-run
Shows which SQL migrations would execute on the linked database without applying them.
Controlled Writes & Previews
supabase migration new add_users_index
Scaffolds a local SQL migration file for review before applying.
Strengths for Agents
- +
supabase db push --dry-runprovides safe pre-flight migration checks. - +
--localtype generation and diffing work seamlessly inside coding-agent loops. - + Supports
SUPABASE_ACCESS_TOKENand--yesfor CI/headless execution.
Caveats & Pitfalls
- ! Full local stack (
supabase start) needs Docker even though the CLI binary itself does not. - ! Accidental
--linkedflags ondb resetcan wipe remote staging/prod schemas.