@supacloud/cli 0.86.0 → 0.87.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 CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  Project-scoped CLI for SupaCloud users.
4
4
 
5
- The only command-line executable is `supacloud-cli`. The bare `supacloud` name is reserved
6
- for the compiled server binary installed at `/usr/local/bin/supacloud`.
5
+ The only command-line executable is `supacloud`. The compiled server binary
6
+ installed at `/usr/local/bin/supacloud` is a separate managed-host installation.
7
7
 
8
8
  Tool adapters import `@supacloud/cli/tool-runtime` for typed registration and
9
9
  schema decoding. This side-effect-free entrypoint does not initialize the CLI.
@@ -14,7 +14,7 @@ are not supported.
14
14
  ## Application Starter
15
15
 
16
16
  ```sh
17
- supacloud-cli app init --root ./orders --name orders
17
+ supacloud app init --root ./orders --name orders
18
18
  cd orders
19
19
  bun install
20
20
  bun run check
@@ -48,16 +48,16 @@ behavior.
48
48
  ### Application delivery
49
49
 
50
50
  ```sh
51
- supacloud-cli app plan --root . --format json
52
- supacloud-cli app build --root .
53
- supacloud-cli app upload --ref PROJECT --id orders --manifest_path generated/delivery/delivery.manifest.json
54
- supacloud-cli app configure --ref PROJECT --id orders --environment_id test --configuration_path configuration.json
55
- supacloud-cli app deploy --ref PROJECT --id orders --environment_id test --release_id RELEASE_SHA256 --configuration_id CONFIG_UUID --activation_id NEW_UUID --expected_activation_id absent
56
- supacloud-cli app status --ref PROJECT --id orders --environment_id test
57
- supacloud-cli app logs --ref PROJECT --id orders --environment_id test
58
- supacloud-cli app reconcile --ref PROJECT --id orders --environment_id test --release_id RELEASE_SHA256 --activation_id ACTIVATION_UUID
59
- supacloud-cli app rollback --ref PROJECT --id orders --environment_id test --release_id OLD_RELEASE_SHA256 --configuration_id CONFIG_UUID --activation_id NEW_UUID --expected_activation_id CURRENT_UUID
60
- supacloud-cli app retire --ref PROJECT --id orders --environment_id test --activation_id ACTIVATION_UUID
51
+ supacloud app plan --root . --format json
52
+ supacloud app build --root .
53
+ supacloud app upload --ref PROJECT --id orders --manifest_path generated/delivery/delivery.manifest.json
54
+ supacloud app configure --ref PROJECT --id orders --environment_id test --configuration_path configuration.json
55
+ supacloud app deploy --ref PROJECT --id orders --environment_id test --release_id RELEASE_SHA256 --configuration_id CONFIG_UUID --activation_id NEW_UUID --expected_activation_id absent
56
+ supacloud app status --ref PROJECT --id orders --environment_id test
57
+ supacloud app logs --ref PROJECT --id orders --environment_id test
58
+ supacloud app reconcile --ref PROJECT --id orders --environment_id test --release_id RELEASE_SHA256 --activation_id ACTIVATION_UUID
59
+ supacloud app rollback --ref PROJECT --id orders --environment_id test --release_id OLD_RELEASE_SHA256 --configuration_id CONFIG_UUID --activation_id NEW_UUID --expected_activation_id CURRENT_UUID
60
+ supacloud app retire --ref PROJECT --id orders --environment_id test --activation_id ACTIVATION_UUID
61
61
  ```
62
62
 
63
63
  `plan` and `build` read `delivery` in `supacloud.config.ts`; `--root` is the
@@ -82,12 +82,12 @@ Management API credentials except local plan/build and authoring commands.
82
82
  ### Isolated Application Previews
83
83
 
84
84
  ```sh
85
- supacloud-cli app preview-plan --env test --id orders --environment_id test --release_id RELEASE_SHA256 --branch_ref preview-orders
86
- supacloud-cli app preview --env test --id orders --environment_id test --release_id RELEASE_SHA256 --configuration_id CONFIG_UUID --ttl_seconds 3600 --wait --timeout_seconds 300
87
- supacloud-cli app previews --env test --id orders --environment_id test
88
- supacloud-cli app preview-status --env test --id orders --environment_id test --preview_id PREVIEW_UUID --wait --timeout_seconds 300
89
- supacloud-cli app preview-reconcile --env test --id orders --environment_id test --preview_id PREVIEW_UUID
90
- supacloud-cli app preview-cleanup --env test --id orders --environment_id test --preview_id PREVIEW_UUID
85
+ supacloud app preview-plan --env test --id orders --environment_id test --release_id RELEASE_SHA256 --branch_ref preview-orders
86
+ supacloud app preview --env test --id orders --environment_id test --release_id RELEASE_SHA256 --configuration_id CONFIG_UUID --ttl_seconds 3600 --wait --timeout_seconds 300
87
+ supacloud app previews --env test --id orders --environment_id test
88
+ supacloud app preview-status --env test --id orders --environment_id test --preview_id PREVIEW_UUID --wait --timeout_seconds 300
89
+ supacloud app preview-reconcile --env test --id orders --environment_id test --preview_id PREVIEW_UUID
90
+ supacloud app preview-cleanup --env test --id orders --environment_id test --preview_id PREVIEW_UUID
91
91
  ```
92
92
 
93
93
  The platform owns branch provisioning, queue/Storage namespaces, test Secrets,
@@ -194,32 +194,32 @@ Install:
194
194
 
195
195
  ```bash
196
196
  npm install -g @supacloud/cli
197
- supacloud-cli status
197
+ supacloud status
198
198
  ```
199
199
 
200
200
  Bun users can run the same package explicitly with Bun, including on Windows,
201
201
  without installing Node.js or a separate wrapper:
202
202
 
203
203
  ```bash
204
- bunx --bun --package @supacloud/cli supacloud-cli status
204
+ bunx --bun --package @supacloud/cli supacloud status
205
205
  ```
206
206
 
207
207
  One-off execution:
208
208
 
209
209
  ```bash
210
- npm exec --package @supacloud/cli -- supacloud-cli status
210
+ npm exec --package @supacloud/cli -- supacloud status
211
211
  ```
212
212
 
213
213
  Install the packaged AI Skill:
214
214
 
215
215
  ```bash
216
- supacloud-cli ai show_skill
217
- supacloud-cli ai install_skill --dry_run
218
- supacloud-cli ai install_skill
216
+ supacloud ai show_skill
217
+ supacloud ai install_skill --dry_run
218
+ supacloud ai install_skill
219
219
  ```
220
220
 
221
- The default destination is `$CODEX_HOME/skills/supacloud-cli` or
222
- `~/.codex/skills/supacloud-cli`. Use `--target /path/to/skills` for an explicit
221
+ The default destination is `$CODEX_HOME/skills/supacloud` or
222
+ `~/.codex/skills/supacloud`. Use `--target /path/to/skills` for an explicit
223
223
  Skill root. Different existing content is preserved unless `--force` is passed;
224
224
  forced replacement creates a timestamped adjacent backup first.
225
225
 
@@ -241,6 +241,9 @@ SUPACLOUD_ENV=test
241
241
  SUPACLOUD_API_URL=https://management.test.example.com
242
242
  SUPACLOUD_API_TOKEN=<test-management-api-token>
243
243
  SUPACLOUD_PROJECT_REF=test-ref
244
+ SUPACLOUD_APPLICATION_ID=orders
245
+ SUPACLOUD_APPLICATION_ENVIRONMENT_ID=test
246
+ SUPACLOUD_APPLICATION_CONFIGURATION_PATH=deploy/configuration.test.json
244
247
  ```
245
248
 
246
249
  ```dotenv
@@ -249,8 +252,26 @@ SUPACLOUD_ENV=production
249
252
  SUPACLOUD_API_URL=https://management.example.com
250
253
  SUPACLOUD_API_TOKEN=<production-management-api-token>
251
254
  SUPACLOUD_PROJECT_REF=production-ref
255
+ SUPACLOUD_APPLICATION_ID=orders
256
+ SUPACLOUD_APPLICATION_ENVIRONMENT_ID=production
257
+ SUPACLOUD_APPLICATION_CONFIGURATION_PATH=deploy/configuration.production.json
252
258
  ```
253
259
 
