Writer’s Brief

The Hook

You can skip the Supabase dashboard entirely and run SQL straight from your terminal (or from Claude Code) using one curl command.

Main Points to Cover

  1. The Supabase Management API accepts raw SQL, not just REST/CRUD
  2. Your access token is already sitting in your macOS Keychain if you’ve ever used the Supabase CLI
  3. This unlocks “give someone access” as a one-line command instead of a multi-step dashboard workflow

The Angle

Discovery through friction. Tried psql, it failed (IPv6 only). Tried the CLI, wrong version. Dug into the Keychain, found the token, hit the Management API. Now it’s a one-liner forever.

Target Reader

Anyone using Supabase who’s tired of context-switching to the dashboard for quick operations. Especially people using Claude Code or other AI tools that can run bash.

Tone Notes

Practical, slightly triumphant. The “I figured this out so you don’t have to” energy.

Raw Material / Moments to Write From

These are notes for Alex to write from. Not prose.

  • Started by trying psql with the connection string from the dashboard. DNS wouldn’t resolve because the DB host is IPv6-only and the Mac had no IPv6 route. Dead end.
  • Tried supabase db execute but that command doesn’t exist in the installed CLI version.
  • The breakthrough: the Supabase CLI stores its access token in the macOS Keychain, base64-encoded, under “Supabase CLI”. One security command to extract it.
  • The Management API at api.supabase.com (not the project URL) accepts raw SQL via POST. This is different from PostgREST.
  • The whole thing started because Alex wanted to pre-approve a user for access. Instead of “here’s the SQL, go paste it in the dashboard,” now it’s just… done.
  • Updated the c4c-access skill so future sessions just do this automatically. The system learns.