@m2015agg/supabase-skill 0.2.4 → 0.3.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.
@@ -46,66 +46,78 @@ All commands support \`-o json\` for structured output.
46
46
 
47
47
  ${envSection}
48
48
 
49
- ### SQL Execution (daily use)
50
- NOTE: \`supabase db execute\` does NOT exist. Use these methods instead:
49
+ ### IMPORTANT: CLI Flag Reference
50
+ - Database commands (db, migration, inspect, storage) use \`--linked\` (requires \`supabase link\` first)
51
+ - Management commands (functions, projects, secrets, snippets) use \`--project-ref <ref>\`
52
+ - \`supabase db execute\` does NOT exist — use REST API or psql instead
53
+ - To switch linked project: \`supabase link --project-ref <ref>\`
54
+
55
+ ### Project Linking (required before db/migration/inspect/storage commands)
56
+ - \`supabase link --project-ref <ref>\` — link current directory to a Supabase project
57
+ - Must run from a directory with \`supabase/config.toml\` (or run \`supabase init\` first)
58
+ - Only one project can be linked at a time per directory
59
+
60
+ ### SQL Execution
61
+ \`supabase db execute\` does NOT exist. Use these methods:
51
62
  - \`curl -s "$SUPABASE_<ENV>_URL/rest/v1/rpc/<function>" -H "apikey: $SUPABASE_<ENV>_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_<ENV>_SERVICE_KEY" -H "Accept-Profile: bibleai"\` — call RPC function
52
63
  - \`curl -s "$SUPABASE_<ENV>_URL/rest/v1/<table>?select=*&limit=10" -H "apikey: $SUPABASE_<ENV>_SERVICE_KEY" -H "Authorization: Bearer $SUPABASE_<ENV>_SERVICE_KEY" -H "Accept-Profile: bibleai"\` — query table via REST
53
64
  - \`psql "$DATABASE_URL" -c "SELECT 1"\` — direct SQL via psql (if connection string available)
54
65
  - Load env vars first: \`source .env\` or \`export $(grep -v '^#' .env | xargs)\`
55
66
 
56
- ### Migrations
57
- - \`supabase migration new <name>\` — create empty migration file
58
- - \`supabase migration list --project-ref <ref>\` — compare local vs remote
59
- - \`supabase migration up --project-ref <ref>\` — apply pending to remote
60
- - \`supabase migration down --project-ref <ref> -n 1\` — rollback last N migrations
61
- - \`supabase migration repair --status applied <version> --project-ref <ref>\` — mark version as applied
62
- - \`supabase migration repair --status reverted <version> --project-ref <ref>\` — mark version as reverted
63
- - \`supabase migration squash --project-ref <ref>\` — combine into single file
64
- - \`supabase migration fetch --project-ref <ref>\` — pull history from remote
65
-
66
- ### Schema Management
67
- - \`supabase db diff --project-ref <ref>\` — diff local vs remote schema
68
- - \`supabase db dump --project-ref <ref>\` — dump full schema
69
- - \`supabase db dump --project-ref <ref> --data-only\` — dump data only
70
- - \`supabase db dump --project-ref <ref> --schema <name>\` — dump specific schema
71
- - \`supabase db pull --project-ref <ref>\` — pull remote schema to local migrations
72
- - \`supabase db push --project-ref <ref>\` — push migrations to remote
73
- - \`supabase db lint\` — check for typing errors
74
-
75
- ### Database Inspection (debugging/support)
76
- - \`supabase inspect db table-stats --project-ref <ref>\` — table sizes + row counts
77
- - \`supabase inspect db index-stats --project-ref <ref>\` — index usage + scan counts
78
- - \`supabase inspect db long-running-queries --project-ref <ref>\` — queries > 5min
79
- - \`supabase inspect db outliers --project-ref <ref>\` — slowest queries by total time
80
- - \`supabase inspect db bloat --project-ref <ref>\` — dead tuple estimation
81
- - \`supabase inspect db locks --project-ref <ref>\` — active locks
82
- - \`supabase inspect db blocking --project-ref <ref>\` — blocking lock chains
83
- - \`supabase inspect db db-stats --project-ref <ref>\` — cache hit rates, WAL, sizes
84
- - \`supabase inspect db vacuum-stats --project-ref <ref>\` — vacuum status per table
85
- - \`supabase inspect db role-stats --project-ref <ref>\` — role information
86
- - \`supabase inspect db replication-slots --project-ref <ref>\` — replication status
87
- - \`supabase inspect report --project-ref <ref>\` — CSV of ALL inspect commands
88
-
89
- ### Storage
90
- - \`supabase storage ls ss://bucket/path --project-ref <ref>\` — list objects
91
- - \`supabase storage cp local.file ss://bucket/path --project-ref <ref>\` — upload
92
- - \`supabase storage cp ss://bucket/path local.file --project-ref <ref>\` download
93
- - \`supabase storage rm ss://bucket/path --project-ref <ref>\` delete
94
- - \`supabase storage mv ss://old ss://new --project-ref <ref>\` move/rename
95
-
96
- ### Edge Functions
67
+ ### Migrations (uses --linked, NOT --project-ref)
68
+ - \`supabase migration new <name>\` — create empty migration file (local only)
69
+ - \`supabase migration list\` — compare local vs remote (linked project)
70
+ - \`supabase migration up\` — apply pending migrations to linked project
71
+ - \`supabase migration down -n 1\` — rollback last N migrations
72
+ - \`supabase migration repair --status applied <version>\` — mark version as applied
73
+ - \`supabase migration repair --status reverted <version>\` — mark version as reverted
74
+ - \`supabase migration squash\` — combine into single file
75
+ - \`supabase migration fetch\` — pull migration history from remote
76
+
77
+ ### Schema Management (uses --linked, NOT --project-ref)
78
+ - \`supabase db diff\` — diff local vs remote schema
79
+ - \`supabase db dump\` — dump full schema from linked project
80
+ - \`supabase db dump --data-only\` — dump data only
81
+ - \`supabase db dump -s bibleai\` — dump specific schema
82
+ - \`supabase db pull\` — pull remote schema to local migrations
83
+ - \`supabase db push\` — push migrations to remote
84
+ - \`supabase db lint\` — check for typing errors (local only)
85
+
86
+ ### Database Inspection (uses --linked or --db-url, NOT --project-ref)
87
+ - \`supabase inspect db table-stats\` — table sizes + row counts
88
+ - \`supabase inspect db index-stats\` — index usage + scan counts
89
+ - \`supabase inspect db long-running-queries\` — queries > 5min
90
+ - \`supabase inspect db outliers\` — slowest queries by total time
91
+ - \`supabase inspect db bloat\` — dead tuple estimation
92
+ - \`supabase inspect db locks\` — active locks
93
+ - \`supabase inspect db blocking\` — blocking lock chains
94
+ - \`supabase inspect db db-stats\` — cache hit rates, WAL, sizes
95
+ - \`supabase inspect db vacuum-stats\` — vacuum status per table
96
+ - \`supabase inspect db role-stats\` — role information
97
+ - \`supabase inspect db replication-slots\` — replication status
98
+ - \`supabase inspect report\` — CSV of ALL inspect commands
99
+ - Alternative: \`supabase inspect db table-stats --db-url "postgresql://..."\` — inspect without linking
100
+
101
+ ### Storage (uses --linked, NOT --project-ref)
102
+ - \`supabase storage ls ss://bucket/path\` list objects
103
+ - \`supabase storage cp local.file ss://bucket/path\`upload
104
+ - \`supabase storage cp ss://bucket/path local.file\`download
105
+ - \`supabase storage rm ss://bucket/path\`delete
106
+ - \`supabase storage mv ss://old ss://new\` — move/rename
107
+
108
+ ### Edge Functions (uses --project-ref)
97
109
  - \`supabase functions list --project-ref <ref>\` — list deployed functions
98
110
  - \`supabase functions deploy <name> --project-ref <ref>\` — deploy function
99
111
  - \`supabase functions delete <name> --project-ref <ref>\` — delete function
100
112
  - \`supabase functions serve\` — serve locally for testing
101
113
 
102
- ### Project Management
114
+ ### Project Management (uses --project-ref)
103
115
  - \`supabase projects list -o json\` — list all projects
104
116
  - \`supabase projects api-keys --project-ref <ref> -o json\` — get API keys
105
117
  - \`supabase secrets list --project-ref <ref>\` — list env secrets
106
118
  - \`supabase secrets set KEY=VALUE --project-ref <ref>\` — set secret
107
119
 
108
- ### SQL Snippets (from dashboard)
120
+ ### SQL Snippets (uses --project-ref)
109
121
  - \`supabase snippets list --project-ref <ref> -o json\` — list saved snippets
110
122
  - \`supabase snippets download <id> --project-ref <ref>\` — download snippet SQL
111
123
 
@@ -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,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CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,mBAAmB,IAAI,CAAC,MAAM,UAAU,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAC5E,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,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.2.4");
18
+ .version("0.3.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.2.4",
3
+ "version": "0.3.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",