260
+ When `SUPACLOUD_APPLICATION_ID` is present, the top-level deployment command
261
+ uses the application release workflow automatically:
262
+
263
+ ```bash
264
+ supacloud --env test deploy
265
+ supacloud --env production deploy --confirm-production production-ref
266
+ ```
267
+
268
+ Test and production use the same workflow. Production safety is enforced by the
269
+ CLI confirmation gate; immutable releases, configuration revisions, backups,
270
+ readiness, CAS activation, rollback artifacts and uncertain-result
271
+ reconciliation belong to SupaCloud. The application layer only supplies its
272
+ build output and configuration file; it does not implement backup, activation
273
+ or downgrade orchestration.
274
+
254
275
  CLI requests (including `status`) default to `SUPACLOUD_TLS_VERIFY=false`, skipping HTTPS certificate verification so that
255
276
  air-gapped installations using private or self-signed certificates work
256
277
  without extra configuration. To enable strict certificate verification, set:
@@ -276,9 +297,9 @@ where identity authentication is required.
276
297
  Run commands with the selected profile:
277
298
 
278
299
  ```bash
279
- supacloud-cli --env test status
280
- supacloud-cli project get --env test
281
- supacloud-cli status --env-file ./config/supacloud.staging.env
300
+ supacloud --env test status
301
+ supacloud project get --env test
302
+ supacloud status --env-file ./config/supacloud.staging.env
282
303
  ```
283
304
 
284
305
  Global flags may appear before or after the command. Both `--key value` and
@@ -301,7 +322,7 @@ SUPACLOUD_ENV=test \
301
322
  SUPACLOUD_API_URL=https://management.test.example.com \
302
323
  SUPACLOUD_API_TOKEN="$CI_SUPACLOUD_API_TOKEN" \
303
324
  SUPACLOUD_PROJECT_REF=test-ref \
304
- supacloud-cli status
325
+ supacloud status
305
326
  ```
306
327
 
307
328
  Project context is resolved from one atomic source: a named profile selected by
@@ -346,17 +367,17 @@ The `frontend` command keeps the existing deployment, Git, and tar.zst
346
367
  actions and also exposes the immutable prebuilt release workflow:
347
368
 
348
369
  ```bash
349
- supacloud-cli frontend list_releases --ref abc123 --id web
350
- supacloud-cli frontend get_active_release --ref abc123 --id web
351
- supacloud-cli frontend get_release --ref abc123 --id web --release_id <sha256>
352
- supacloud-cli frontend upload_release --ref abc123 --id web --archive_path ./dist.tar.zst
353
- supacloud-cli frontend activate_release --ref abc123 --id web \
370
+ supacloud frontend list_releases --ref abc123 --id web
371
+ supacloud frontend get_active_release --ref abc123 --id web
372
+ supacloud frontend get_release --ref abc123 --id web --release_id <sha256>
373
+ supacloud frontend upload_release --ref abc123 --id web --archive_path ./dist.tar.zst
374
+ supacloud frontend activate_release --ref abc123 --id web \
354
375
  --release_id <sha256> \
355
376
  --expected_active_release_id absent \
356
377
  --expected_activation_id absent \
357
378
  --mutation_id <retry-stable-uuid-v4>
358
- supacloud-cli frontend rollback --ref abc123 --id web --release_id <retained-sha256>
359
- supacloud-cli frontend rollback --ref abc123 --id web
379
+ supacloud frontend rollback --ref abc123 --id web --release_id <retained-sha256>
380
+ supacloud frontend rollback --ref abc123 --id web
360
381
  ```
361
382
 
362
383
  `upload_release` hashes and streams an existing regular tar.zst file without
@@ -385,11 +406,11 @@ must not be blindly retried.
385
406
  Store a compiler-built HTTP/Worker application as one immutable release:
386
407
 
387
408
  ```bash
388
- supacloud-cli applications upload_release --ref abc123 --id reviews \
409
+ supacloud applications upload_release --ref abc123 --id reviews \
389
410
  --manifest_path ./generated/delivery/delivery.manifest.json
390
- supacloud-cli applications list_releases --ref abc123 --id reviews --limit 50
391
- supacloud-cli applications get_release --ref abc123 --id reviews --release_id <sha256>
392
- supacloud-cli applications get_runtime --ref abc123 --id reviews --environment_id test
411
+ supacloud applications list_releases --ref abc123 --id reviews --limit 50
412
+ supacloud applications get_release --ref abc123 --id reviews --release_id <sha256>
413
+ supacloud applications get_runtime --ref abc123 --id reviews --environment_id test
393
414
  ```
394
415
 
395
416
  Upload verifies executable objects, transfers their inventory with multipart
@@ -427,10 +448,10 @@ environment. Saving a revision does not allocate ports, start processes, change
427
448
  traffic or migrate data:
428
449
 
429
450
  ```bash
430
- supacloud-cli applications get_configuration --ref abc123 --id reviews --environment_id test
431
- supacloud-cli applications put_configuration --ref abc123 --id reviews --environment_id test \
451
+ supacloud applications get_configuration --ref abc123 --id reviews --environment_id test
452
+ supacloud applications put_configuration --ref abc123 --id reviews --environment_id test \
432
453
  --configuration_path ./application.test.json
433
- supacloud-cli applications get_configuration --ref abc123 --id reviews --environment_id test \
454
+ supacloud applications get_configuration --ref abc123 --id reviews --environment_id test \
434
455
  --configuration_id <uuid>
435
456
  ```
436
457
 
@@ -493,12 +514,12 @@ The default Management API instance does not yet enable these endpoints.
493
514
  For an explicitly composed test host:
494
515
 
495
516
  ```bash
496
- supacloud-cli applications activate_release --ref abc123 --id reviews --environment_id test \
517
+ supacloud applications activate_release --ref abc123 --id reviews --environment_id test \
497
518
  --release_id <release-sha256> --configuration_id <configuration-uuid> \
498
519
  --activation_id <new-uuid> --expected_activation_id absent
499
- supacloud-cli applications reconcile_activation --ref abc123 --id reviews --environment_id test \
520
+ supacloud applications reconcile_activation --ref abc123 --id reviews --environment_id test \
500
521
  --release_id <release-sha256> --activation_id <same-uuid>
501
- supacloud-cli applications retire_activation --ref abc123 --id reviews --environment_id test \
522
+ supacloud applications retire_activation --ref abc123 --id reviews --environment_id test \
502
523
  --activation_id <stopped-and-unrouted-uuid>
503
524
  ```
504
525
 
@@ -530,26 +551,26 @@ missing, the platform begins project re-provisioning instead. It does not
530
551
  restore a database backup and is never invoked automatically by the CLI.
531
552
 
532
553
  ```bash
533
- supacloud-cli project pause --ref abc123
534
- supacloud-cli release logical_backup_restore --ref abc123 \
554
+ supacloud project pause --ref abc123
555
+ supacloud release logical_backup_restore --ref abc123 \
535
556
  --backup_id logical-full_abc123_<backup-id-suffix> \
536
557
  --expected_sha256 <64-lowercase-hex> \
537
558
  --restore_confirmation RESTORE_PROJECT:abc123:logical-full_abc123_<backup-id-suffix>:<64-lowercase-hex>
538
- supacloud-cli project restore --ref abc123
559
+ supacloud project restore --ref abc123
539
560
  ```
540
561
 
541
562
  ```bash
542
- supacloud-cli release logical_backup_list --ref abc123
543
- supacloud-cli release logical_backup_create --ref abc123
544
- supacloud-cli release logical_backup_restore --ref abc123 \
563
+ supacloud release logical_backup_list --ref abc123
564
+ supacloud release logical_backup_create --ref abc123
565
+ supacloud release logical_backup_restore --ref abc123 \
545
566
  --backup_id logical-full_abc123_<backup-id-suffix> \
546
567
  --expected_sha256 <64-lowercase-hex> \
547
568
  --restore_confirmation RESTORE_PROJECT:abc123:logical-full_abc123_<backup-id-suffix>:<64-lowercase-hex>
548
- supacloud-cli release postgrest_status --ref abc123
549
- supacloud-cli release postgrest_restart --ref abc123
550
- supacloud-cli release release_canary_fixture_stage_replay --ref abc123 \
569
+ supacloud release postgrest_status --ref abc123
570
+ supacloud release postgrest_restart --ref abc123
571
+ supacloud release release_canary_fixture_stage_replay --ref abc123 \
551
572
  --subject <central-subject-uuid> --request_id <stage-request-uuid>
552
- supacloud-cli release release_canary_fixture_disable_replay --ref abc123 \
573
+ supacloud release release_canary_fixture_disable_replay --ref abc123 \
553
574
  --fixture_id <fixture-uuid> --disable_request_id <disable-request-uuid> \
