@supacloud/cli 0.65.1 → 0.66.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.65.1",
3
+ "version": "0.66.0",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,14 +35,14 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@sinclair/typebox": "^0.34.52",
38
- "@supacloud/compiler": "^0.34.0",
39
- "@supacloud/delivery": "0.7.0",
38
+ "@supacloud/compiler": "^0.36.0",
39
+ "@supacloud/delivery": "0.8.0",
40
40
  "@supacloud/db": "^0.2.0",
41
41
  "fflate": "^0.8.3",
42
42
  "typebox": "1.3.34"
43
43
  },
44
44
  "overrides": {
45
- "@supacloud/delivery": "0.7.0"
45
+ "@supacloud/delivery": "0.8.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@supacloud/elysia": "^0.23.1",
@@ -71,6 +71,14 @@ Use `db_diff` as an authoring aid, not as permission to bypass review:
71
71
  supacloud-cli supabase db_diff --schema public --name reconcile_public_schema
72
72
  ```
73
73
 
74
+ For existing declarative SQL projects, `supabase db_schema_declarative_sync`
75
+ generates without applying by default. Preserve the repository's schema authority
76
+ and review the migration before any apply. `config_pull` previews official
77
+ Supabase configuration, not SupaCloud Management settings. Native local stacks
78
+ remain alpha and require `SUPACLOUD_ENABLE_NATIVE_STACK=1`; do not silently switch
79
+ an existing Docker workflow. Lite drift pull writes drafts by default; only use
80
+ `--baseline` for reviewed DDL already present in the live local state.
81
+
74
82
  For a database that was previously changed directly, stop further direct writes and follow the reconciliation workflow in [references/database-workflow.md](references/database-workflow.md). Do not push guessed historical migrations against a live database. After schema equivalence is proven, preview and record the baseline through:
75
83
 
76
84
  ```bash
@@ -13,6 +13,12 @@ Load this reference when selecting a command surface or when a user asks an AI t
13
13
  | Read database rows or metadata | `database query` and database inspection actions | `SELECT`/read-only by default |
14
14
  | Create schema/function/RPC/trigger/RLS/index/grant/extension | `supabase migration_new`, then edit SQL | Never direct remote DDL |
15
15
  | Generate migration from local schema changes | `supabase db_diff` | Review generated SQL before use |
16
+ | Generate migration from declarative SQL | `supabase db_schema_declarative_sync` | Defaults to no-apply; preserve an existing Drizzle/schema authority |
17
+ | Capture declarative schema files | `supabase db_schema_declarative_generate` | Explicit DSN or upstream linked project; overwrite requires approval |
18
+ | Pull official Supabase configuration | `supabase config_pull` | Preview by default; local write requires `dry_run=false` and `yes`; not SupaCloud settings |
19
+ | Run the official local stack | `supabase stack_start`, `stack_prepare`, `stack_status`, `stack_stop` | Docker default; native alpha requires `SUPACLOUD_ENABLE_NATIVE_STACK=1` |
20
+ | Remove the official local stack | `supabase stack_destroy` | Local data loss; requires `confirm_destroy` and `yes` |
21
+ | Capture Lite drift | `lite db_diff`, `lite db_pull` | Draft outside migrations; only reviewed already-present DDL may use `baseline` |
16
22
  | Rebuild local database | `supabase db_reset` | Local only; preserve required seed behavior |
17
23
  | Inspect or back up a remote database | `supabase db_pull`, `migration_list`, `db_dump`, `gen_types` | Requires explicit PostgreSQL DSN; redact it |
18
24
  | Replay the release-canary fixture stage receipt | `release release_canary_fixture_stage_replay` | Dual-bind Management project context and that project's service-role application origin; accepts only the exact subject/request UUID pair and a strict idempotent receipt |
@@ -36,7 +42,8 @@ until a project-scoped context is resolved.
36
42
  - `status`: resolved context, Management API connectivity, authentication, and project reachability.
37
43
  - `project`: selected-project metadata, authoritative endpoint projection, health, logs, API keys/settings, background tasks, retry/cancel, DLQ, and background settings. `project list` deliberately redirects to `supacloud-admin`; cross-project enumeration is not a project CLI capability.
38
44
  - `database`: read/query, schema inspection, extensions, indexes, RLS, stats, migration push, controlled historical baseline, and SQL-file execution.
39
- - `supabase`: allowlisted official CLI adapter for migration authoring, local reset/diff, explicit-DSN inspection/backup/type generation, and SupaCloud-controlled migration push.
45
+ - `supabase`: allowlisted official CLI adapter for initialization, declarative authoring, config pull, local stacks, reset/diff, explicit-DSN inspection/backup/type generation, and SupaCloud-controlled migration push.
46
+ - `lite`: local-only Lite runtime, schema authoring and snapshot operations; never reinterpret PGlite state as a Postgres DSN.
40
47
  - `auth`: provider/configuration plus bounded user lookup and production-confirmed `magiclink`, `recovery`, or `invite` generation. Search/email/redirect inputs and returned action URLs are bounded and validated before use.
41
48
  - `storage`: buckets and object-management workflows.
42
49
  - `edge_functions`: list, atomically read one active or deleted identity with `get_config`, read immutable source, deploy, activate, configure, and delete Edge Functions. For every mutation, pass the `activation_id` read from the same `list` or `get_config` snapshot as `--expected-activation-id`; use `legacy` only for a never-created or listed legacy Function, not for a deleted slug with a tombstone UUID. Deploy and activate actions also require the non-negative observed version as `--expected-active-version`; use `absent` for a never-created slug or a `get_config` tombstone. Version `0` is a legacy version token and cannot be used as a source or activation target.
@@ -32,6 +32,26 @@ Migration files are the durable source of truth. `supabase_migrations.schema_mig
32
32
 
33
33
  7. After explicit environment approval, apply and read back migration history.
34
34
 
35
+ ## Declarative authoring option
36
+
37
+ Preserve the repository's existing schema authority. In a project already using
38
+ declarative SQL, edit those files and run:
39
+
40
+ ```bash
41
+ supacloud-cli supabase db_schema_declarative_sync --name <intent> --strict_coverage
42
+ ```
43
+
44
+ The adapter defaults to no-apply. Review the generated migration, then use the
45
+ same local verification and controlled remote push steps above. Do not introduce
46
+ a second declarative source over Drizzle-generated schemas. Verify the installed
47
+ official CLI supports this experimental command before changing project config.
48
+
49
+ `supabase config_pull` previews official Supabase settings. Applying that local
50
+ file requires `--dry_run=false --yes`; a configured context must match the
51
+ requested project ref. Keep secrets and environment-specific changes out of
52
+ commits. The adapter filters inherited credentials but does not sandbox upstream
53
+ saved logins or dotenv files.
54
+
35
55
  ## Previously changed remote database
36
56
 
37
57
  Do not fabricate old migration files and immediately push them. Reconcile deliberately:
@@ -76,6 +96,15 @@ Do not fabricate old migration files and immediately push them. Reconcile delibe
76
96
  10. Never insert/update/delete `supabase_migrations.schema_migrations` via `database query`. If the controlled baseline action cannot represent the verified state, stop and request operator assistance.
77
97
  11. Run `supabase push --dry_run`; it should report no unintended pending historical migration. Read back migration history and affected objects.
78
98
 
99
+ ## Lite drift
100
+
101
+ For Lite, `lite db_pull` writes drafts outside migrations and does not silently
102
+ change the ledger. The explicit `--baseline` action records already-present
103
+ reviewed DDL without replaying it. Stop on pending history, unsupported catalog
104
+ drift or shadow replay mismatch. Retain `.sql.pending` files after an uncertain
105
+ baseline and verify the ledger before publishing or retrying; never guess commit
106
+ state or restart into captured DDL that has not been baselined.
107
+
79
108
  ## Functions, triggers, RLS, and grants
80
109
 
81
110
  These are schema objects even when business logic lives inside them. Keep them in migrations: