@m2015agg/supabase-skill 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/docs.js +76 -13
- package/dist/commands/docs.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/commands/docs.js
CHANGED
|
@@ -57,12 +57,41 @@ ${envSection}
|
|
|
57
57
|
- Must run from a directory with \`supabase/config.toml\` (or run \`supabase init\` first)
|
|
58
58
|
- Only one project can be linked at a time per directory
|
|
59
59
|
|
|
60
|
-
###
|
|
61
|
-
\`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
### Data Operations (REST API — no \`supabase db execute\`)
|
|
61
|
+
Load env vars first: \`source .env\` or \`export $(grep -v '^#' .env | xargs)\`
|
|
62
|
+
Header shorthand: \`-H "apikey: $KEY" -H "Authorization: Bearer $KEY"\`
|
|
63
|
+
GET uses \`Accept-Profile: bibleai\`, POST/PATCH/DELETE use \`Content-Profile: bibleai\`
|
|
64
|
+
|
|
65
|
+
**SELECT (GET)**:
|
|
66
|
+
- \`curl -s "$URL/rest/v1/<table>?select=col1,col2&limit=10" -H "apikey: $KEY" -H "Authorization: Bearer $KEY" -H "Accept-Profile: bibleai"\`
|
|
67
|
+
|
|
68
|
+
**Filters** (append to URL query string):
|
|
69
|
+
- \`?col=eq.value\` — equals | \`?col=neq.value\` — not equals
|
|
70
|
+
- \`?col=gt.5\` — greater than | \`?col=gte.5\` — greater or equal | \`?col=lt.5\` | \`?col=lte.5\`
|
|
71
|
+
- \`?col=like.*pattern*\` — LIKE | \`?col=ilike.*pattern*\` — case-insensitive LIKE
|
|
72
|
+
- \`?col=in.(val1,val2)\` — IN list | \`?col=is.null\` — IS NULL | \`?col=is.true\`
|
|
73
|
+
- \`?or=(col1.eq.a,col2.eq.b)\` — OR conditions
|
|
74
|
+
- \`?order=col.desc\` — ORDER BY | \`?limit=10&offset=20\` — pagination
|
|
75
|
+
|
|
76
|
+
**COUNT**: Add \`-H "Prefer: count=exact"\` header, read \`Content-Range\` response header
|
|
77
|
+
|
|
78
|
+
**INSERT (POST)**:
|
|
79
|
+
- \`curl -s "$URL/rest/v1/<table>" -X POST -H "apikey: $KEY" -H "Authorization: Bearer $KEY" -H "Content-Profile: bibleai" -H "Content-Type: application/json" -H "Prefer: return=representation" -d '{"col": "value"}'\`
|
|
80
|
+
|
|
81
|
+
**UPDATE (PATCH)** — ALWAYS include a filter or you update ALL rows:
|
|
82
|
+
- \`curl -s "$URL/rest/v1/<table>?id=eq.<uuid>" -X PATCH -H "apikey: $KEY" -H "Authorization: Bearer $KEY" -H "Content-Profile: bibleai" -H "Content-Type: application/json" -H "Prefer: return=representation" -d '{"col": "new_value"}'\`
|
|
83
|
+
|
|
84
|
+
**UPSERT (POST with merge)**:
|
|
85
|
+
- Add header: \`-H "Prefer: resolution=merge-duplicates,return=representation"\`
|
|
86
|
+
|
|
87
|
+
**DELETE** — ALWAYS include a filter or you delete ALL rows:
|
|
88
|
+
- \`curl -s "$URL/rest/v1/<table>?id=eq.<uuid>" -X DELETE -H "apikey: $KEY" -H "Authorization: Bearer $KEY" -H "Content-Profile: bibleai" -H "Prefer: return=representation"\`
|
|
89
|
+
|
|
90
|
+
**Call RPC function (POST)**:
|
|
91
|
+
- \`curl -s "$URL/rest/v1/rpc/<function>" -X POST -H "apikey: $KEY" -H "Authorization: Bearer $KEY" -H "Content-Profile: bibleai" -H "Content-Type: application/json" -d '{"param": "value"}'\`
|
|
92
|
+
|
|
93
|
+
**Direct SQL** (if psql available):
|
|
94
|
+
- \`psql "$DATABASE_URL" -c "SELECT 1"\`
|
|
66
95
|
|
|
67
96
|
### Migrations (uses --linked, NOT --project-ref)
|
|
68
97
|
- \`supabase migration new <name>\` — create empty migration file (local only)
|
|
@@ -74,6 +103,20 @@ ${envSection}
|
|
|
74
103
|
- \`supabase migration squash\` — combine into single file
|
|
75
104
|
- \`supabase migration fetch\` — pull migration history from remote
|
|
76
105
|
|
|
106
|
+
### DDL (Schema Changes via Migrations)
|
|
107
|
+
All schema changes go through migration files. Create with \`supabase migration new <name>\`, write SQL, apply with \`supabase migration up\`:
|
|
108
|
+
- **CREATE TABLE**: \`CREATE TABLE bibleai.<name> (id uuid PRIMARY KEY DEFAULT gen_random_uuid(), ...);\`
|
|
109
|
+
- **ALTER TABLE**: \`ALTER TABLE bibleai.<table> ADD COLUMN <col> <type>;\`
|
|
110
|
+
- **DROP TABLE**: \`DROP TABLE IF EXISTS bibleai.<table>;\`
|
|
111
|
+
- **CREATE VIEW**: \`CREATE OR REPLACE VIEW bibleai.<name> AS SELECT ...;\`
|
|
112
|
+
- **CREATE INDEX**: \`CREATE INDEX idx_<table>_<col> ON bibleai.<table>(<col>);\`
|
|
113
|
+
- **CREATE FUNCTION/RPC**: \`CREATE OR REPLACE FUNCTION bibleai.<name>(...) RETURNS ... AS $$ ... $$ LANGUAGE plpgsql;\`
|
|
114
|
+
- **RLS Policies**: \`ALTER TABLE bibleai.<table> ENABLE ROW LEVEL SECURITY; CREATE POLICY ...\`
|
|
115
|
+
- **Triggers**: \`CREATE TRIGGER ... BEFORE/AFTER INSERT/UPDATE ON bibleai.<table> ...\`
|
|
116
|
+
- **Enums**: \`CREATE TYPE bibleai.<name> AS ENUM ('val1', 'val2');\`
|
|
117
|
+
- Always use \`bibleai.\` schema prefix for all objects
|
|
118
|
+
- Run \`supabase migration list\` BEFORE and AFTER to verify
|
|
119
|
+
|
|
77
120
|
### Schema Management (uses --linked, NOT --project-ref)
|
|
78
121
|
- \`supabase db diff\` — diff local vs remote schema
|
|
79
122
|
- \`supabase db dump\` — dump full schema from linked project
|
|
@@ -98,24 +141,44 @@ ${envSection}
|
|
|
98
141
|
- \`supabase inspect report\` — CSV of ALL inspect commands
|
|
99
142
|
- Alternative: \`supabase inspect db table-stats --db-url "postgresql://..."\` — inspect without linking
|
|
100
143
|
|
|
101
|
-
### Storage (uses --linked
|
|
102
|
-
- \`supabase storage ls ss
|
|
103
|
-
- \`supabase storage cp local.file ss
|
|
104
|
-
- \`supabase storage cp ss
|
|
105
|
-
- \`supabase storage rm ss
|
|
106
|
-
- \`supabase storage mv ss
|
|
144
|
+
### Storage (uses --linked + --experimental)
|
|
145
|
+
- \`supabase storage ls ss:///bucket/path --experimental\` — list objects (note: triple slash ss:///)
|
|
146
|
+
- \`supabase storage cp local.file ss:///bucket/path --experimental\` — upload
|
|
147
|
+
- \`supabase storage cp ss:///bucket/path local.file --experimental\` — download
|
|
148
|
+
- \`supabase storage rm ss:///bucket/path --experimental\` — delete
|
|
149
|
+
- \`supabase storage mv ss:///old ss:///new --experimental\` — move/rename
|
|
107
150
|
|
|
108
151
|
### Edge Functions (uses --project-ref)
|
|
109
152
|
- \`supabase functions list --project-ref <ref>\` — list deployed functions
|
|
110
153
|
- \`supabase functions deploy <name> --project-ref <ref>\` — deploy function
|
|
111
154
|
- \`supabase functions delete <name> --project-ref <ref>\` — delete function
|
|
112
|
-
- \`supabase functions
|
|
155
|
+
- \`supabase functions new <name>\` — create new function locally
|
|
156
|
+
- \`supabase functions download [name]\` — download function source from linked project
|
|
157
|
+
- \`supabase functions serve\` — serve all functions locally for testing
|
|
158
|
+
|
|
159
|
+
### Branches (uses --project-ref)
|
|
160
|
+
- \`supabase branches list --project-ref <ref> -o json\` — list all preview branches
|
|
161
|
+
- \`supabase branches create <name> --project-ref <ref>\` — create preview branch
|
|
162
|
+
- \`supabase branches get <branch-id> --project-ref <ref>\` — get branch details
|
|
163
|
+
- \`supabase branches delete <branch-id> --project-ref <ref>\` — delete branch
|
|
164
|
+
- \`supabase branches pause <branch-id> --project-ref <ref>\` — pause branch (save costs)
|
|
165
|
+
- \`supabase branches unpause <branch-id> --project-ref <ref>\` — resume branch
|
|
166
|
+
|
|
167
|
+
### Backups (uses --project-ref)
|
|
168
|
+
- \`supabase backups list --project-ref <ref>\` — list available physical backups
|
|
169
|
+
- \`supabase backups restore --project-ref <ref>\` — restore to specific timestamp (PITR)
|
|
113
170
|
|
|
114
171
|
### Project Management (uses --project-ref)
|
|
115
172
|
- \`supabase projects list -o json\` — list all projects
|
|
116
173
|
- \`supabase projects api-keys --project-ref <ref> -o json\` — get API keys
|
|
117
174
|
- \`supabase secrets list --project-ref <ref>\` — list env secrets
|
|
118
175
|
- \`supabase secrets set KEY=VALUE --project-ref <ref>\` — set secret
|
|
176
|
+
- \`supabase postgres-config get --project-ref <ref>\` — get Postgres config overrides
|
|
177
|
+
- \`supabase postgres-config update --project-ref <ref>\` — update Postgres config
|
|
178
|
+
|
|
179
|
+
### Code Generation
|
|
180
|
+
- \`supabase gen types --linked\` — generate TypeScript types from linked project schema
|
|
181
|
+
- \`supabase gen types --project-id <ref>\` — generate types from specific project
|
|
119
182
|
|
|
120
183
|
### SQL Snippets (uses --project-ref)
|
|
121
184
|
- \`supabase snippets list --project-ref <ref> -o json\` — list saved snippets
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../src/commands/docs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAoB,MAAM,mBAAmB,CAAC;AAEjE,SAAS,eAAe,CAAC,MAA0B;IACjD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7D,OAAO;;wDAE6C,CAAC;IACvD,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,kBAAkB,CAAC,CAAC;IACnC,KAAK,MAAM,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;QACvE,MAAM,OAAO,GAAG,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,wDAAwD,CAAC,CAAC,CAAC,EAAE,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,CAAC;QAClB,CAAC;QACD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const program = new Command();
|
|
|
15
15
|
program
|
|
16
16
|
.name("supabase-skill")
|
|
17
17
|
.description("Supabase CLI skill for AI agents. Installs comprehensive CLI instructions into CLAUDE.md with multi-environment support.")
|
|
18
|
-
.version("0.
|
|
18
|
+
.version("0.4.0");
|
|
19
19
|
program.addCommand(installCommand());
|
|
20
20
|
program.addCommand(initCommand());
|
|
21
21
|
program.addCommand(docsCommand());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m2015agg/supabase-skill",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Supabase CLI skill for AI agents. Installs comprehensive CLI instructions into CLAUDE.md, AGENTS.md, or .cursorrules with multi-environment support.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|