554
575
  --issuer <issuer-url> --subject <central-subject-uuid>
555
576
  ```
@@ -601,25 +622,25 @@ base commit without manual JSON editing or risk of dirtying non-manifest fields.
601
622
 
602
623
  ```bash
603
624
  # Rebind a single scope manifest to latest git main (or origin/main)
604
- supacloud-cli release scope_rebind --file supacloud/fa/release-scopes/20260907-intake-p1-production.json
625
+ supacloud release scope_rebind --file supacloud/fa/release-scopes/20260907-intake-p1-production.json
605
626
 
606
627
  # Rebind multiple files (e.g. production and staging together)
607
- supacloud-cli release scope_rebind --files "20260907-intake-p1-production.json,20260907-intake-p1-staging.json"
628
+ supacloud release scope_rebind --files "20260907-intake-p1-production.json,20260907-intake-p1-staging.json"
608
629
 
609
630
  # Rebind all scopes matching a task ID or filename prefix in standard directories
610
- supacloud-cli release scope_rebind --task 20260907-intake-p1
631
+ supacloud release scope_rebind --task 20260907-intake-p1
611
632
 
612
633
  # Specify an explicit base commit SHA or git ref
613
- supacloud-cli release scope_rebind --task 20260907-intake-p1 --base_commit origin/main
634
+ supacloud release scope_rebind --task 20260907-intake-p1 --base_commit origin/main
614
635
 
615
636
  # Preview changes without modifying files
616
- supacloud-cli release scope_rebind --task 20260907-intake-p1 --dry_run
637
+ supacloud release scope_rebind --task 20260907-intake-p1 --dry_run
617
638
 
618
639
  # Inspect scope status, SHA-256 hash, and alignment with git HEAD / origin/main
619
- supacloud-cli release scope_inspect --file 20260907-intake-p1-production.json
640
+ supacloud release scope_inspect --file 20260907-intake-p1-production.json
620
641
 
621
642
  # Scaffold a new canonical release scope
622
- supacloud-cli release scope_create \
643
+ supacloud release scope_create \
623
644
  --file supacloud/fa/release-scopes/20260907-intake-p1.json \
624
645
  --task FA-INTAKE-P1 \
625
646
  --ref abc123 \
@@ -642,7 +663,7 @@ Production writes require an explicit confirmation equal to the selected
642
663
  profile's project ref:
643
664
 
644
665
  ```bash
645
- supacloud-cli database push_migrations --env prod \
666
+ supacloud database push_migrations --env prod \
646
667
  --ref production-ref --dir supabase/migrations \
647
668
  --confirm-production production-ref
648
669
  ```
@@ -667,44 +688,44 @@ API token or service-role key.
667
688
  Examples:
668
689
 
669
690
  ```bash
670
- supacloud-cli status
671
- supacloud-cli project get
672
- supacloud-cli project logs --log_type database
673
- supacloud-cli project task_stats
674
- supacloud-cli project task_detail --task_id task_123
675
- supacloud-cli queue stats --queue emails
676
- supacloud-cli queue dlq --queue emails --limit 20
677
- supacloud-cli task_events inspect_webhook --ref abc123
678
- supacloud-cli database query --sql "select now()"
679
- supacloud-cli database query --ref abc123 --file ./queries/vector-search.sql
680
- supacloud-cli database migration_inventory --ref abc123
681
- supacloud-cli database lint_migrations --dir supabase/migrations
682
- supacloud-cli database rebase_migrations --dir supabase/migrations --baseline_file backups/schema.sql --baseline_version 20261008000000 --output_dir supabase/migrations-rebased
683
- supacloud-cli database push_migrations --ref abc123 --dir supabase/migrations --dry_run
684
- supacloud-cli supabase migration_new --name add_accounts
685
- supacloud-cli supabase db_diff --schema public --name add_accounts
686
- supacloud-cli supabase push --ref abc123 --dir supabase/migrations --dry_run
687
- supacloud-cli frontend list --ref abc123
688
- supacloud-cli branch create --name feature-orders --data_mode schema_only
689
- supacloud-cli branch promotion_plan --branch_ref preview123
690
- supacloud-cli branch promote --branch_ref preview123 --plan_checksum <sha256>
691
- supacloud-cli edge_functions get_config --ref abc123 --slug hello
692
- supacloud-cli edge_functions deploy --ref abc123 --slug hello --path ./supabase/functions/hello --expected-active-version absent --expected-activation-id legacy
693
- supacloud-cli edge_functions deploy --ref abc123 --slug hello --prebundled-path ./dist/hello.js --expected-sha256 <sha256> --expected-active-version 4 --expected-activation-id <uuid>
694
- supacloud-cli edge_functions deploy_bundle --ref abc123 --slug hello --files '{"index.ts":"export default { fetch: () => new Response(\"ok\") }"}' --expected-active-version 7 --expected-activation-id <uuid>
695
- supacloud-cli edge_functions source --ref abc123 --slug hello --version 7 --output ./hello-v7.ts
696
- supacloud-cli edge_functions activate --ref abc123 --slug hello --version 3 --expected-active-version 8 --expected-activation-id <uuid>
697
- supacloud-cli edge_functions delete --ref abc123 --slug hello --expected-activation-id <uuid>
698
- supacloud-cli scheduled_functions list --ref abc123
699
- supacloud-cli secrets upsert --ref abc123 --from-env API_KEY,WEBHOOK_SECRET
700
- supacloud-cli storage list_buckets --ref abc123
701
- supacloud-cli storage get_bucket --ref abc123 --bucket reports
702
- supacloud-cli storage create_bucket --ref abc123 --bucket reports --public false \
691
+ supacloud status
692
+ supacloud project get
693
+ supacloud project logs --log_type database
694
+ supacloud project task_stats
695
+ supacloud project task_detail --task_id task_123
696
+ supacloud queue stats --queue emails
697
+ supacloud queue dlq --queue emails --limit 20
698
+ supacloud task_events inspect_webhook --ref abc123
699
+ supacloud database query --sql "select now()"
700
+ supacloud database query --ref abc123 --file ./queries/vector-search.sql
701
+ supacloud database migration_inventory --ref abc123
702
+ supacloud database lint_migrations --dir supabase/migrations
703
+ supacloud database rebase_migrations --dir supabase/migrations --baseline_file backups/schema.sql --baseline_version 20261008000000 --output_dir supabase/migrations-rebased
704
+ supacloud database push_migrations --ref abc123 --dir supabase/migrations --dry_run
705
+ supacloud supabase migration_new --name add_accounts
706
+ supacloud supabase db_diff --schema public --name add_accounts
707
+ supacloud supabase push --ref abc123 --dir supabase/migrations --dry_run
708
+ supacloud frontend list --ref abc123
709
+ supacloud branch create --name feature-orders --data_mode schema_only
710
+ supacloud branch promotion_plan --branch_ref preview123
711
+ supacloud branch promote --branch_ref preview123 --plan_checksum <sha256>
712
+ supacloud edge_functions get_config --ref abc123 --slug hello
713
+ supacloud edge_functions deploy --ref abc123 --slug hello --path ./supabase/functions/hello --expected-active-version absent --expected-activation-id legacy
714
+ supacloud edge_functions deploy --ref abc123 --slug hello --prebundled-path ./dist/hello.js --expected-sha256 <sha256> --expected-active-version 4 --expected-activation-id <uuid>
715
+ supacloud edge_functions deploy_bundle --ref abc123 --slug hello --files '{"index.ts":"export default { fetch: () => new Response(\"ok\") }"}' --expected-active-version 7 --expected-activation-id <uuid>
716
+ supacloud edge_functions source --ref abc123 --slug hello --version 7 --output ./hello-v7.ts
717
+ supacloud edge_functions activate --ref abc123 --slug hello --version 3 --expected-active-version 8 --expected-activation-id <uuid>
718
+ supacloud edge_functions delete --ref abc123 --slug hello --expected-activation-id <uuid>
719
+ supacloud scheduled_functions list --ref abc123
720
+ supacloud secrets upsert --ref abc123 --from-env API_KEY,WEBHOOK_SECRET
721
+ supacloud storage list_buckets --ref abc123
722
+ supacloud storage get_bucket --ref abc123 --bucket reports
723
+ supacloud storage create_bucket --ref abc123 --bucket reports --public false \
703
724
  --file_size_limit 10485760 --allowed_mime_types "application/pdf,image/png"
704
- supacloud-cli storage update_bucket --ref abc123 --bucket reports \
725
+ supacloud storage update_bucket --ref abc123 --bucket reports \
705
726
  --expected_revision <revision-from-get_bucket> \
706
727
  --allowed_mime_types '["application/pdf"]'
707
- supacloud-cli storage delete_bucket --ref abc123 --bucket reports \
728
+ supacloud storage delete_bucket --ref abc123 --bucket reports \
708
729
  --expected_revision <revision-from-get_bucket> --require_empty true
709
730
  ```
