---
name: "Supabase"
description: Work with Supabase projects, Postgres schema, migrations, storage, and edge functions through the official `supabase` CLI.
version: 1
situations: supabase, postgres, database, migrations, edge functions
requires-secrets:
requires-packages:
requires-connector: supabase
---

# Supabase (`supabase`)

Runs through Supabase's official CLI in your **bash** tool. The operator connected the account from
00's skill store.

## First, know which project

```
supabase projects list
```

That is also the "am I connected?" check — an auth error means **Skill store → Supabase → Connect**.
Every destructive command below needs `--project-ref`; there is no "current project" you can assume.

## Read

```
supabase projects list
supabase branches list --project-ref REF
supabase functions list --project-ref REF
supabase migration list --linked
supabase db diff --linked --schema public       # what differs from the migrations
supabase inspect db table-stats --linked
```

## Local development

The safest place to try schema changes is the local stack, not the hosted project:

```
supabase start                     # local Postgres + Studio, via Docker
supabase db reset                  # rebuilds LOCAL db from migrations — destroys local data only
supabase migration new add_widgets
supabase db diff -f add_widgets    # writes the migration from what you changed
supabase stop
```

## Write against the hosted project

```
supabase db push --linked          # applies pending migrations to the REMOTE database
supabase functions deploy NAME --project-ref REF
```

`db push` runs migrations against real data. Say which project ref and which migrations are pending,
and wait for a yes.

## Never without being asked in this turn

`supabase db reset --linked` (wipes the hosted database), `supabase projects delete`, deleting
branches, or running ad-hoc `DROP`/`DELETE` SQL against the linked project.

## Notes

- The database password is not in the CLI's session. If a command asks for it, ask the operator —
  don't hunt for it in the repo.
- Local commands need Docker running; say so plainly if `supabase start` can't reach it.
