π¦ ClawHub
Supabase Manager
by @vanthienha199
Manage Supabase projects from the command line. Query tables, insert/update/delete rows, manage RLS policies, handle auth users, and work with storage. Use w...
TERMINAL
clawhub install supabase-managerπ About This Skill
name: supabase description: > Manage Supabase projects from the command line. Query tables, insert/update/delete rows, manage RLS policies, handle auth users, and work with storage. Use when the user asks about Supabase, database queries, tables, rows, or their Supabase project. Triggers on: "query supabase", "show me the table", "insert into", "delete from", "supabase users", "database", "RLS", "storage bucket". tags: - supabase - database - postgres - sql - backend - auth - storage - rls env: - name: SUPABASE_URL description: "Supabase project URL (e.g., https://xxxxx.supabase.co)" required: true - name: SUPABASE_ANON_KEY description: "Supabase anon (public) key β safe for client-side use, protected by RLS" required: true
Supabase
You manage Supabase projects using the REST API and SQL. Fast, direct, no ORM overhead.
Connection Setup
On first use, ask the user for:
1. Supabase URL β https://[project-ref].supabase.co
2. Anon key (public) β for RLS-protected queries
This skill uses ONLY the anon (public) key by default. The anon key is designed to be safe for client-side use β it is protected by Row Level Security (RLS) policies you configure in Supabase.
Credential Handling
SUPABASE_URL and SUPABASE_ANON_KEYAPI Calls
Use curl for all Supabase REST API operations:
Query (SELECT)
curl -s "[URL]/rest/v1/[table]?select=*&[filters]" \
-H "apikey: [KEY]" \
-H "Authorization: Bearer [KEY]"
Insert
curl -s -X POST "[URL]/rest/v1/[table]" \
-H "apikey: [KEY]" \
-H "Authorization: Bearer [KEY]" \
-H "Content-Type: application/json" \
-d '[JSON]'
Update
curl -s -X PATCH "[URL]/rest/v1/[table]?[filter]" \
-H "apikey: [KEY]" \
-H "Authorization: Bearer [KEY]" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '[JSON]'
Delete
curl -s -X DELETE "[URL]/rest/v1/[table]?[filter]" \
-H "apikey: [KEY]" \
-H "Authorization: Bearer [KEY]"
PostgREST Filter Syntax
?column=eq.value β equals?column=neq.value β not equals?column=gt.value β greater than?column=lt.value β less than?column=gte.value β greater than or equal?column=like.*pattern* β LIKE?column=ilike.*pattern* β case-insensitive LIKE?column=in.(val1,val2) β IN?column=is.null β IS NULL?order=column.desc β ORDER BY?limit=10 β LIMIT?offset=20 β OFFSET?select=col1,col2,related_table(col3) β select specific columns + joinsCommands
"Show tables" / "List tables"
curl -s "[URL]/rest/v1/" -H "apikey: [KEY]" | jq 'keys'
"Query [table]" / "Show me [table]"
curl -s "[URL]/rest/v1/[table]?select=*&limit=20" \
-H "apikey: [KEY]" -H "Authorization: Bearer [KEY]" | jq .
Present as a formatted markdown table."Count [table]"
curl -s "[URL]/rest/v1/[table]?select=count" \
-H "apikey: [KEY]" -H "Authorization: Bearer [KEY]" \
-H "Prefer: count=exact"
"Insert into [table]: [data]"
Parse the user's data, construct JSON, POST it."Delete from [table] where [condition]"
Construct the filter, confirm with user before executing: "This will delete rows from [table] where [condition]. Proceed? (y/n)""Run SQL: [query]"
For complex queries, use Supabase RPC (remote procedure call) with the anon key:curl -s -X POST "[URL]/rest/v1/rpc/[function_name]" \
-H "apikey: [ANON_KEY]" \
-H "Authorization: Bearer [ANON_KEY]" \
-H "Content-Type: application/json" \
-d '{"param": "value"}'
Note: RPC functions must be created in Supabase first and must have appropriate RLS policies.