710
731
 
@@ -720,7 +741,7 @@ human-readable behavior.
720
741
  with the separate read-only `/database/migrations/inventory` endpoint:
721
742
 
722
743
  ```bash
723
- supacloud-cli database delivery_migration_plan --ref abc123 \
744
+ supacloud database delivery_migration_plan --ref abc123 \
724
745
  --delivery_manifest /archive/delivery/delivery.manifest.json --delivery_target api
725
746
  ```
726
747
 
@@ -878,12 +899,12 @@ activation targets still require a positive version.
878
899
  Scheduled Function lifecycle operations are also project-scoped:
879
900
 
880
901
  ```bash
881
- supacloud-cli scheduled_functions create --ref abc123 --name nightly \
902
+ supacloud scheduled_functions create --ref abc123 --name nightly \
882
903
  --slug cleanup --cron "0 2 * * *" --method POST
883
- supacloud-cli scheduled_functions get --ref abc123 --schedule_id <id>
884
- supacloud-cli scheduled_functions update --ref abc123 --schedule_id <id> \
904
+ supacloud scheduled_functions get --ref abc123 --schedule_id <id>
905
+ supacloud scheduled_functions update --ref abc123 --schedule_id <id> \
885
906
  --expected_updated_at <updated_at-from-list> --cron "0 3 * * *"
886
- supacloud-cli scheduled_functions delete --ref abc123 --schedule_id <id> \
907
+ supacloud scheduled_functions delete --ref abc123 --schedule_id <id> \
887
908
  --expected_updated_at <updated_at-from-list>
888
909
  ```
889
910
 
@@ -923,20 +944,20 @@ break-glass API mode and is intentionally not exposed by this project CLI.
923
944
  ## SupaCloud Lite CLI adapter
924
945
 
925
946
  Lite can be used from its standalone `supacloud-lite` CLI and from the main
926
- `supacloud-cli` through the local-only `lite` module. The adapter never calls
947
+ `supacloud` through the local-only `lite` module. The adapter never calls
927
948
  the Management API, never invokes the official Supabase CLI, and never treats a
928
949
  PGlite data directory as a Postgres DSN.
929
950
 
930
951
  ```bash
931
- supacloud-cli lite migrate --project_dir .
932
- supacloud-cli lite status --project_dir .
933
- supacloud-cli lite db_diff --project_dir . --file add_accounts
934
- supacloud-cli lite db_pull --project_dir . --file remote_schema
935
- supacloud-cli lite db_pull --project_dir . --file reviewed_schema --baseline
936
- supacloud-cli lite gen_types --project_dir . --output src/database.types.ts
937
- supacloud-cli lite snapshot_create --project_dir . --output backups/lite.tar.gz
938
- supacloud-cli lite doctor --project_dir . --json
939
- supacloud-cli lite start --project_dir . --port 54321
952
+ supacloud lite migrate --project_dir .
953
+ supacloud lite status --project_dir .
954
+ supacloud lite db_diff --project_dir . --file add_accounts
955
+ supacloud lite db_pull --project_dir . --file remote_schema
956
+ supacloud lite db_pull --project_dir . --file reviewed_schema --baseline
957
+ supacloud lite gen_types --project_dir . --output src/database.types.ts
958
+ supacloud lite snapshot_create --project_dir . --output backups/lite.tar.gz
959
+ supacloud lite doctor --project_dir . --json
960
+ supacloud lite start --project_dir . --port 54321
940
961
  ```
941
962
 
942
963
  The adapter resolves the executable in this order:
@@ -964,29 +985,29 @@ open-source Supabase CLI. It is not a fork. Local authoring commands work withou
964
985
  SupaCloud credentials:
965
986
 
966
987
  ```bash
967
- supacloud-cli supabase version
968
- supacloud-cli supabase init --workdir .
969
- supacloud-cli supabase migration_new --name add_accounts
970
- supacloud-cli supabase db_diff --schema public --name add_accounts
971
- supacloud-cli supabase db_reset --no_seed
988
+ supacloud supabase version
989
+ supacloud supabase init --workdir .
990
+ supacloud supabase migration_new --name add_accounts
991
+ supacloud supabase db_diff --schema public --name add_accounts
992
+ supacloud supabase db_reset --no_seed
972
993
  ```
973
994
 
974
995
  Remote inspection and backup commands require an explicit, percent-encoded
975
996
  Postgres DSN:
976
997
 
977
998
  ```bash
978
- supacloud-cli supabase db_pull --db_url "$SUPACLOUD_DB_URL" --declarative
979
- supacloud-cli supabase migration_list --db_url "$SUPACLOUD_DB_URL"
980
- supacloud-cli supabase db_dump --db_url "$SUPACLOUD_DB_URL" --file backups/schema.sql
981
- supacloud-cli supabase gen_types --db_url "$SUPACLOUD_DB_URL" --schema public --file src/database.types.ts
999
+ supacloud supabase db_pull --db_url "$SUPACLOUD_DB_URL" --declarative
1000
+ supacloud supabase migration_list --db_url "$SUPACLOUD_DB_URL"
1001
+ supacloud supabase db_dump --db_url "$SUPACLOUD_DB_URL" --file backups/schema.sql
1002
+ supacloud supabase gen_types --db_url "$SUPACLOUD_DB_URL" --schema public --file src/database.types.ts
982
1003
  ```
983
1004
 
984
1005
  Remote migration application intentionally stays on SupaCloud's existing
985
1006
  project-authenticated API:
986
1007
 
987
1008
  ```bash
988
- supacloud-cli supabase push --ref abc123 --dir supabase/migrations --dry_run
989
- supacloud-cli supabase push --ref abc123 --dir supabase/migrations
1009
+ supacloud supabase push --ref abc123 --dir supabase/migrations --dry_run
1010
+ supacloud supabase push --ref abc123 --dir supabase/migrations
990
1011
  ```
991
1012
 
992
1013
  `push` uses only `SUPACLOUD_API_TOKEN` for the SupaCloud Management API. That
@@ -1003,17 +1024,17 @@ the adapter does not install a new CLI or replace an existing schema authority.
1003
1024
  `init` preserves existing configuration and inherits the installed CLI's defaults.
1004
1025
 
1005
1026
  ```bash
1006
- supacloud-cli supabase db_schema_declarative_generate --db_url "$SUPACLOUD_DB_URL"
1007
- supacloud-cli supabase db_schema_declarative_sync --name add_accounts --strict_coverage
1008
- supacloud-cli supabase db_diff --diff_engine pg-delta --name add_accounts
1009
- supacloud-cli supabase config_pull --ref upstream-project
1010
- supacloud-cli supabase config_pull --ref upstream-project --dry_run=false --yes
1011
- supacloud-cli supabase stack_start --workdir .
1012
- supacloud-cli supabase stack_status --workdir .
1013
- SUPACLOUD_ENABLE_NATIVE_STACK=1 supacloud-cli supabase stack_prepare --workdir . --runtime native
1014
- SUPACLOUD_ENABLE_NATIVE_STACK=1 supacloud-cli supabase stack_start --workdir . --runtime native --preparation on-demand
1015
- supacloud-cli supabase stack_stop --workdir .
1016
- supacloud-cli supabase stack_destroy --workdir . --confirm_destroy --yes
1027
+ supacloud supabase db_schema_declarative_generate --db_url "$SUPACLOUD_DB_URL"
1028
+ supacloud supabase db_schema_declarative_sync --name add_accounts --strict_coverage
1029
+ supacloud supabase db_diff --diff_engine pg-delta --name add_accounts
1030
+ supacloud supabase config_pull --ref upstream-project
1031
+ supacloud supabase config_pull --ref upstream-project --dry_run=false --yes
1032
+ supacloud supabase stack_start --workdir .
1033
+ supacloud supabase stack_status --workdir .
1034
+ SUPACLOUD_ENABLE_NATIVE_STACK=1 supacloud supabase stack_prepare --workdir . --runtime native
1035
+ SUPACLOUD_ENABLE_NATIVE_STACK=1 supacloud supabase stack_start --workdir . --runtime native --preparation on-demand
1036
+ supacloud supabase stack_stop --workdir .
1037
+ supacloud supabase stack_destroy --workdir . --confirm_destroy --yes
1017
1038
  ```
