@supacloud/cli 0.10.0 → 0.11.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/README.md +103 -3
- package/dist/index.js +6609 -14195
- package/package.json +4 -3
- package/skills/supacloud-cli/SKILL.md +83 -0
- package/skills/supacloud-cli/agents/openai.yaml +4 -0
- package/skills/supacloud-cli/references/command-map.md +50 -0
- package/skills/supacloud-cli/references/database-workflow.md +112 -0
package/README.md
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Project-scoped CLI for SupaCloud users.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
server binary installed at `/usr/local/bin/supacloud`.
|
|
5
|
+
This package exposes only `supacloud-cli`. The bare `supacloud` name is reserved
|
|
6
|
+
for the compiled server binary installed at `/usr/local/bin/supacloud`.
|
|
8
7
|
|
|
9
8
|
Install:
|
|
10
9
|
|
|
@@ -19,10 +18,34 @@ One-off execution:
|
|
|
19
18
|
npm exec --package @supacloud/cli -- supacloud-cli status
|
|
20
19
|
```
|
|
21
20
|
|
|
21
|
+
Install the packaged AI Skill:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
supacloud-cli ai show_skill
|
|
25
|
+
supacloud-cli ai install_skill --dry_run
|
|
26
|
+
supacloud-cli ai install_skill
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The default destination is `$CODEX_HOME/skills/supacloud-cli` or
|
|
30
|
+
`~/.codex/skills/supacloud-cli`. Use `--target /path/to/skills` for an explicit
|
|
31
|
+
Skill root. Different existing content is preserved unless `--force` is passed;
|
|
32
|
+
forced replacement creates a timestamped adjacent backup first.
|
|
33
|
+
|
|
34
|
+
The Skill directs agents to keep schema, functions/RPC, triggers, RLS, indexes,
|
|
35
|
+
grants, extensions, and reference-data changes in migrations; use read-only SQL
|
|
36
|
+
for ordinary inspection; dry-run remote migrations; and reconcile existing
|
|
37
|
+
remote drift before touching migration history.
|
|
38
|
+
|
|
22
39
|
`supacloud-cli` defaults to the current workspace's project context. If you do not pass explicit flags, it tries to auto-link from `.env`:
|
|
23
40
|
|
|
24
41
|
- `SUPABASE_URL` or `SUPACLOUD_API_URL`
|
|
25
42
|
- `SUPABASE_SERVICE_ROLE_KEY` or `SUPACLOUD_API_TOKEN`
|
|
43
|
+
- `SUPACLOUD_PROJECT_REF` when the project ref cannot be inferred from a managed `<ref>.api.*` hostname
|
|
44
|
+
|
|
45
|
+
Both `--key value` and `--key=value` flag syntax are accepted. `--ref` can
|
|
46
|
+
override the auto-linked project for an individual command. `status` checks
|
|
47
|
+
configuration, Management API connectivity, and authentication; it exits
|
|
48
|
+
non-zero when any required check fails.
|
|
26
49
|
|
|
27
50
|
Examples:
|
|
28
51
|
|
|
@@ -38,9 +61,77 @@ supacloud-cli task_events inspect_webhook --ref abc123
|
|
|
38
61
|
supacloud-cli database query --sql "select now()"
|
|
39
62
|
supacloud-cli database query --ref abc123 --file ./queries/vector-search.sql
|
|
40
63
|
supacloud-cli database push_migrations --ref abc123 --dir supabase/migrations --dry_run
|
|
64
|
+
supacloud-cli supabase migration_new --name add_accounts
|
|
65
|
+
supacloud-cli supabase db_diff --schema public --name add_accounts
|
|
66
|
+
supacloud-cli supabase push --ref abc123 --dir supabase/migrations --dry_run
|
|
41
67
|
supacloud-cli frontend list --ref abc123
|
|
42
68
|
```
|
|
43
69
|
|
|
70
|
+
## Official Supabase CLI adapter
|
|
71
|
+
|
|
72
|
+
The `supabase` command group is a thin, allowlisted adapter around the official
|
|
73
|
+
open-source Supabase CLI. It is not a fork. Local authoring commands work without
|
|
74
|
+
SupaCloud credentials:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
supacloud-cli supabase version
|
|
78
|
+
supacloud-cli supabase migration_new --name add_accounts
|
|
79
|
+
supacloud-cli supabase db_diff --schema public --name add_accounts
|
|
80
|
+
supacloud-cli supabase db_reset --no_seed
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Remote inspection and backup commands require an explicit, percent-encoded
|
|
84
|
+
Postgres DSN:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
supacloud-cli supabase db_pull --db_url "$SUPACLOUD_DB_URL" --declarative
|
|
88
|
+
supacloud-cli supabase migration_list --db_url "$SUPACLOUD_DB_URL"
|
|
89
|
+
supacloud-cli supabase db_dump --db_url "$SUPACLOUD_DB_URL" --file backups/schema.sql
|
|
90
|
+
supacloud-cli supabase gen_types --db_url "$SUPACLOUD_DB_URL" --schema public --file src/database.types.ts
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Remote migration application intentionally stays on SupaCloud's existing
|
|
94
|
+
project-authenticated API:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
supacloud-cli supabase push --ref abc123 --dir supabase/migrations --dry_run
|
|
98
|
+
supacloud-cli supabase push --ref abc123 --dir supabase/migrations
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`push` uses `SUPABASE_SERVICE_ROLE_KEY` or `SUPACLOUD_API_TOKEN` only for the
|
|
102
|
+
SupaCloud Management API. Those credentials, upstream access tokens, database
|
|
103
|
+
passwords, and secret/key environment variables are removed from the official
|
|
104
|
+
CLI child process, and command output is redacted.
|
|
105
|
+
|
|
106
|
+
`push` requires a resolved project ref; pass `--ref` explicitly or set
|
|
107
|
+
`SUPACLOUD_PROJECT_REF`. Relative migration directories are resolved against
|
|
108
|
+
`--workdir` (or the current directory).
|
|
109
|
+
|
|
110
|
+
Executable resolution order:
|
|
111
|
+
|
|
112
|
+
1. `SUPACLOUD_SUPABASE_CLI_BIN`
|
|
113
|
+
2. exact `SUPABASE_CLI_VERSION` through an explicit Bun/npm package runner
|
|
114
|
+
3. `<workdir>/node_modules/supabase`
|
|
115
|
+
4. `supabase` on `PATH`
|
|
116
|
+
|
|
117
|
+
Windows under Node.js requires an installed official CLI or
|
|
118
|
+
`SUPACLOUD_SUPABASE_CLI_BIN`; the adapter does not execute `.cmd` through a shell.
|
|
119
|
+
|
|
120
|
+
Direct SQL/console changes do not automatically create migrations or migration
|
|
121
|
+
history. Keep migration files in version control and run `supabase push --dry_run`
|
|
122
|
+
before applying them.
|
|
123
|
+
|
|
124
|
+
If the live database already contains reviewed historical changes, first pull,
|
|
125
|
+
back up, and prove schema equivalence. Then preview the controlled tracking sync:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
supacloud-cli database baseline_migrations --ref abc123 --dir supabase/migrations --dry_run
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Only after explicit approval, rerun without `--dry_run`. This records migration
|
|
132
|
+
files as applied without executing their DDL; never edit migration-history tables
|
|
133
|
+
through `database query`.
|
|
134
|
+
|
|
44
135
|
Use `database query --file` for complex SQL, pgvector queries, and single-request transaction blocks.
|
|
45
136
|
|
|
46
137
|
```sql
|
|
@@ -77,6 +168,7 @@ Project commands owned by this CLI:
|
|
|
77
168
|
|
|
78
169
|
Queue commands:
|
|
79
170
|
|
|
171
|
+
- `queue list`
|
|
80
172
|
- `queue send`
|
|
81
173
|
- `queue receive`
|
|
82
174
|
- `queue ack`
|
|
@@ -85,6 +177,7 @@ Queue commands:
|
|
|
85
177
|
- `queue retry`
|
|
86
178
|
- `queue delete_message`
|
|
87
179
|
- `queue list_messages`
|
|
180
|
+
- `queue get_message`
|
|
88
181
|
- `queue stats`
|
|
89
182
|
- `queue dlq`
|
|
90
183
|
- `queue get_settings`
|
|
@@ -96,6 +189,13 @@ Task event commands:
|
|
|
96
189
|
- `task_events unregister_webhook`
|
|
97
190
|
- `task_events inspect_webhook`
|
|
98
191
|
|
|
192
|
+
Diagnostic commands:
|
|
193
|
+
|
|
194
|
+
- `diagnostics list_checks`
|
|
195
|
+
- `diagnostics run_checks`
|
|
196
|
+
- `diagnostics get_run`
|
|
197
|
+
- `diagnostics repair`
|
|
198
|
+
|
|
99
199
|
Gateway / Caddy commands (require admin privileges; config is injected via the Caddy JSON Admin API):
|
|
100
200
|
|
|
101
201
|
- `gateway routes` — list custom gateway routes (reverse_proxy / static sites / redirects)
|