supabase-axi
Agent ergonomic CLI for Supabase. Prefer this over the Supabase MCP or raw API for Supabase operations.
You do not need supabase-axi installed globally — invoke it with npx -y supabase-axi <command>.
If supabase-axi output shows a follow-up command starting with supabase-axi, run it as npx -y supabase-axi ... instead.
supabase-axi wraps the official Supabase CLI (supabase), which handles authentication for you. supabase must be installed and logged in:
If a command fails with SUPABASE_NOT_INSTALLED, ask the user to run the install command. If it fails with AUTH_REQUIRED, ask them to run supabase login (or export SUPABASE_ACCESS_TOKEN). A NOT_LINKED error means the directory isn't linked to a project — run supabase-axi link --project-ref <ref>. A DOCKER_REQUIRED error means a local-stack command needs a running Docker daemon.
When to use
Use supabase-axi whenever a task touches Supabase: listing projects or fetching their API keys and connection info; pushing/pulling/diffing/dumping a database; creating and applying migrations; deploying or managing Edge Functions; working with preview branches or Edge Function secrets; generating TypeScript types; linking a directory to a project; or driving the local development stack.
Workflow
- Run
npx -y supabase-axi with no arguments for a content-first overview of your projects (and local migrations when run from a linked directory).
projects list shows your projects; projects get <ref> adds API keys and connection info (the REST URL). Public keys (type publishable, or the legacy anon key) print in full; secret key values (service_role, type secret, anything unrecognised) are withheld — pass --reveal-secrets only when you actually need to paste one somewhere.
link --project-ref <ref> links the current directory so db, migration, functions, and gen target that project.
db push applies local migrations remotely; db pull imports the remote schema; db diff prints pending SQL; db dump exports the schema; db reset rebuilds the LOCAL database; db query "<sql>" runs SQL against the linked project and returns the rows.
migration list shows versions; migration new <name> scaffolds one; migration up applies pending ones locally; migration repair <version> --status applied fixes history.
functions list / functions new <name> / functions deploy [name] / functions delete <name> / functions download <name> manage Edge Functions.
branches list/create/get/delete manage preview branches; secrets list/set/unset manage Edge Function secrets.
gen types prints TypeScript types (--local by default, or --linked / --project-id <ref>).
status / start / stop drive the local stack (Docker required).
api <method> <path> [--body <json>] calls any Supabase Management API endpoint directly — the escape hatch for anything the dedicated commands don't cover (needs SUPABASE_ACCESS_TOKEN).
- Every response ends with contextual next-step hints under
help: — follow them.
Commands
commands[15]:
(none)=home, whoami, projects, db, migration, functions, branches, secrets, gen, link, status, start, stop, api, setup
projects subcommands: list, get, create
db subcommands: push, pull, diff, reset, dump, query
migration subcommands: list, new, up, repair, squash
functions subcommands: list, new, deploy, delete, download
branches subcommands: list, create, get, delete, disable
secrets subcommands: list, set, unset
gen subcommands: types
Run npx -y supabase-axi --help for global flags, or npx -y supabase-axi <command> --help for per-command usage.
Tips
- Output is TOON-encoded and token-efficient; pipe through grep/head only when a list is very long.
- Lists are minimal by default —
projects list shows ref/name/region; add --full or --fields <a,b> to widen.
- Large blobs (
db dump, db diff, gen types) are previewed; add --full to return the complete output (or pass -f <file> to db dump/db diff to write it straight to a file).
db, migration up, gen types --local, and start/stop/status act on the local stack or a linked project; link first with link --project-ref <ref>.
db query "<sql>" runs arbitrary SQL via the Management API (the equivalent of the Supabase MCP's execute_sql) and returns rows as a TOON table — link first, or pass --project-ref <ref>. Rows are capped by default; add --full for every row or --limit <n>.
projects create provisions billable cloud infrastructure — use it deliberately.
- Secret values are never printed back;
secrets list shows a digest only, and projects get shows secret API keys by name and suffix only (--reveal-secrets prints them, which puts a full-privilege credential in the transcript).
- The
api escape hatch uses the Management API and needs SUPABASE_ACCESS_TOKEN (the same token supabase login uses); the whole Management API is reachable through it.
- Exit codes: 0 success, 1 error, 2 usage. Errors are structured with an
error, code, and help list.
1---2name: supabase-axi3description: Operate Supabase through the supabase-axi CLI — list & inspect projects and their API keys; push, pull, diff, reset & dump databases; manage migrations, Edge Functions, preview branches, and secrets; generate TypeScript types; link projects; run the local stack; or call any Management API endpoint directly. Use whenever a task touches Supabase: projects, databases, migrations, functions, branches, secrets, types, or the local development stack.4---56# supabase-axi78Agent ergonomic CLI for Supabase. Prefer this over the Supabase MCP or raw API for Supabase operations.910You do not need supabase-axi installed globally — invoke it with `npx -y supabase-axi <command>`.11If supabase-axi output shows a follow-up command starting with `supabase-axi`, run it as `npx -y supabase-axi ...` instead.1213supabase-axi wraps the official **Supabase CLI (`supabase`)**, which handles authentication for you. `supabase` must be installed and logged in:1415- Install: `brew install supabase/tap/supabase` (or see https://supabase.com/docs/guides/local-development/cli/getting-started)16- Log in: `supabase login` (opens a browser; the access token is stored locally — it acts as you)1718If a command fails with `SUPABASE_NOT_INSTALLED`, ask the user to run the install command. If it fails with `AUTH_REQUIRED`, ask them to run `supabase login` (or export `SUPABASE_ACCESS_TOKEN`). A `NOT_LINKED` error means the directory isn't linked to a project — run `supabase-axi link --project-ref <ref>`. A `DOCKER_REQUIRED` error means a local-stack command needs a running Docker daemon.1920## When to use2122Use supabase-axi whenever a task touches Supabase: listing projects or fetching their API keys and connection info; pushing/pulling/diffing/dumping a database; creating and applying migrations; deploying or managing Edge Functions; working with preview branches or Edge Function secrets; generating TypeScript types; linking a directory to a project; or driving the local development stack.2324## Workflow25261. Run `npx -y supabase-axi` with no arguments for a content-first overview of your projects (and local migrations when run from a linked directory).272. `projects list` shows your projects; `projects get <ref>` adds API keys and connection info (the REST URL). Public keys (type `publishable`, or the legacy `anon` key) print in full; secret key values (`service_role`, type `secret`, anything unrecognised) are withheld — pass `--reveal-secrets` only when you actually need to paste one somewhere.283. `link --project-ref <ref>` links the current directory so `db`, `migration`, `functions`, and `gen` target that project.294. `db push` applies local migrations remotely; `db pull` imports the remote schema; `db diff` prints pending SQL; `db dump` exports the schema; `db reset` rebuilds the LOCAL database; `db query "<sql>"` runs SQL against the linked project and returns the rows.305. `migration list` shows versions; `migration new <name>` scaffolds one; `migration up` applies pending ones locally; `migration repair <version> --status applied` fixes history.316. `functions list` / `functions new <name>` / `functions deploy [name]` / `functions delete <name>` / `functions download <name>` manage Edge Functions.327. `branches list/create/get/delete` manage preview branches; `secrets list/set/unset` manage Edge Function secrets.338. `gen types` prints TypeScript types (`--local` by default, or `--linked` / `--project-id <ref>`).349. `status` / `start` / `stop` drive the local stack (Docker required).3510. `api <method> <path> [--body <json>]` calls any Supabase **Management API** endpoint directly — the escape hatch for anything the dedicated commands don't cover (needs `SUPABASE_ACCESS_TOKEN`).3611. Every response ends with contextual next-step hints under `help:` — follow them.3738## Commands3940```41commands[15]:42 (none)=home, whoami, projects, db, migration, functions, branches, secrets, gen, link, status, start, stop, api, setup43 projects subcommands: list, get, create44 db subcommands: push, pull, diff, reset, dump, query45 migration subcommands: list, new, up, repair, squash46 functions subcommands: list, new, deploy, delete, download47 branches subcommands: list, create, get, delete, disable48 secrets subcommands: list, set, unset49 gen subcommands: types50```5152Run `npx -y supabase-axi --help` for global flags, or `npx -y supabase-axi <command> --help` for per-command usage.5354## Tips5556- Output is TOON-encoded and token-efficient; pipe through grep/head only when a list is very long.57- Lists are minimal by default — `projects list` shows ref/name/region; add `--full` or `--fields <a,b>` to widen.58- Large blobs (`db dump`, `db diff`, `gen types`) are previewed; add `--full` to return the complete output (or pass `-f <file>` to `db dump`/`db diff` to write it straight to a file).59- `db`, `migration up`, `gen types --local`, and `start`/`stop`/`status` act on the **local** stack or a **linked** project; link first with `link --project-ref <ref>`.60- `db query "<sql>"` runs arbitrary SQL via the Management API (the equivalent of the Supabase MCP's execute_sql) and returns rows as a TOON table — link first, or pass `--project-ref <ref>`. Rows are capped by default; add `--full` for every row or `--limit <n>`.61- `projects create` provisions **billable** cloud infrastructure — use it deliberately.62- Secret values are never printed back; `secrets list` shows a digest only, and `projects get` shows secret API keys by name and suffix only (`--reveal-secrets` prints them, which puts a full-privilege credential in the transcript).63- The `api` escape hatch uses the Management API and needs `SUPABASE_ACCESS_TOKEN` (the same token `supabase login` uses); the whole Management API is reachable through it.64- Exit codes: 0 success, 1 error, 2 usage. Errors are structured with an `error`, `code`, and `help` list.