1018
1039
 
1019
1040
  Declarative sync generates without applying unless `--apply` is explicit.
@@ -1051,7 +1072,7 @@ If the live database already contains reviewed historical changes, first pull,
1051
1072
  back up, and prove schema equivalence. Then preview the controlled tracking sync:
1052
1073
 
1053
1074
  ```bash
1054
- supacloud-cli database baseline_migrations --ref abc123 --dir supabase/migrations --dry_run
1075
+ supacloud database baseline_migrations --ref abc123 --dir supabase/migrations --dry_run
1055
1076
  ```
1056
1077
 
1057
1078
  Only after explicit approval, rerun without `--dry_run`. This records migration
@@ -1079,9 +1100,9 @@ Transaction boundary: SupaCloud supports transaction blocks inside one SQL reque
1079
1100
  Auth configuration commands accept a JSON object from the CLI:
1080
1101
 
1081
1102
  ```bash
1082
- supacloud-cli auth update_settings --ref abc123 \
1103
+ supacloud auth update_settings --ref abc123 \
1083
1104
  --config '{"disable_signup":true,"enable_signup":false}'
1084
- supacloud-cli auth update_config --ref abc123 \
1105
+ supacloud auth update_config --ref abc123 \
1085
1106
  --config '{"third_party_auth":{"enabled":true}}'
1086
1107
  ```
1087
1108
 
@@ -1156,14 +1177,14 @@ Gateway / Caddy commands (require admin privileges; config is injected via the C
1156
1177
  - `gateway verify_custom_hostname` — verify a custom hostname
1157
1178
 
1158
1179
  ```bash
1159
- supacloud-cli gateway routes --ref abc123
1160
- supacloud-cli gateway upsert_route --ref abc123 --route_id webhook \
1180
+ supacloud gateway routes --ref abc123
1181
+ supacloud gateway upsert_route --ref abc123 --route_id webhook \
1161
1182
  --hosts "api.example.com" --paths "/webhook/*" --upstream 10.0.0.5:8080
1162
- supacloud-cli gateway upsert_route --ref abc123 --route_id canonical-https \
1183
+ supacloud gateway upsert_route --ref abc123 --route_id canonical-https \
1163
1184
  --hosts "www.example.com" --paths "/*" --protocol http \
1164
1185
  --redirect_to 'https://www.example.com{http.request.uri}' --redirect_status 308
1165
- supacloud-cli gateway config --ref abc123 --rate_limit_tier pro
1166
- supacloud-cli gateway rebuild --ref abc123 --clean
1186
+ supacloud gateway config --ref abc123 --rate_limit_tier pro
1187
+ supacloud gateway rebuild --ref abc123 --clean
1167
1188
  ```
1168
1189
 
1169
1190
  For server installation, SSH diagnostics, and tenant administration, use `@supacloud/admin`.
package/dist/index.js CHANGED
@@ -8753,9 +8753,9 @@ function outcomeUnknownGuidance(text) {
8753
8753
  const safeScope = typeof ref === "string" && /^[a-z0-9-]{1,20}$/.test(ref) && typeof id === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(id) && typeof environment === "string" && /^[A-Za-z0-9_-]{1,64}$/.test(environment);
8754
8754
  let command;
8755
8755
  if (safeScope && (data.operation === "applications.promote_application" || data.operation === "applications.reconcile_promotion") && typeof data.mutation_id === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(data.mutation_id)) {
8756
- command = `supacloud-cli app promote-status --ref ${ref} --id ${id} --environment_id ${environment} --mutation_id ${data.mutation_id}`;
8756
+ command = `supacloud app promote-status --ref ${ref} --id ${id} --environment_id ${environment} --mutation_id ${data.mutation_id}`;
8757
8757
  } else if (safeScope && (data.operation === "applications.create_preview" || data.operation === "applications.cleanup_preview")) {
8758
- command = `supacloud-cli app preview-list --ref ${ref} --id ${id} --environment_id ${environment}`;
8758
+ command = `supacloud app preview-list --ref ${ref} --id ${id} --environment_id ${environment}`;
8759
8759
  }
8760
8760
  return "OUTCOME_UNKNOWN:操作结果无法确认,服务端可能已经完成操作,但客户端未收到可验证的最终结果。" + "请先查询当前状态或操作回执,再决定是否重试;不要直接重复提交。" + (command ? `
8761
8761
  保持原 --env/--env-file 选择,先查询:${command}` : "");
@@ -8978,7 +8978,12 @@ var CORE_CONTEXT_KEYS = [
8978
8978
  "SUPACLOUD_API_TOKEN",
8979
8979
  "SUPACLOUD_PROJECT_REF",
8980
8980
  "X_PROJECT_REF",
8981
- "SUPACLOUD_HOST"
8981
+ "SUPACLOUD_HOST",
8982
+ "SUPACLOUD_APPLICATION_ID",
8983
+ "SUPACLOUD_APPLICATION_ENVIRONMENT_ID",
8984
+ "SUPACLOUD_APPLICATION_CONFIGURATION_PATH",
8985
+ "SUPACLOUD_APPLICATION_CONFIGURATION_ID",
8986
+ "SUPACLOUD_APPLICATION_MANIFEST_PATH"
8982
8987
  ];
8983
8988
  function unquotedEnvValue(rawValue) {
8984
8989
  const value = rawValue.trim();
@@ -9145,6 +9150,11 @@ function resolveSupaCloudContext(env = process.env, cwd = process.cwd(), selecti
9145
9150
  source: source.kind,
9146
9151
  sourcePath: source.path,
9147
9152
  environmentVariables: source.values,
9153
+ applicationId: source.values.SUPACLOUD_APPLICATION_ID?.trim() || "",
9154
+ applicationEnvironmentId: source.values.SUPACLOUD_APPLICATION_ENVIRONMENT_ID?.trim() || source.environment,
9155
+ applicationConfigurationPath: source.values.SUPACLOUD_APPLICATION_CONFIGURATION_PATH?.trim() || "",
9156
+ applicationConfigurationId: source.values.SUPACLOUD_APPLICATION_CONFIGURATION_ID?.trim() || "",
9157
+ applicationManifestPath: source.values.SUPACLOUD_APPLICATION_MANIFEST_PATH?.trim() || "",
9148
9158
  insecureTls
9149
9159
  };
9150
9160
  }
@@ -20792,7 +20802,7 @@ import {
20792
20802
  import { homedir as homedir2 } from "node:os";
20793
20803
  import { dirname as dirname4, join as join8, relative as relative4, resolve as resolve11, sep as sep3 } from "node:path";
20794
20804
  import { fileURLToPath } from "node:url";
20795
- var SKILL_NAME = "supacloud-cli";
20805
+ var SKILL_NAME = "supacloud";
20796
20806
  function regularFiles(rootDirectory, currentDirectory = rootDirectory) {
20797
20807
  const files = [];
20798
20808
  for (const directoryEntry of readdirSync4(currentDirectory, { withFileTypes: true })) {
@@ -20830,7 +20840,7 @@ function availableBackupDirectory(destinationDirectory, now) {
20830
20840
  }
20831
20841
  function stagedSkill(sourceDirectory, targetRoot) {
20832
20842
  mkdirSync3(targetRoot, { recursive: true });
20833
- const stagingRoot = mkdtempSync2(join8(targetRoot, ".supacloud-cli-install-"));
20843
+ const stagingRoot = mkdtempSync2(join8(targetRoot, ".supacloud-install-"));
20834
20844
  const stagingSkill = join8(stagingRoot, SKILL_NAME);
20835
20845
  try {
20836
20846
  cpSync(sourceDirectory, stagingSkill, { recursive: true, errorOnExist: true });
@@ -21097,10 +21107,10 @@ var starter_metadata_default = {
21097
21107
  generatedBy: "supacloud/starter-metadata-v1",
21098
21108
  packages: {
21099
21109
  compiler: {
21100
- version: "0.43.0"
21110
+ version: "0.44.0"
21101
21111
  },
21102
21112
  app: {
21103
- version: "0.25.0",
21113
+ version: "0.26.0",
21104
21114
  dependencies: {
21105
21115
  rxjs: "7.8.2"
21106
21116
  }
@@ -21883,8 +21893,8 @@ The compiler discovers this declaration; no runtime container lookup is needed.
21883
21893
  With the matching candidate/released CLI installed:
21884
21894
 
21885
21895
  \`\`\`sh
21886
- supacloud-cli app generate --kind resource --name inventory --register-in src/app.module.ts --dry-run --format json
21887
- supacloud-cli app generate --kind resource --name inventory --register-in src/app.module.ts
21896
+ supacloud app generate --kind resource --name inventory --register-in src/app.module.ts --dry-run --format json
21897
+ supacloud app generate --kind resource --name inventory --register-in src/app.module.ts
21888
21898
  bun run check
21889
21899
  bun run inspect
21890
21900
  \`\`\`
@@ -26558,9 +26568,9 @@ function buildDatabaseAiContext(modules, root, moduleName, target) {
26558
26568
  ]
26559
26569
  },
26560
26570
  verification: [
26561
- "supacloud-cli db lint --module_file db/modules.ts",
26562
- "supacloud-cli db explain --target <object>",
26563
- 'supacloud-cli db module_check --module_file db/modules.ts --database_url "$DATABASE_URL"'
26571
+ "supacloud db lint --module_file db/modules.ts",
26572
+ "supacloud db explain --target <object>",
26573
+ 'supacloud db module_check --module_file db/modules.ts --database_url "$DATABASE_URL"'
26564
26574
  ]
26565
26575
  };
26566
26576
  }
@@ -27768,7 +27778,7 @@ function registerReleaseTools(server, http, options = {}) {
27768
27778
  content: [
27769
27779
  {
27770
27780
  type: "text",
27771
- text: "⚠️ This command requires Management API context. Run `supacloud-cli status` to inspect current detection."
27781
+ text: "⚠️ This command requires Management API context. Run `supacloud status` to inspect current detection."
27772
27782
  }
27773
27783
  ]
27774
27784
  };
@@ -27990,11 +28000,13 @@ async function readJson(path) {
27990
28000
  throw new Error(`Invalid JSON file ${path}: ${error instanceof Error ? error.message : String(error)}`);
27991
28001
  }
27992
28002
  }
27993
- async function findDeployConfigRoot(startDirectory) {
28003
+ async function findDeployConfigRoot(startDirectory, environmentName) {
27994
28004
  let directory = resolve22(startDirectory);
27995
28005
  while (true) {
27996
- if (await pathExists(join17(directory, "supacloud.json")))
28006
+ const environmentFile = environmentName ? `.env.supacloud.${environmentName}` : null;
28007
+ if (await pathExists(join17(directory, "supacloud.json")) || await pathExists(join17(directory, "supacloud.config.ts")) || environmentFile !== null && await pathExists(join17(directory, environmentFile))) {
27997
28008
  return directory;
28009
+ }
27998
28010
  const parent = dirname11(directory);
27999
28011
  if (parent === directory)
28000
28012
  return resolve22(startDirectory);
@@ -28340,6 +28352,42 @@ function registerDeployTools(server, http, options = {}) {
28340
28352
  if (!projectRef)
28341
28353
  throw new Error("A linked project ref is required. Set SUPACLOUD_PROJECT_REF or pass --ref");
28342
28354
  const configRoot = await findDeployConfigRoot(invocationDirectory);
28355
+ if (options.application?.id) {
28356
+ if (!options.applicationRelease) {
28357
+ throw new Error("Application release support is unavailable in this CLI context");
28358
+ }
28359
+ if (args.target || args.build_command || args.output_dir) {
28360
+ throw new Error("Application profile deploy does not accept frontend target, build command, or output directory flags");
28361
+ }
28362
+ if (args.dry_run === true || args.plan === true || args.diff === true) {
28363
+ throw new Error("Application profile deploy does not support dry_run, plan, or diff; use app deploy-plan for a read-only plan");
28364
+ }
28365
+ const environmentId = options.application.environmentId.trim();
28366
+ if (!environmentId) {
28367
+ throw new Error("Application profile requires SUPACLOUD_APPLICATION_ENVIRONMENT_ID or SUPACLOUD_ENV");
28368
+ }
28369
+ const configurationPath = options.application.configurationPath?.trim();
28370
+ const configurationId = options.application.configurationId?.trim();
28371
+ if (!configurationPath && !configurationId) {
28372
+ throw new Error("Application profile requires SUPACLOUD_APPLICATION_CONFIGURATION_PATH or SUPACLOUD_APPLICATION_CONFIGURATION_ID");
28373
+ }
28374
+ if (configurationPath && configurationId) {
28375
+ throw new Error("Application profile must set only one of SUPACLOUD_APPLICATION_CONFIGURATION_PATH or SUPACLOUD_APPLICATION_CONFIGURATION_ID");
28376
+ }
28377
+ const result = await options.applicationRelease({
28378
+ action: "release",
28379
+ ref: projectRef,
28380
+ id: options.application.id,
28381
+ environment_id: environmentId,
28382
+ root: configRoot,
28383
+ ...configurationPath ? { configuration_path: configurationPath } : {},
28384
+ ...configurationId ? { configuration_id: configurationId } : {},
28385
+ ...options.application.manifestPath ? { manifest_path: options.application.manifestPath } : {},
28386
+ ...args.skip_build === true ? { skip_build: true } : {},
28387
+ ...args.json === true ? { format: "json", json: true } : {}
28388
+ });
28389
+ return result;
28390
+ }
28343
28391
  const config = await readDeployConfig(configRoot);
28344
28392
  const target = selectTarget(configRoot, invocationDirectory, config, String(args.target || "").trim() || undefined);
28345
28393
  const projectDirectory = target.root;
@@ -28842,7 +28890,7 @@ function registerRemoteDevTools(server, options = {}) {
28842
28890
  // package.json
28843
28891
  var package_default = {
28844
28892
  name: "@supacloud/cli",
28845
- version: "0.86.0",
28893
+ version: "0.87.0",
28846
28894
  description: "Project-scoped CLI for SupaCloud users",
28847
28895
  type: "module",
28848
28896
  main: "./dist/index.js",
@@ -28860,7 +28908,7 @@ var package_default = {
28860
28908
  }
28861
28909
  },
28862
28910
  bin: {
28863
- "supacloud-cli": "dist/index.js"
28911
+ supacloud: "dist/index.js"
28864
28912
  },
28865
28913
  files: [
28866
28914
  "NOTICE",
@@ -28894,7 +28942,7 @@ var package_default = {
28894
28942
  directory: "packages/cli"
28895
28943
  },
28896
28944
  dependencies: {
28897
- "@supacloud/compiler": "^0.43.0",
28945
+ "@supacloud/compiler": "^0.44.0",
28898
28946
  "@supacloud/delivery": "0.14.0",
28899
28947
  "@supacloud/db": "0.16.0",
28900
28948
  typebox: "1.3.34"
@@ -28914,7 +28962,7 @@ var package_default = {
28914
28962
  };
28915
28963
 
28916
28964
  // src/index.ts
28917
- var commandName = "supacloud-cli";
28965
+ var commandName = "supacloud";
28918
28966
  var preferredCommand = commandName;
28919
28967
  var projectActionSchema = stringEnum([
28920
28968
  "get",
@@ -29069,7 +29117,7 @@ function printHelp(context) {
29069
29117
  const autoLink = context.inferredSupabaseUrl ? `Project context: ${context.inferredSupabaseUrl} (${context.source})` : "Project context: not detected";
29070
29118
  console.error(`
29071
29119
  ╔═══════════════════════════════════════════════════════════╗
29072
- ║ supacloud-cli ║
29120
+ ║ supacloud ║
29073
29121
  ║ Project CLI for SupaCloud users ║
29074
29122
  ╚═══════════════════════════════════════════════════════════╝
29075
29123
 
@@ -29111,6 +29159,8 @@ EXAMPLES
29111
29159
 
29112
29160
  ${preferredCommand} status
29113
29161
  ${preferredCommand} deploy
29162
+ ${preferredCommand} --env test deploy
29163
+ ${preferredCommand} --env production deploy --confirm-production <project-ref>
29114
29164
  ${preferredCommand} deploy --target web
29115
29165
  ${preferredCommand} deploy --target api
29116
29166
  ${preferredCommand} dev sync --env test --target functions --function api
@@ -29377,7 +29427,7 @@ function createCliTools(context, confirmProduction) {
29377
29427
  "Provide one of these sources:",
29378
29428
  "",
29379
29429
  " 1. Named environment file",
29380
- " supacloud-cli --env test status",
29430
+ " supacloud --env test status",
29381
29431
  "",
29382
29432
  " 2. Explicit environment variables",
29383
29433
  " SUPACLOUD_API_URL=https://your-project.example.com",
@@ -29455,6 +29505,17 @@ function createCliTools(context, confirmProduction) {
29455
29505
  projectRef: context.projectRef || undefined,
29456
29506
  cwd: process.cwd(),
29457
29507
  environmentVariables: context.environmentVariables,
29508
+ application: context.applicationId ? {
29509
+ id: context.applicationId,
29510
+ environmentId: context.applicationEnvironmentId,
29511
+ ...context.applicationConfigurationPath ? { configurationPath: context.applicationConfigurationPath } : {},
29512
+ ...context.applicationConfigurationId ? { configurationId: context.applicationConfigurationId } : {},
29513
+ ...context.applicationManifestPath ? { manifestPath: context.applicationManifestPath } : {}
29514
+ } : undefined,
29515
+ applicationRelease: (args) => tools.app ? tools.app.callback(args) : Promise.resolve({
29516
+ isError: true,
29517
+ content: [{ type: "text", text: "Application release support is unavailable in this CLI context" }]
29518
+ }),
29458
29519
  edgeFunctionDeploy: advancedTools.edge_functions?.callback
29459
29520
  })));
29460
29521
  assign(captureTools((server) => registerGatewayTools(server, http, {
@@ -29478,7 +29539,7 @@ async function main() {
29478
29539
  }
29479
29540
  const globalOptions = parseGlobalOptions(rawArgs);
29480
29541
  const args = globalOptions.args;
29481
- const contextDirectory = args[0] === "deploy" ? await findDeployConfigRoot(process.cwd()) : process.cwd();
29542
+ const contextDirectory = args[0] === "deploy" ? await findDeployConfigRoot(process.cwd(), globalOptions.environmentName) : process.cwd();
29482
29543
  const context = resolveSupaCloudContext(process.env, contextDirectory, {
29483
29544
  environmentName: globalOptions.environmentName,
29484
29545
  envFile: globalOptions.envFile
@@ -22,6 +22,11 @@ export interface ResolvedContext {
22
22
  source: ContextSourceKind;
23
23
  sourcePath: string | null;
24
24
  environmentVariables: Readonly<Record<string, string>>;
25
+ applicationId: string;
26
+ applicationEnvironmentId: string;
27
+ applicationConfigurationPath: string;
28
+ applicationConfigurationId: string;
29
+ applicationManifestPath: string;
25
30
  insecureTls: boolean;
26
31
  }
27
32
  export declare function resolveSupaCloudContext(env?: NodeJS.ProcessEnv, cwd?: string, selection?: ContextSelection): ResolvedContext;
@@ -1,5 +1,5 @@
1
1
  import { type ToolServer } from "../tool-server";
2
- declare const SKILL_NAME = "supacloud-cli";
2
+ declare const SKILL_NAME = "supacloud";
3
3
  type InstallMode = "dry-run" | "write";
4
4
  type ConflictPolicy = "reject" | "replace";
5
5
  type InstallAction = "create" | "replace" | "none";
@@ -6,6 +6,14 @@ interface DeployToolOptions {
6
6
  environment?: string | null;
7
7
  cwd?: string;
8
8
  environmentVariables?: Readonly<Record<string, string>>;
9
+ application?: {
10
+ id: string;
11
+ environmentId: string;
12
+ configurationPath?: string;
13
+ configurationId?: string;
14
+ manifestPath?: string;
15
+ };
16
+ applicationRelease?: (args: Record<string, unknown>) => Promise<ToolResponse>;
9
17
  edgeFunctionDeploy?: (args: Record<string, unknown>) => Promise<ToolResponse>;
10
18
  }
11
19
  interface ToolResponse {
@@ -28,7 +36,7 @@ export declare const deployToolSchema: {
28
36
  diff: Type.TOptional<Type.TBoolean>;
29
37
  json: Type.TOptional<Type.TBoolean>;
30
38
  };
31
- export declare function findDeployConfigRoot(startDirectory: string): Promise<string>;
39
+ export declare function findDeployConfigRoot(startDirectory: string, environmentName?: string): Promise<string>;
32
40
  export declare function createBuildEnvironment(names: string[] | undefined, environmentVariables: Readonly<Record<string, string>> | undefined): {
33
41
  env: NodeJS.ProcessEnv;
34
42
  names: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "bin": {
21
- "supacloud-cli": "dist/index.js"
21
+ "supacloud": "dist/index.js"
22
22
  },
23
23
  "files": [
24
24
  "NOTICE",
@@ -52,7 +52,7 @@
52
52
  "directory": "packages/cli"
53
53
  },
54
54
  "dependencies": {
55
- "@supacloud/compiler": "^0.43.0",
55
+ "@supacloud/compiler": "^0.44.0",
56
56
  "@supacloud/delivery": "0.14.0",
57
57
  "@supacloud/db": "0.16.0",
58
58
  "typebox": "1.3.34"
@@ -1,11 +1,11 @@
1
1
  ---
2
- name: supacloud-cli
3
- description: Use when operating, implementing, diagnosing, deploying, or documenting a SupaCloud project through supacloud-cli, especially project endpoint discovery, database schema, functions/RPC, triggers, RLS, indexes, grants, extensions, migrations, backups, auth, storage, Edge Functions, frontend, queues, task events, diagnostics, or gateway work. Also use when an AI might otherwise call SQL, psql, a database API, or the Management API directly.
2
+ name: supacloud
3
+ description: Use when operating, implementing, diagnosing, deploying, or documenting a SupaCloud project through supacloud, especially project endpoint discovery, database schema, functions/RPC, triggers, RLS, indexes, grants, extensions, migrations, backups, auth, storage, Edge Functions, frontend, queues, task events, diagnostics, or gateway work. Also use when an AI might otherwise call SQL, psql, a database API, or the Management API directly.
4
4
  ---
5
5
 
6
6
  # SupaCloud CLI
7
7
 
8
- Use `supacloud-cli` as the project-level control surface and keep durable changes reproducible from version-controlled files. Use `supacloud-admin` only for server/platform operations.
8
+ Use `supacloud` as the project-level control surface and keep durable changes reproducible from version-controlled files. Use `supacloud-admin` only for server/platform operations.
9
9
 
10
10
  ## Non-negotiable rules
11
11
 
@@ -13,7 +13,7 @@ Use `supacloud-cli` as the project-level control surface and keep durable change
13
13
 
14
14
  ```bash
15
15
  git status --short --branch
16
- supacloud-cli status
16
+ supacloud status
17
17
  ```
18
18
 
19
19
  A missing remote project context does not block local `migration_new`, `db_diff`, or `db_reset`; it blocks remote inspection/apply until context is supplied.
@@ -24,7 +24,7 @@ Use `supacloud-cli` as the project-level control surface and keep durable change
24
24
  5. Run a remote migration dry-run before apply. Production apply requires explicit user approval in the current task.
25
25
  6. Do not edit `supabase_migrations.schema_migrations` through ordinary SQL. Migration history is an application ledger, not a schema backup or source of truth. For a proven-equivalent historical baseline, use the controlled `database baseline_migrations` action with dry-run and explicit approval.
26
26
  7. Service-role credentials authenticate the SupaCloud Management API. Never reinterpret them as PostgreSQL passwords or forward them to the official Supabase CLI.
27
- 8. Read project domains through `supacloud-cli project endpoints`. Do not infer API, Auth, or Studio origins by concatenating project refs and base domains. The projection reports configuration, not DNS/certificate/runtime readiness.
27
+ 8. Read project domains through `supacloud project endpoints`. Do not infer API, Auth, or Studio origins by concatenating project refs and base domains. The projection reports configuration, not DNS/certificate/runtime readiness.
28
28
  9. Cross-project enumeration is an Admin boundary. Use `supacloud-admin project list` or `supacloud-admin project list_endpoints`; do not attempt to widen project credentials.
29
29
 
30
30
  ## Workflow
@@ -34,8 +34,8 @@ Use `supacloud-cli` as the project-level control surface and keep durable change
34
34
  3. For AI-assisted database changes, first request bounded context:
35
35
 
36
36
  ```bash
37
- supacloud-cli db context --module_file db/modules.ts --module <module>
38
- supacloud-cli db context --module_file db/modules.ts --target <object>
37
+ supacloud db context --module_file db/modules.ts --module <module>
38
+ supacloud db context --module_file db/modules.ts --target <object>
39
39
  ```
40
40
 
41
41
  Use the returned source/test paths and ownership boundary; do not scan or
@@ -52,8 +52,8 @@ Use `supacloud-cli` as the project-level control surface and keep durable change
52
52
  For the selected project:
53
53
 
54
54
  ```bash
55
- supacloud-cli status
56
- supacloud-cli project endpoints
55
+ supacloud status
56
+ supacloud project endpoints
57
57
  ```
58
58
 
59
59
  The fixed projection contains credential-free API/Auth/Studio origins, hosts,
@@ -66,18 +66,18 @@ ready. Project-wide or fleet-wide inventories belong to `supacloud-admin`.
66
66
  For a new database change:
67
67
 
68
68
  ```bash
69
- supacloud-cli supabase migration_new --name add_accounts
69
+ supacloud supabase migration_new --name add_accounts
70
70
  # Edit the generated SQL migration.
71
- supacloud-cli supabase db_reset --no_seed
72
- supacloud-cli supabase push --ref <project-ref> --dir supabase/migrations --dry_run
71
+ supacloud supabase db_reset --no_seed
72
+ supacloud supabase push --ref <project-ref> --dir supabase/migrations --dry_run
73
73
  # Apply only after explicit approval.
74
- supacloud-cli supabase push --ref <project-ref> --dir supabase/migrations
74
+ supacloud supabase push --ref <project-ref> --dir supabase/migrations
75
75
  ```
76
76
 
77
77
  Use `db_diff` as an authoring aid, not as permission to bypass review:
78
78
 
79
79
  ```bash
80
- supacloud-cli supabase db_diff --schema public --name reconcile_public_schema
80
+ supacloud supabase db_diff --schema public --name reconcile_public_schema
81
81
  ```
82
82
 
83
83
  For existing declarative SQL projects, `supabase db_schema_declarative_sync`
@@ -91,7 +91,7 @@ an existing Docker workflow. Lite drift pull writes drafts by default; only use
91
91
  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:
92
92
 
93
93
  ```bash
94
- supacloud-cli database baseline_migrations \
94
+ supacloud database baseline_migrations \
95
95
  --ref <project-ref> \
96
96
  --dir supabase/migrations \
97
97
  --dry_run
@@ -99,9 +99,9 @@ supacloud-cli database baseline_migrations \
99
99
 
100
100
  ## CLI boundaries
101
101
 
102
- - `supacloud-cli`: selected-project status and endpoint projection, database, migrations, auth, storage, Edge Functions, frontend, queues, task events, diagnostics, and project gateway configuration.
102
+ - `supacloud`: selected-project status and endpoint projection, database, migrations, auth, storage, Edge Functions, frontend, queues, task events, diagnostics, and project gateway configuration.
103
103
  - `supacloud-admin`: installation, upgrades, SSH diagnostics, platform-wide project/endpoint inventory, project lifecycle, tenant runtime, and server operations.
104
- - Official `supabase` CLI: invoked only through the allowlisted `supacloud-cli supabase` adapter for supported local authoring or explicit-DSN inspection commands.
104
+ - Official `supabase` CLI: invoked only through the allowlisted `supacloud supabase` adapter for supported local authoring or explicit-DSN inspection commands.
105
105
  - Direct HTTP/SQL: read-only diagnosis or an explicitly approved break-glass path; never the default implementation path.
106
106
 
107
107
  ## Completion evidence
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "SupaCloud CLI"
3
+ short_description: "安全使用 SupaCloud CLI 与数据库迁移"
4
+ default_prompt: "Use $supacloud to manage this SupaCloud project through migrations and safe CLI workflows."
@@ -6,8 +6,8 @@ Load this reference when selecting a command surface or when a user asks an AI t
6
6
 
7
7
  | Intent | Use | Guardrail |
8
8
  | --- | --- | --- |
9
- | Inspect current project binding | `supacloud-cli status` | Read-only; run first |
10
- | Inspect selected project API/Auth/Studio origins | `supacloud-cli project endpoints` | Uses the Management API's authoritative projection; do not reconstruct domains locally |
9
+ | Inspect current project binding | `supacloud status` | Read-only; run first |
10
+ | Inspect selected project API/Auth/Studio origins | `supacloud project endpoints` | Uses the Management API's authoritative projection; do not reconstruct domains locally |
11
11
  | Enumerate projects or endpoint projections | `supacloud-admin project list` / `project list_endpoints` | Platform-wide read; never promote a project credential to Admin authority |
12
12
  | Inspect project health/logs/tasks | `project`, `queue`, `task_events`, `diagnostics` | Prefer bounded reads |
13
13
  | Read database rows or metadata | `database query` and database inspection actions | `SELECT`/read-only by default |
@@ -57,11 +57,11 @@ until a project-scoped context is resolved.
57
57
  ## Safe inspection pattern
58
58
 
59
59
  ```bash
60
- supacloud-cli status
61
- supacloud-cli project get
62
- supacloud-cli project endpoints
63
- supacloud-cli project health
64
- supacloud-cli supabase migration_list --db_url "$SUPACLOUD_DB_URL"
60
+ supacloud status
61
+ supacloud project get
62
+ supacloud project endpoints
63
+ supacloud project health
64
+ supacloud supabase migration_list --db_url "$SUPACLOUD_DB_URL"
65
65
  ```
66
66
 
67
67
  The endpoint projection returns bounded, credential-free API/Auth/Studio origins,
@@ -8,7 +8,7 @@ Migration files are the durable source of truth. `supabase_migrations.schema_mig
8
8
  2. Create a migration:
9
9
 
10
10
  ```bash
11
- supacloud-cli supabase migration_new --name <intent>
11
+ supacloud supabase migration_new --name <intent>
12
12
  ```
13
13
 
14
14
  3. Put tables, views, functions/RPC, triggers, RLS, indexes, grants, extensions, and required reference data in the generated SQL file.
@@ -21,13 +21,13 @@ Migration files are the durable source of truth. `supabase_migrations.schema_mig
21
21
  5. Rebuild locally and run application tests:
22
22
 
23
23
  ```bash
24
- supacloud-cli supabase db_reset --no_seed
24
+ supacloud supabase db_reset --no_seed
25
25
  ```
26
26
 
27
27
  6. Preview remote application:
28
28
 
29
29
  ```bash
30
- supacloud-cli supabase push --ref <project-ref> --dir supabase/migrations --dry_run
30
+ supacloud supabase push --ref <project-ref> --dir supabase/migrations --dry_run
31
31
  ```
32
32
 
33
33
  7. After explicit environment approval, apply and read back migration history.
@@ -38,7 +38,7 @@ Preserve the repository's existing schema authority. In a project already using
38
38
  declarative SQL, edit those files and run:
39
39
 
40
40
  ```bash
41
- supacloud-cli supabase db_schema_declarative_sync --name <intent> --strict_coverage
41
+ supacloud supabase db_schema_declarative_sync --name <intent> --strict_coverage
42
42
  ```
43
43
 
44
44
  The adapter defaults to no-apply. Review the generated migration, then use the
@@ -64,7 +64,7 @@ Do not fabricate old migration files and immediately push them. Reconcile delibe
64
64
  3. Create a schema-only backup before changing tracking or schema:
65
65
 
66
66
  ```bash
67
- supacloud-cli supabase db_dump \
67
+ supacloud supabase db_dump \
68
68
  --db_url "$SUPACLOUD_DB_URL" \
69
69
  --file backups/pre-reconcile-schema.sql
70
70
  ```
@@ -72,7 +72,7 @@ Do not fabricate old migration files and immediately push them. Reconcile delibe
72
72
  4. In an isolated branch/worktree, pull the actual remote schema:
73
73
 
74
74
  ```bash
75
- supacloud-cli supabase db_pull \
75
+ supacloud supabase db_pull \
76
76
  --db_url "$SUPACLOUD_DB_URL" \
77
77
  --declarative \
78
78
  --name remote_baseline
@@ -86,7 +86,7 @@ Do not fabricate old migration files and immediately push them. Reconcile delibe
86
86
  8. Only after equivalence is proven, preview the controlled baseline action:
87
87
 
88
88
  ```bash
89
- supacloud-cli database baseline_migrations \
89
+ supacloud database baseline_migrations \
90
90
  --ref <project-ref> \
91
91
  --dir supabase/migrations \
92
92
  --dry_run
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "SupaCloud CLI"
3
- short_description: "安全使用 SupaCloud CLI 与数据库迁移"
4
- default_prompt: "Use $supacloud-cli to manage this SupaCloud project through migrations and safe CLI workflows."