powersync 0.9.6 → 0.10.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.
Files changed (34) hide show
  1. package/README.md +84 -144
  2. package/dist/api/cloud/validate-cloud-link-config.d.ts +12 -8
  3. package/dist/api/cloud/validate-cloud-link-config.js +14 -22
  4. package/dist/api/cloud/validate-cloud-link-config.js.map +1 -1
  5. package/dist/api/validations/cloud-validations.js +2 -2
  6. package/dist/api/validations/cloud-validations.js.map +1 -1
  7. package/dist/api/validations/self-hosted-validations.js +2 -2
  8. package/dist/api/validations/self-hosted-validations.js.map +1 -1
  9. package/dist/api/validations/validation-utils.d.ts +3 -13
  10. package/dist/api/validations/validation-utils.js +2 -73
  11. package/dist/api/validations/validation-utils.js.map +1 -1
  12. package/dist/api/validations/validations.d.ts +2 -6
  13. package/dist/api/validations/validations.js +31 -51
  14. package/dist/api/validations/validations.js.map +1 -1
  15. package/dist/commands/deploy/index.js +1 -4
  16. package/dist/commands/deploy/index.js.map +1 -1
  17. package/dist/commands/deploy/service-config.js +1 -4
  18. package/dist/commands/deploy/service-config.js.map +1 -1
  19. package/dist/commands/deploy/sync-config.js +1 -4
  20. package/dist/commands/deploy/sync-config.js.map +1 -1
  21. package/dist/commands/fetch/status.js +1 -1
  22. package/dist/commands/fetch/status.js.map +1 -1
  23. package/dist/commands/generate/schema.js +1 -1
  24. package/dist/commands/generate/schema.js.map +1 -1
  25. package/dist/commands/init/cloud.js +1 -1
  26. package/dist/commands/init/cloud.js.map +1 -1
  27. package/dist/commands/link/cloud.js +33 -22
  28. package/dist/commands/link/cloud.js.map +1 -1
  29. package/dist/commands/pull/index.js +1 -1
  30. package/dist/commands/pull/index.js.map +1 -1
  31. package/dist/commands/pull/instance.js +57 -34
  32. package/dist/commands/pull/instance.js.map +1 -1
  33. package/oclif.manifest.json +451 -382
  34. package/package.json +10 -10
@@ -20,9 +20,6 @@
20
20
  "type": "option"
21
21
  },
22
22
  "instance-id": {
23
- "dependsOn": [
24
- "project-id"
25
- ],
26
23
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
27
24
  "helpGroup": "CLOUD_PROJECT",
28
25
  "name": "instance-id",
@@ -32,8 +29,12 @@
32
29
  "type": "option"
33
30
  },
34
31
  "org-id": {
35
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
32
+ "deprecated": {
33
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
34
+ },
35
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
36
36
  "helpGroup": "CLOUD_PROJECT",
37
+ "hidden": true,
37
38
  "name": "org-id",
38
39
  "required": false,
39
40
  "hasDynamicHelp": false,
@@ -41,8 +42,12 @@
41
42
  "type": "option"
42
43
  },
43
44
  "project-id": {
44
- "description": "Project ID. Manually passed if the current context has not been linked.",
45
+ "deprecated": {
46
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
47
+ },
48
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
45
49
  "helpGroup": "CLOUD_PROJECT",
50
+ "hidden": true,
46
51
  "name": "project-id",
47
52
  "required": false,
48
53
  "hasDynamicHelp": false,
@@ -94,9 +99,6 @@
94
99
  "type": "option"
95
100
  },
96
101
  "instance-id": {
97
- "dependsOn": [
98
- "project-id"
99
- ],
100
102
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
101
103
  "helpGroup": "CLOUD_PROJECT",
102
104
  "name": "instance-id",
@@ -106,8 +108,12 @@
106
108
  "type": "option"
107
109
  },
108
110
  "org-id": {
109
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
111
+ "deprecated": {
112
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
113
+ },
114
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
110
115
  "helpGroup": "CLOUD_PROJECT",
116
+ "hidden": true,
111
117
  "name": "org-id",
112
118
  "required": false,
113
119
  "hasDynamicHelp": false,
@@ -115,8 +121,12 @@
115
121
  "type": "option"
116
122
  },
117
123
  "project-id": {
118
- "description": "Project ID. Manually passed if the current context has not been linked.",
124
+ "deprecated": {
125
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
126
+ },
127
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
119
128
  "helpGroup": "CLOUD_PROJECT",
129
+ "hidden": true,
120
130
  "name": "project-id",
121
131
  "required": false,
122
132
  "hasDynamicHelp": false,
@@ -208,7 +218,7 @@
208
218
  "examples": [
209
219
  "<%= config.bin %> <%= command.id %>",
210
220
  "<%= config.bin %> <%= command.id %> --output=json",
211
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
221
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>"
212
222
  ],
213
223
  "flags": {
214
224
  "api-url": {
@@ -226,9 +236,6 @@
226
236
  "type": "option"
227
237
  },
228
238
  "instance-id": {
229
- "dependsOn": [
230
- "project-id"
231
- ],
232
239
  "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
233
240
  "helpGroup": "CLOUD_PROJECT",
234
241
  "name": "instance-id",
@@ -238,8 +245,12 @@
238
245
  "type": "option"
239
246
  },
240
247
  "org-id": {
241
- "description": "[Cloud] Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.",
248
+ "deprecated": {
249
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
250
+ },
251
+ "description": "[Cloud] [Deprecated] Organization ID. Automatically resolved from --instance-id.",
242
252
  "helpGroup": "CLOUD_PROJECT",
253
+ "hidden": true,
243
254
  "name": "org-id",
244
255
  "required": false,
245
256
  "hasDynamicHelp": false,
@@ -247,8 +258,12 @@
247
258
  "type": "option"
248
259
  },
249
260
  "project-id": {
250
- "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
261
+ "deprecated": {
262
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
263
+ },
264
+ "description": "[Cloud] [Deprecated] Project ID. Automatically resolved from --instance-id.",
251
265
  "helpGroup": "CLOUD_PROJECT",
266
+ "hidden": true,
252
267
  "name": "project-id",
253
268
  "required": false,
254
269
  "hasDynamicHelp": false,
@@ -314,9 +329,6 @@
314
329
  "type": "option"
315
330
  },
316
331
  "instance-id": {
317
- "dependsOn": [
318
- "project-id"
319
- ],
320
332
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
321
333
  "helpGroup": "CLOUD_PROJECT",
322
334
  "name": "instance-id",
@@ -326,8 +338,12 @@
326
338
  "type": "option"
327
339
  },
328
340
  "org-id": {
329
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
341
+ "deprecated": {
342
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
343
+ },
344
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
330
345
  "helpGroup": "CLOUD_PROJECT",
346
+ "hidden": true,
331
347
  "name": "org-id",
332
348
  "required": false,
333
349
  "hasDynamicHelp": false,
@@ -335,8 +351,12 @@
335
351
  "type": "option"
336
352
  },
337
353
  "project-id": {
338
- "description": "Project ID. Manually passed if the current context has not been linked.",
354
+ "deprecated": {
355
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
356
+ },
357
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
339
358
  "helpGroup": "CLOUD_PROJECT",
359
+ "hidden": true,
340
360
  "name": "project-id",
341
361
  "required": false,
342
362
  "hasDynamicHelp": false,
@@ -396,9 +416,6 @@
396
416
  "type": "option"
397
417
  },
398
418
  "instance-id": {
399
- "dependsOn": [
400
- "project-id"
401
- ],
402
419
  "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
403
420
  "helpGroup": "CLOUD_PROJECT",
404
421
  "name": "instance-id",
@@ -408,8 +425,12 @@
408
425
  "type": "option"
409
426
  },
410
427
  "org-id": {
411
- "description": "[Cloud] Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.",
428
+ "deprecated": {
429
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
430
+ },
431
+ "description": "[Cloud] [Deprecated] Organization ID. Automatically resolved from --instance-id.",
412
432
  "helpGroup": "CLOUD_PROJECT",
433
+ "hidden": true,
413
434
  "name": "org-id",
414
435
  "required": false,
415
436
  "hasDynamicHelp": false,
@@ -417,8 +438,12 @@
417
438
  "type": "option"
418
439
  },
419
440
  "project-id": {
420
- "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
441
+ "deprecated": {
442
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
443
+ },
444
+ "description": "[Cloud] [Deprecated] Project ID. Automatically resolved from --instance-id.",
421
445
  "helpGroup": "CLOUD_PROJECT",
446
+ "hidden": true,
422
447
  "name": "project-id",
423
448
  "required": false,
424
449
  "hasDynamicHelp": false,
@@ -551,7 +576,7 @@
551
576
  "description": "Deploy local config (service.yaml, sync config) to the linked PowerSync Cloud instance.\nValidates connections and sync config before deploying.\nSee also powersync deploy sync-config to deploy only sync config changes.\nSee also powersync deploy service-config to deploy only service config changes.",
552
577
  "examples": [
553
578
  "<%= config.bin %> <%= command.id %>",
554
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
579
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>"
555
580
  ],
556
581
  "flags": {
557
582
  "deploy-timeout": {
@@ -572,9 +597,6 @@
572
597
  "type": "option"
573
598
  },
574
599
  "instance-id": {
575
- "dependsOn": [
576
- "project-id"
577
- ],
578
600
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
579
601
  "helpGroup": "CLOUD_PROJECT",
580
602
  "name": "instance-id",
@@ -584,8 +606,12 @@
584
606
  "type": "option"
585
607
  },
586
608
  "org-id": {
587
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
609
+ "deprecated": {
610
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
611
+ },
612
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
588
613
  "helpGroup": "CLOUD_PROJECT",
614
+ "hidden": true,
589
615
  "name": "org-id",
590
616
  "required": false,
591
617
  "hasDynamicHelp": false,
@@ -593,8 +619,12 @@
593
619
  "type": "option"
594
620
  },
595
621
  "project-id": {
596
- "description": "Project ID. Manually passed if the current context has not been linked.",
622
+ "deprecated": {
623
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
624
+ },
625
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
597
626
  "helpGroup": "CLOUD_PROJECT",
627
+ "hidden": true,
598
628
  "name": "project-id",
599
629
  "required": false,
600
630
  "hasDynamicHelp": false,
@@ -654,7 +684,7 @@
654
684
  "description": "Deploy only service config changes (without sync config updates).",
655
685
  "examples": [
656
686
  "<%= config.bin %> <%= command.id %>",
657
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
687
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>"
658
688
  ],
659
689
  "flags": {
660
690
  "deploy-timeout": {
@@ -675,9 +705,6 @@
675
705
  "type": "option"
676
706
  },
677
707
  "instance-id": {
678
- "dependsOn": [
679
- "project-id"
680
- ],
681
708
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
682
709
  "helpGroup": "CLOUD_PROJECT",
683
710
  "name": "instance-id",
@@ -687,8 +714,12 @@
687
714
  "type": "option"
688
715
  },
689
716
  "org-id": {
690
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
717
+ "deprecated": {
718
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
719
+ },
720
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
691
721
  "helpGroup": "CLOUD_PROJECT",
722
+ "hidden": true,
692
723
  "name": "org-id",
693
724
  "required": false,
694
725
  "hasDynamicHelp": false,
@@ -696,8 +727,12 @@
696
727
  "type": "option"
697
728
  },
698
729
  "project-id": {
699
- "description": "Project ID. Manually passed if the current context has not been linked.",
730
+ "deprecated": {
731
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
732
+ },
733
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
700
734
  "helpGroup": "CLOUD_PROJECT",
735
+ "hidden": true,
701
736
  "name": "project-id",
702
737
  "required": false,
703
738
  "hasDynamicHelp": false,
@@ -749,7 +784,7 @@
749
784
  "description": "Deploy only sync config changes.",
750
785
  "examples": [
751
786
  "<%= config.bin %> <%= command.id %>",
752
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
787
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>"
753
788
  ],
754
789
  "flags": {
755
790
  "deploy-timeout": {
@@ -770,9 +805,6 @@
770
805
  "type": "option"
771
806
  },
772
807
  "instance-id": {
773
- "dependsOn": [
774
- "project-id"
775
- ],
776
808
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
777
809
  "helpGroup": "CLOUD_PROJECT",
778
810
  "name": "instance-id",
@@ -782,8 +814,12 @@
782
814
  "type": "option"
783
815
  },
784
816
  "org-id": {
785
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
817
+ "deprecated": {
818
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
819
+ },
820
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
786
821
  "helpGroup": "CLOUD_PROJECT",
822
+ "hidden": true,
787
823
  "name": "org-id",
788
824
  "required": false,
789
825
  "hasDynamicHelp": false,
@@ -791,8 +827,12 @@
791
827
  "type": "option"
792
828
  },
793
829
  "project-id": {
794
- "description": "Project ID. Manually passed if the current context has not been linked.",
830
+ "deprecated": {
831
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
832
+ },
833
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
795
834
  "helpGroup": "CLOUD_PROJECT",
835
+ "hidden": true,
796
836
  "name": "project-id",
797
837
  "required": false,
798
838
  "hasDynamicHelp": false,
@@ -836,89 +876,10 @@
836
876
  "sync-config.js"
837
877
  ]
838
878
  },
839
- "fetch:config": {
840
- "aliases": [],
841
- "args": {},
842
- "description": "Retrieve the current instance config from PowerSync Cloud and print as YAML or JSON.",
843
- "examples": [
844
- "<%= config.bin %> <%= command.id %>",
845
- "<%= config.bin %> <%= command.id %> --output=json"
846
- ],
847
- "flags": {
848
- "directory": {
849
- "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
850
- "helpGroup": "PROJECT",
851
- "name": "directory",
852
- "default": "powersync",
853
- "hasDynamicHelp": false,
854
- "multiple": false,
855
- "type": "option"
856
- },
857
- "instance-id": {
858
- "dependsOn": [
859
- "project-id"
860
- ],
861
- "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
862
- "helpGroup": "CLOUD_PROJECT",
863
- "name": "instance-id",
864
- "required": false,
865
- "hasDynamicHelp": false,
866
- "multiple": false,
867
- "type": "option"
868
- },
869
- "org-id": {
870
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
871
- "helpGroup": "CLOUD_PROJECT",
872
- "name": "org-id",
873
- "required": false,
874
- "hasDynamicHelp": false,
875
- "multiple": false,
876
- "type": "option"
877
- },
878
- "project-id": {
879
- "description": "Project ID. Manually passed if the current context has not been linked.",
880
- "helpGroup": "CLOUD_PROJECT",
881
- "name": "project-id",
882
- "required": false,
883
- "hasDynamicHelp": false,
884
- "multiple": false,
885
- "type": "option"
886
- },
887
- "output": {
888
- "description": "Output format: yaml or json.",
889
- "name": "output",
890
- "default": "yaml",
891
- "hasDynamicHelp": false,
892
- "multiple": false,
893
- "options": [
894
- "json",
895
- "yaml"
896
- ],
897
- "type": "option"
898
- }
899
- },
900
- "hasDynamicHelp": false,
901
- "hiddenAliases": [],
902
- "id": "fetch:config",
903
- "pluginAlias": "powersync",
904
- "pluginName": "powersync",
905
- "pluginType": "core",
906
- "strict": true,
907
- "summary": "[Cloud only] Print linked Cloud instance config (YAML or JSON).",
908
- "enableJsonFlag": false,
909
- "commandHelpGroup": "CLOUD",
910
- "isESM": true,
911
- "relativePath": [
912
- "dist",
913
- "commands",
914
- "fetch",
915
- "config.js"
916
- ]
917
- },
918
- "fetch": {
879
+ "generate": {
919
880
  "aliases": [],
920
881
  "args": {},
921
- "description": "Subcommands: list Cloud instances in org/project (fetch instances), print instance config as YAML/JSON (fetch config), or show instance diagnostics (fetch status).",
882
+ "description": "Generate client artifacts: schema (from instance schema + sync config) or a development token for connecting clients. Cloud and self-hosted where supported.",
922
883
  "examples": [
923
884
  "<%= config.bin %> <%= command.id %>"
924
885
  ],
@@ -926,93 +887,28 @@
926
887
  "hasDynamicHelp": false,
927
888
  "hidden": true,
928
889
  "hiddenAliases": [],
929
- "id": "fetch",
890
+ "id": "generate",
930
891
  "pluginAlias": "powersync",
931
892
  "pluginName": "powersync",
932
893
  "pluginType": "core",
933
894
  "strict": true,
934
- "summary": "List instances, fetch config, or fetch instance diagnostics.",
895
+ "summary": "Generate client schema or development token.",
935
896
  "enableJsonFlag": false,
936
897
  "isESM": true,
937
898
  "relativePath": [
938
899
  "dist",
939
900
  "commands",
940
- "fetch",
901
+ "generate",
941
902
  "index.js"
942
903
  ]
943
904
  },
944
- "fetch:instances": {
945
- "aliases": [],
946
- "args": {},
947
- "description": "List PowerSync Cloud and linked instances, Cloud instances are grouped by organization and project.",
948
- "examples": [
949
- "<%= config.bin %> <%= command.id %>",
950
- "<%= config.bin %> <%= command.id %> --project-id=<id> --output=json"
951
- ],
952
- "flags": {
953
- "org-id": {
954
- "description": "Optional Organization ID. Defaults to all organizations.",
955
- "name": "org-id",
956
- "required": false,
957
- "hasDynamicHelp": false,
958
- "multiple": false,
959
- "type": "option"
960
- },
961
- "output": {
962
- "description": "Output format: human or json.",
963
- "name": "output",
964
- "default": "human",
965
- "hasDynamicHelp": false,
966
- "multiple": false,
967
- "options": [
968
- "human",
969
- "json"
970
- ],
971
- "type": "option"
972
- },
973
- "output-file": {
974
- "description": "Optionally write instance information to a file.",
975
- "name": "output-file",
976
- "required": false,
977
- "hasDynamicHelp": false,
978
- "multiple": false,
979
- "type": "option"
980
- },
981
- "project-id": {
982
- "description": "Optional Project ID. Defaults to all projects in the org.",
983
- "name": "project-id",
984
- "required": false,
985
- "hasDynamicHelp": false,
986
- "multiple": false,
987
- "type": "option"
988
- }
989
- },
990
- "hasDynamicHelp": false,
991
- "hiddenAliases": [],
992
- "id": "fetch:instances",
993
- "pluginAlias": "powersync",
994
- "pluginName": "powersync",
995
- "pluginType": "core",
996
- "strict": true,
997
- "summary": "List Cloud and linked instances.",
998
- "enableJsonFlag": false,
999
- "commandHelpGroup": "CLOUD",
1000
- "isESM": true,
1001
- "relativePath": [
1002
- "dist",
1003
- "commands",
1004
- "fetch",
1005
- "instances.js"
1006
- ]
1007
- },
1008
- "fetch:status": {
905
+ "generate:schema": {
1009
906
  "aliases": [],
1010
907
  "args": {},
1011
- "description": "Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as human-readable, JSON, or YAML. Cloud and self-hosted.",
908
+ "description": "Generate a client-side schema file from the instance database schema and sync config. Supports multiple output types (e.g. type, dart). Requires a linked instance. Cloud and self-hosted.",
1012
909
  "examples": [
1013
- "<%= config.bin %> <%= command.id %>",
1014
- "<%= config.bin %> <%= command.id %> --output=json",
1015
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
910
+ "<%= config.bin %> <%= command.id %> --output=ts --output-path=schema.ts",
911
+ "<%= config.bin %> <%= command.id %> --output=dart --output-path=lib/schema.dart --instance-id=<id>"
1016
912
  ],
1017
913
  "flags": {
1018
914
  "api-url": {
@@ -1030,9 +926,6 @@
1030
926
  "type": "option"
1031
927
  },
1032
928
  "instance-id": {
1033
- "dependsOn": [
1034
- "project-id"
1035
- ],
1036
929
  "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
1037
930
  "helpGroup": "CLOUD_PROJECT",
1038
931
  "name": "instance-id",
@@ -1042,8 +935,12 @@
1042
935
  "type": "option"
1043
936
  },
1044
937
  "org-id": {
1045
- "description": "[Cloud] Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.",
938
+ "deprecated": {
939
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
940
+ },
941
+ "description": "[Cloud] [Deprecated] Organization ID. Automatically resolved from --instance-id.",
1046
942
  "helpGroup": "CLOUD_PROJECT",
943
+ "hidden": true,
1047
944
  "name": "org-id",
1048
945
  "required": false,
1049
946
  "hasDynamicHelp": false,
@@ -1051,8 +948,12 @@
1051
948
  "type": "option"
1052
949
  },
1053
950
  "project-id": {
1054
- "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
951
+ "deprecated": {
952
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
953
+ },
954
+ "description": "[Cloud] [Deprecated] Project ID. Automatically resolved from --instance-id.",
1055
955
  "helpGroup": "CLOUD_PROJECT",
956
+ "hidden": true,
1056
957
  "name": "project-id",
1057
958
  "required": false,
1058
959
  "hasDynamicHelp": false,
@@ -1068,70 +969,67 @@
1068
969
  "multiple": false,
1069
970
  "type": "option"
1070
971
  },
972
+ "sync-config-file-path": {
973
+ "description": "[Optional] Override the path to a sync config file. When set, this file is used instead of sync-config.yaml in the project directory.",
974
+ "helpGroup": "PROJECT",
975
+ "name": "sync-config-file-path",
976
+ "hasDynamicHelp": false,
977
+ "multiple": false,
978
+ "type": "option"
979
+ },
1071
980
  "output": {
1072
- "description": "Output format: human-readable, json, or yaml.",
981
+ "description": "Output type: dart, dotNet, dotNetClass, js, jsLegacy, kotlin, swift, ts",
1073
982
  "name": "output",
1074
- "default": "human",
983
+ "required": true,
984
+ "default": "type",
1075
985
  "hasDynamicHelp": false,
1076
986
  "multiple": false,
1077
987
  "options": [
1078
- "human",
1079
- "json",
1080
- "yaml"
988
+ "dart",
989
+ "dotNet",
990
+ "dotNetClass",
991
+ "js",
992
+ "jsLegacy",
993
+ "kotlin",
994
+ "swift",
995
+ "ts"
1081
996
  ],
1082
997
  "type": "option"
998
+ },
999
+ "output-path": {
1000
+ "description": "Path to output the schema file.",
1001
+ "name": "output-path",
1002
+ "required": true,
1003
+ "hasDynamicHelp": false,
1004
+ "multiple": false,
1005
+ "type": "option"
1083
1006
  }
1084
1007
  },
1085
1008
  "hasDynamicHelp": false,
1086
1009
  "hiddenAliases": [],
1087
- "id": "fetch:status",
1010
+ "id": "generate:schema",
1088
1011
  "pluginAlias": "powersync",
1089
1012
  "pluginName": "powersync",
1090
1013
  "pluginType": "core",
1091
1014
  "strict": true,
1092
- "summary": "Show instance diagnostics (connections, sync config, replication).",
1015
+ "summary": "Generate client schema file from instance schema and sync config.",
1093
1016
  "enableJsonFlag": false,
1094
1017
  "commandHelpGroup": "INSTANCE",
1095
1018
  "isESM": true,
1096
- "relativePath": [
1097
- "dist",
1098
- "commands",
1099
- "status.js"
1100
- ]
1101
- },
1102
- "generate": {
1103
- "aliases": [],
1104
- "args": {},
1105
- "description": "Generate client artifacts: schema (from instance schema + sync config) or a development token for connecting clients. Cloud and self-hosted where supported.",
1106
- "examples": [
1107
- "<%= config.bin %> <%= command.id %>"
1108
- ],
1109
- "flags": {},
1110
- "hasDynamicHelp": false,
1111
- "hidden": true,
1112
- "hiddenAliases": [],
1113
- "id": "generate",
1114
- "pluginAlias": "powersync",
1115
- "pluginName": "powersync",
1116
- "pluginType": "core",
1117
- "strict": true,
1118
- "summary": "Generate client schema or development token.",
1119
- "enableJsonFlag": false,
1120
- "isESM": true,
1121
1019
  "relativePath": [
1122
1020
  "dist",
1123
1021
  "commands",
1124
1022
  "generate",
1125
- "index.js"
1023
+ "schema.js"
1126
1024
  ]
1127
1025
  },
1128
- "generate:schema": {
1026
+ "generate:token": {
1129
1027
  "aliases": [],
1130
1028
  "args": {},
1131
- "description": "Generate a client-side schema file from the instance database schema and sync config. Supports multiple output types (e.g. type, dart). Requires a linked instance. Cloud and self-hosted.",
1029
+ "description": "Generate a JWT for development clients to connect to PowerSync. Cloud: uses instance dev-token API (allow_temporary_tokens must be enabled). Self-hosted: signs with shared secret from config. Requires --subject; optional --expires-in-seconds.",
1132
1030
  "examples": [
1133
- "<%= config.bin %> <%= command.id %> --output=ts --output-path=schema.ts",
1134
- "<%= config.bin %> <%= command.id %> --output=dart --output-path=lib/schema.dart --instance-id=<id> --project-id=<id>"
1031
+ "<%= config.bin %> <%= command.id %> --subject=user-123",
1032
+ "<%= config.bin %> <%= command.id %> --subject=user-123 --expires-in-seconds=3600"
1135
1033
  ],
1136
1034
  "flags": {
1137
1035
  "api-url": {
@@ -1149,9 +1047,6 @@
1149
1047
  "type": "option"
1150
1048
  },
1151
1049
  "instance-id": {
1152
- "dependsOn": [
1153
- "project-id"
1154
- ],
1155
1050
  "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
1156
1051
  "helpGroup": "CLOUD_PROJECT",
1157
1052
  "name": "instance-id",
@@ -1161,8 +1056,12 @@
1161
1056
  "type": "option"
1162
1057
  },
1163
1058
  "org-id": {
1164
- "description": "[Cloud] Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.",
1059
+ "deprecated": {
1060
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
1061
+ },
1062
+ "description": "[Cloud] [Deprecated] Organization ID. Automatically resolved from --instance-id.",
1165
1063
  "helpGroup": "CLOUD_PROJECT",
1064
+ "hidden": true,
1166
1065
  "name": "org-id",
1167
1066
  "required": false,
1168
1067
  "hasDynamicHelp": false,
@@ -1170,8 +1069,12 @@
1170
1069
  "type": "option"
1171
1070
  },
1172
1071
  "project-id": {
1173
- "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
1072
+ "deprecated": {
1073
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
1074
+ },
1075
+ "description": "[Cloud] [Deprecated] Project ID. Automatically resolved from --instance-id.",
1174
1076
  "helpGroup": "CLOUD_PROJECT",
1077
+ "hidden": true,
1175
1078
  "name": "project-id",
1176
1079
  "required": false,
1177
1080
  "hasDynamicHelp": false,
@@ -1187,36 +1090,26 @@
1187
1090
  "multiple": false,
1188
1091
  "type": "option"
1189
1092
  },
1190
- "sync-config-file-path": {
1191
- "description": "[Optional] Override the path to a sync config file. When set, this file is used instead of sync-config.yaml in the project directory.",
1192
- "helpGroup": "PROJECT",
1193
- "name": "sync-config-file-path",
1093
+ "expires-in-seconds": {
1094
+ "description": "Expiration time in seconds. Default is 43,200 (12 hours).",
1095
+ "name": "expires-in-seconds",
1096
+ "required": false,
1097
+ "default": 43200,
1194
1098
  "hasDynamicHelp": false,
1195
1099
  "multiple": false,
1196
1100
  "type": "option"
1197
1101
  },
1198
- "output": {
1199
- "description": "Output type: dart, dotNet, dotNetClass, js, jsLegacy, kotlin, swift, ts",
1200
- "name": "output",
1201
- "required": true,
1202
- "default": "type",
1102
+ "kid": {
1103
+ "description": "[Self-hosted only] Key ID of the key to use for signing the token. If not provided, the first key will be used.",
1104
+ "name": "kid",
1105
+ "required": false,
1203
1106
  "hasDynamicHelp": false,
1204
1107
  "multiple": false,
1205
- "options": [
1206
- "dart",
1207
- "dotNet",
1208
- "dotNetClass",
1209
- "js",
1210
- "jsLegacy",
1211
- "kotlin",
1212
- "swift",
1213
- "ts"
1214
- ],
1215
1108
  "type": "option"
1216
1109
  },
1217
- "output-path": {
1218
- "description": "Path to output the schema file.",
1219
- "name": "output-path",
1110
+ "subject": {
1111
+ "description": "Subject of the token.",
1112
+ "name": "subject",
1220
1113
  "required": true,
1221
1114
  "hasDynamicHelp": false,
1222
1115
  "multiple": false,
@@ -1225,12 +1118,12 @@
1225
1118
  },
1226
1119
  "hasDynamicHelp": false,
1227
1120
  "hiddenAliases": [],
1228
- "id": "generate:schema",
1121
+ "id": "generate:token",
1229
1122
  "pluginAlias": "powersync",
1230
1123
  "pluginName": "powersync",
1231
1124
  "pluginType": "core",
1232
1125
  "strict": true,
1233
- "summary": "Generate client schema file from instance schema and sync config.",
1126
+ "summary": "Generate a development JWT for client connections.",
1234
1127
  "enableJsonFlag": false,
1235
1128
  "commandHelpGroup": "INSTANCE",
1236
1129
  "isESM": true,
@@ -1238,37 +1131,129 @@
1238
1131
  "dist",
1239
1132
  "commands",
1240
1133
  "generate",
1241
- "schema.js"
1134
+ "token.js"
1242
1135
  ]
1243
1136
  },
1244
- "generate:token": {
1137
+ "init:cloud": {
1245
1138
  "aliases": [],
1246
1139
  "args": {},
1247
- "description": "Generate a JWT for development clients to connect to PowerSync. Cloud: uses instance dev-token API (allow_temporary_tokens must be enabled). Self-hosted: signs with shared secret from config. Requires --subject; optional --expires-in-seconds.",
1140
+ "description": "Copy a Cloud template into a config directory (default powersync/). Edit service.yaml then run link cloud and deploy.",
1248
1141
  "examples": [
1249
- "<%= config.bin %> <%= command.id %> --subject=user-123",
1250
- "<%= config.bin %> <%= command.id %> --subject=user-123 --expires-in-seconds=3600"
1142
+ "<%= config.bin %> <%= command.id %>",
1143
+ "<%= config.bin %> <%= command.id %> --directory=powersync"
1251
1144
  ],
1252
1145
  "flags": {
1253
- "api-url": {
1254
- "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
1255
- "exclusive": [
1256
- "instance-id",
1257
- "org-id",
1258
- "project-id"
1259
- ],
1260
- "helpGroup": "SELF_HOSTED_PROJECT",
1261
- "name": "api-url",
1262
- "required": false,
1146
+ "directory": {
1147
+ "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
1148
+ "helpGroup": "PROJECT",
1149
+ "name": "directory",
1150
+ "default": "powersync",
1151
+ "hasDynamicHelp": false,
1152
+ "multiple": false,
1153
+ "type": "option"
1154
+ }
1155
+ },
1156
+ "hasDynamicHelp": false,
1157
+ "hiddenAliases": [],
1158
+ "id": "init:cloud",
1159
+ "pluginAlias": "powersync",
1160
+ "pluginName": "powersync",
1161
+ "pluginType": "core",
1162
+ "strict": true,
1163
+ "summary": "Scaffold a PowerSync Cloud config directory from a template.",
1164
+ "enableJsonFlag": false,
1165
+ "commandHelpGroup": "PROJECT SETUP",
1166
+ "isESM": true,
1167
+ "relativePath": [
1168
+ "dist",
1169
+ "commands",
1170
+ "init",
1171
+ "cloud.js"
1172
+ ]
1173
+ },
1174
+ "init": {
1175
+ "aliases": [],
1176
+ "args": {},
1177
+ "description": "Scaffold a PowerSync config directory from a template. Use init cloud or init self-hosted. For Cloud, edit service.yaml then run link cloud and deploy.",
1178
+ "examples": [
1179
+ "<%= config.bin %> <%= command.id %>"
1180
+ ],
1181
+ "flags": {},
1182
+ "hasDynamicHelp": false,
1183
+ "hidden": true,
1184
+ "hiddenAliases": [],
1185
+ "id": "init",
1186
+ "pluginAlias": "powersync",
1187
+ "pluginName": "powersync",
1188
+ "pluginType": "core",
1189
+ "strict": true,
1190
+ "summary": "Scaffold a PowerSync config directory from a template.",
1191
+ "enableJsonFlag": false,
1192
+ "isESM": true,
1193
+ "relativePath": [
1194
+ "dist",
1195
+ "commands",
1196
+ "init",
1197
+ "index.js"
1198
+ ]
1199
+ },
1200
+ "init:self-hosted": {
1201
+ "aliases": [],
1202
+ "args": {},
1203
+ "description": "Copy a self-hosted template into a config directory (default powersync/). Configure service.yaml with your self-hosted instance details.",
1204
+ "examples": [
1205
+ "<%= config.bin %> <%= command.id %>",
1206
+ "<%= config.bin %> <%= command.id %> --directory=powersync"
1207
+ ],
1208
+ "flags": {
1209
+ "directory": {
1210
+ "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
1211
+ "helpGroup": "PROJECT",
1212
+ "name": "directory",
1213
+ "default": "powersync",
1214
+ "hasDynamicHelp": false,
1215
+ "multiple": false,
1216
+ "type": "option"
1217
+ }
1218
+ },
1219
+ "hasDynamicHelp": false,
1220
+ "hiddenAliases": [],
1221
+ "id": "init:self-hosted",
1222
+ "pluginAlias": "powersync",
1223
+ "pluginName": "powersync",
1224
+ "pluginType": "core",
1225
+ "strict": true,
1226
+ "summary": "Scaffold a PowerSync self-hosted config directory from a template.",
1227
+ "enableJsonFlag": false,
1228
+ "commandHelpGroup": "PROJECT SETUP",
1229
+ "isESM": true,
1230
+ "relativePath": [
1231
+ "dist",
1232
+ "commands",
1233
+ "init",
1234
+ "self-hosted.js"
1235
+ ]
1236
+ },
1237
+ "fetch:config": {
1238
+ "aliases": [],
1239
+ "args": {},
1240
+ "description": "Retrieve the current instance config from PowerSync Cloud and print as YAML or JSON.",
1241
+ "examples": [
1242
+ "<%= config.bin %> <%= command.id %>",
1243
+ "<%= config.bin %> <%= command.id %> --output=json"
1244
+ ],
1245
+ "flags": {
1246
+ "directory": {
1247
+ "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
1248
+ "helpGroup": "PROJECT",
1249
+ "name": "directory",
1250
+ "default": "powersync",
1263
1251
  "hasDynamicHelp": false,
1264
1252
  "multiple": false,
1265
1253
  "type": "option"
1266
1254
  },
1267
1255
  "instance-id": {
1268
- "dependsOn": [
1269
- "project-id"
1270
- ],
1271
- "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
1256
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
1272
1257
  "helpGroup": "CLOUD_PROJECT",
1273
1258
  "name": "instance-id",
1274
1259
  "required": false,
@@ -1277,8 +1262,12 @@
1277
1262
  "type": "option"
1278
1263
  },
1279
1264
  "org-id": {
1280
- "description": "[Cloud] Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.",
1265
+ "deprecated": {
1266
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
1267
+ },
1268
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
1281
1269
  "helpGroup": "CLOUD_PROJECT",
1270
+ "hidden": true,
1282
1271
  "name": "org-id",
1283
1272
  "required": false,
1284
1273
  "hasDynamicHelp": false,
@@ -1286,139 +1275,198 @@
1286
1275
  "type": "option"
1287
1276
  },
1288
1277
  "project-id": {
1289
- "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
1278
+ "deprecated": {
1279
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
1280
+ },
1281
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
1290
1282
  "helpGroup": "CLOUD_PROJECT",
1283
+ "hidden": true,
1291
1284
  "name": "project-id",
1292
1285
  "required": false,
1293
1286
  "hasDynamicHelp": false,
1294
1287
  "multiple": false,
1295
1288
  "type": "option"
1296
1289
  },
1297
- "directory": {
1298
- "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
1299
- "helpGroup": "PROJECT",
1300
- "name": "directory",
1301
- "default": "powersync",
1302
- "hasDynamicHelp": false,
1303
- "multiple": false,
1304
- "type": "option"
1305
- },
1306
- "expires-in-seconds": {
1307
- "description": "Expiration time in seconds. Default is 43,200 (12 hours).",
1308
- "name": "expires-in-seconds",
1309
- "required": false,
1310
- "default": 43200,
1311
- "hasDynamicHelp": false,
1312
- "multiple": false,
1313
- "type": "option"
1314
- },
1315
- "kid": {
1316
- "description": "[Self-hosted only] Key ID of the key to use for signing the token. If not provided, the first key will be used.",
1317
- "name": "kid",
1318
- "required": false,
1319
- "hasDynamicHelp": false,
1320
- "multiple": false,
1321
- "type": "option"
1322
- },
1323
- "subject": {
1324
- "description": "Subject of the token.",
1325
- "name": "subject",
1326
- "required": true,
1290
+ "output": {
1291
+ "description": "Output format: yaml or json.",
1292
+ "name": "output",
1293
+ "default": "yaml",
1327
1294
  "hasDynamicHelp": false,
1328
1295
  "multiple": false,
1296
+ "options": [
1297
+ "json",
1298
+ "yaml"
1299
+ ],
1329
1300
  "type": "option"
1330
1301
  }
1331
1302
  },
1332
1303
  "hasDynamicHelp": false,
1333
1304
  "hiddenAliases": [],
1334
- "id": "generate:token",
1305
+ "id": "fetch:config",
1335
1306
  "pluginAlias": "powersync",
1336
1307
  "pluginName": "powersync",
1337
1308
  "pluginType": "core",
1338
1309
  "strict": true,
1339
- "summary": "Generate a development JWT for client connections.",
1310
+ "summary": "[Cloud only] Print linked Cloud instance config (YAML or JSON).",
1340
1311
  "enableJsonFlag": false,
1341
- "commandHelpGroup": "INSTANCE",
1312
+ "commandHelpGroup": "CLOUD",
1342
1313
  "isESM": true,
1343
1314
  "relativePath": [
1344
1315
  "dist",
1345
1316
  "commands",
1346
- "generate",
1347
- "token.js"
1317
+ "fetch",
1318
+ "config.js"
1348
1319
  ]
1349
1320
  },
1350
- "init:cloud": {
1321
+ "fetch": {
1351
1322
  "aliases": [],
1352
1323
  "args": {},
1353
- "description": "Copy a Cloud template into a config directory (default powersync/). Edit service.yaml then run link cloud and deploy.",
1324
+ "description": "Subcommands: list Cloud instances in org/project (fetch instances), print instance config as YAML/JSON (fetch config), or show instance diagnostics (fetch status).",
1354
1325
  "examples": [
1355
- "<%= config.bin %> <%= command.id %>",
1356
- "<%= config.bin %> <%= command.id %> --directory=powersync"
1326
+ "<%= config.bin %> <%= command.id %>"
1357
1327
  ],
1358
- "flags": {
1359
- "directory": {
1360
- "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
1361
- "helpGroup": "PROJECT",
1362
- "name": "directory",
1363
- "default": "powersync",
1364
- "hasDynamicHelp": false,
1365
- "multiple": false,
1366
- "type": "option"
1367
- }
1368
- },
1328
+ "flags": {},
1369
1329
  "hasDynamicHelp": false,
1330
+ "hidden": true,
1370
1331
  "hiddenAliases": [],
1371
- "id": "init:cloud",
1332
+ "id": "fetch",
1372
1333
  "pluginAlias": "powersync",
1373
1334
  "pluginName": "powersync",
1374
1335
  "pluginType": "core",
1375
1336
  "strict": true,
1376
- "summary": "Scaffold a PowerSync Cloud config directory from a template.",
1337
+ "summary": "List instances, fetch config, or fetch instance diagnostics.",
1377
1338
  "enableJsonFlag": false,
1378
- "commandHelpGroup": "PROJECT SETUP",
1379
1339
  "isESM": true,
1380
1340
  "relativePath": [
1381
1341
  "dist",
1382
1342
  "commands",
1383
- "init",
1384
- "cloud.js"
1343
+ "fetch",
1344
+ "index.js"
1385
1345
  ]
1386
1346
  },
1387
- "init": {
1347
+ "fetch:instances": {
1388
1348
  "aliases": [],
1389
1349
  "args": {},
1390
- "description": "Scaffold a PowerSync config directory from a template. Use init cloud or init self-hosted. For Cloud, edit service.yaml then run link cloud and deploy.",
1350
+ "description": "List PowerSync Cloud and linked instances, Cloud instances are grouped by organization and project.",
1391
1351
  "examples": [
1392
- "<%= config.bin %> <%= command.id %>"
1352
+ "<%= config.bin %> <%= command.id %>",
1353
+ "<%= config.bin %> <%= command.id %> --project-id=<id> --output=json"
1393
1354
  ],
1394
- "flags": {},
1355
+ "flags": {
1356
+ "org-id": {
1357
+ "description": "Optional Organization ID. Defaults to all organizations.",
1358
+ "name": "org-id",
1359
+ "required": false,
1360
+ "hasDynamicHelp": false,
1361
+ "multiple": false,
1362
+ "type": "option"
1363
+ },
1364
+ "output": {
1365
+ "description": "Output format: human or json.",
1366
+ "name": "output",
1367
+ "default": "human",
1368
+ "hasDynamicHelp": false,
1369
+ "multiple": false,
1370
+ "options": [
1371
+ "human",
1372
+ "json"
1373
+ ],
1374
+ "type": "option"
1375
+ },
1376
+ "output-file": {
1377
+ "description": "Optionally write instance information to a file.",
1378
+ "name": "output-file",
1379
+ "required": false,
1380
+ "hasDynamicHelp": false,
1381
+ "multiple": false,
1382
+ "type": "option"
1383
+ },
1384
+ "project-id": {
1385
+ "description": "Optional Project ID. Defaults to all projects in the org.",
1386
+ "name": "project-id",
1387
+ "required": false,
1388
+ "hasDynamicHelp": false,
1389
+ "multiple": false,
1390
+ "type": "option"
1391
+ }
1392
+ },
1395
1393
  "hasDynamicHelp": false,
1396
- "hidden": true,
1397
1394
  "hiddenAliases": [],
1398
- "id": "init",
1395
+ "id": "fetch:instances",
1399
1396
  "pluginAlias": "powersync",
1400
1397
  "pluginName": "powersync",
1401
1398
  "pluginType": "core",
1402
1399
  "strict": true,
1403
- "summary": "Scaffold a PowerSync config directory from a template.",
1400
+ "summary": "List Cloud and linked instances.",
1404
1401
  "enableJsonFlag": false,
1402
+ "commandHelpGroup": "CLOUD",
1405
1403
  "isESM": true,
1406
1404
  "relativePath": [
1407
1405
  "dist",
1408
1406
  "commands",
1409
- "init",
1410
- "index.js"
1407
+ "fetch",
1408
+ "instances.js"
1411
1409
  ]
1412
1410
  },
1413
- "init:self-hosted": {
1411
+ "fetch:status": {
1414
1412
  "aliases": [],
1415
1413
  "args": {},
1416
- "description": "Copy a self-hosted template into a config directory (default powersync/). Configure service.yaml with your self-hosted instance details.",
1414
+ "description": "Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as human-readable, JSON, or YAML. Cloud and self-hosted.",
1417
1415
  "examples": [
1418
1416
  "<%= config.bin %> <%= command.id %>",
1419
- "<%= config.bin %> <%= command.id %> --directory=powersync"
1417
+ "<%= config.bin %> <%= command.id %> --output=json",
1418
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>"
1420
1419
  ],
1421
1420
  "flags": {
1421
+ "api-url": {
1422
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
1423
+ "exclusive": [
1424
+ "instance-id",
1425
+ "org-id",
1426
+ "project-id"
1427
+ ],
1428
+ "helpGroup": "SELF_HOSTED_PROJECT",
1429
+ "name": "api-url",
1430
+ "required": false,
1431
+ "hasDynamicHelp": false,
1432
+ "multiple": false,
1433
+ "type": "option"
1434
+ },
1435
+ "instance-id": {
1436
+ "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
1437
+ "helpGroup": "CLOUD_PROJECT",
1438
+ "name": "instance-id",
1439
+ "required": false,
1440
+ "hasDynamicHelp": false,
1441
+ "multiple": false,
1442
+ "type": "option"
1443
+ },
1444
+ "org-id": {
1445
+ "deprecated": {
1446
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
1447
+ },
1448
+ "description": "[Cloud] [Deprecated] Organization ID. Automatically resolved from --instance-id.",
1449
+ "helpGroup": "CLOUD_PROJECT",
1450
+ "hidden": true,
1451
+ "name": "org-id",
1452
+ "required": false,
1453
+ "hasDynamicHelp": false,
1454
+ "multiple": false,
1455
+ "type": "option"
1456
+ },
1457
+ "project-id": {
1458
+ "deprecated": {
1459
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
1460
+ },
1461
+ "description": "[Cloud] [Deprecated] Project ID. Automatically resolved from --instance-id.",
1462
+ "helpGroup": "CLOUD_PROJECT",
1463
+ "hidden": true,
1464
+ "name": "project-id",
1465
+ "required": false,
1466
+ "hasDynamicHelp": false,
1467
+ "multiple": false,
1468
+ "type": "option"
1469
+ },
1422
1470
  "directory": {
1423
1471
  "description": "Directory containing PowerSync config. Defaults to \"powersync\". This is required if multiple powersync config files are present in subdirectories of the current working directory.",
1424
1472
  "helpGroup": "PROJECT",
@@ -1427,34 +1475,46 @@
1427
1475
  "hasDynamicHelp": false,
1428
1476
  "multiple": false,
1429
1477
  "type": "option"
1478
+ },
1479
+ "output": {
1480
+ "description": "Output format: human-readable, json, or yaml.",
1481
+ "name": "output",
1482
+ "default": "human",
1483
+ "hasDynamicHelp": false,
1484
+ "multiple": false,
1485
+ "options": [
1486
+ "human",
1487
+ "json",
1488
+ "yaml"
1489
+ ],
1490
+ "type": "option"
1430
1491
  }
1431
1492
  },
1432
1493
  "hasDynamicHelp": false,
1433
1494
  "hiddenAliases": [],
1434
- "id": "init:self-hosted",
1495
+ "id": "fetch:status",
1435
1496
  "pluginAlias": "powersync",
1436
1497
  "pluginName": "powersync",
1437
1498
  "pluginType": "core",
1438
1499
  "strict": true,
1439
- "summary": "Scaffold a PowerSync self-hosted config directory from a template.",
1500
+ "summary": "Show instance diagnostics (connections, sync config, replication).",
1440
1501
  "enableJsonFlag": false,
1441
- "commandHelpGroup": "PROJECT SETUP",
1502
+ "commandHelpGroup": "INSTANCE",
1442
1503
  "isESM": true,
1443
1504
  "relativePath": [
1444
1505
  "dist",
1445
1506
  "commands",
1446
- "init",
1447
- "self-hosted.js"
1507
+ "status.js"
1448
1508
  ]
1449
1509
  },
1450
1510
  "link:cloud": {
1451
1511
  "aliases": [],
1452
1512
  "args": {},
1453
- "description": "Write or update cli.yaml with a Cloud instance (instance-id, org-id, project-id). Use --create to create a new instance from service.yaml name/region and link it; omit --instance-id when using --create. Org ID is optional when the token has a single organization.",
1513
+ "description": "Write or update cli.yaml with a Cloud instance. Use --create to create a new instance from service.yaml name/region and link it; omit --instance-id when using --create.",
1454
1514
  "examples": [
1455
- "<%= config.bin %> <%= command.id %> --project-id=<project-id>",
1515
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>",
1456
1516
  "<%= config.bin %> <%= command.id %> --create --project-id=<project-id>",
1457
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<project-id> --org-id=<org-id>"
1517
+ "<%= config.bin %> <%= command.id %> --create --project-id=<project-id> --org-id=<org-id>"
1458
1518
  ],
1459
1519
  "flags": {
1460
1520
  "directory": {
@@ -1475,7 +1535,7 @@
1475
1535
  "type": "option"
1476
1536
  },
1477
1537
  "org-id": {
1478
- "description": "Organization ID. Optional when the token has a single org; required when the token has multiple orgs. Resolved: flag → ORG_ID → cli.yaml.",
1538
+ "description": "Organization ID. Required with --create when the token has multiple orgs.",
1479
1539
  "name": "org-id",
1480
1540
  "required": false,
1481
1541
  "hasDynamicHelp": false,
@@ -1483,9 +1543,9 @@
1483
1543
  "type": "option"
1484
1544
  },
1485
1545
  "project-id": {
1486
- "description": "Project ID. Resolved: flag → PROJECT_ID → cli.yaml.",
1546
+ "description": "Project ID. Required with --create.",
1487
1547
  "name": "project-id",
1488
- "required": true,
1548
+ "required": false,
1489
1549
  "hasDynamicHelp": false,
1490
1550
  "multiple": false,
1491
1551
  "type": "option"
@@ -1628,9 +1688,6 @@
1628
1688
  "type": "option"
1629
1689
  },
1630
1690
  "instance-id": {
1631
- "dependsOn": [
1632
- "project-id"
1633
- ],
1634
1691
  "description": "[Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.",
1635
1692
  "helpGroup": "CLOUD_PROJECT",
1636
1693
  "name": "instance-id",
@@ -1640,8 +1697,12 @@
1640
1697
  "type": "option"
1641
1698
  },
1642
1699
  "org-id": {
1643
- "description": "[Cloud] Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.",
1700
+ "deprecated": {
1701
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
1702
+ },
1703
+ "description": "[Cloud] [Deprecated] Organization ID. Automatically resolved from --instance-id.",
1644
1704
  "helpGroup": "CLOUD_PROJECT",
1705
+ "hidden": true,
1645
1706
  "name": "org-id",
1646
1707
  "required": false,
1647
1708
  "hasDynamicHelp": false,
@@ -1649,8 +1710,12 @@
1649
1710
  "type": "option"
1650
1711
  },
1651
1712
  "project-id": {
1652
- "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
1713
+ "deprecated": {
1714
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
1715
+ },
1716
+ "description": "[Cloud] [Deprecated] Project ID. Automatically resolved from --instance-id.",
1653
1717
  "helpGroup": "CLOUD_PROJECT",
1718
+ "hidden": true,
1654
1719
  "name": "project-id",
1655
1720
  "required": false,
1656
1721
  "hasDynamicHelp": false,
@@ -1704,7 +1769,7 @@
1704
1769
  "pull": {
1705
1770
  "aliases": [],
1706
1771
  "args": {},
1707
- "description": "Download current config from PowerSync Cloud into local YAML files. Use pull instance; pass --instance-id and --project-id when the directory is not yet linked (--org-id is optional when the token has a single organization).",
1772
+ "description": "Download current config from PowerSync Cloud into local YAML files. Use pull instance; pass --instance-id when the directory is not yet linked.",
1708
1773
  "examples": [
1709
1774
  "<%= config.bin %> <%= command.id %>"
1710
1775
  ],
@@ -1730,11 +1795,10 @@
1730
1795
  "pull:instance": {
1731
1796
  "aliases": [],
1732
1797
  "args": {},
1733
- "description": "Fetch an existing Cloud instance by ID: create the config directory if needed, write cli.yaml, and download service.yaml and sync-config.yaml. Pass --instance-id and --project-id when the directory is not yet linked; --org-id is optional when the token has a single organization. Cloud only.",
1798
+ "description": "Fetch an existing Cloud instance by ID: create the config directory if needed, write cli.yaml, and download service.yaml and sync-config.yaml. Cloud only.",
1734
1799
  "examples": [
1735
1800
  "<%= config.bin %> <%= command.id %>",
1736
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>",
1737
- "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id> --org-id=<org-id>"
1801
+ "<%= config.bin %> <%= command.id %> --instance-id=<id>"
1738
1802
  ],
1739
1803
  "flags": {
1740
1804
  "directory": {
@@ -1747,9 +1811,6 @@
1747
1811
  "type": "option"
1748
1812
  },
1749
1813
  "instance-id": {
1750
- "dependsOn": [
1751
- "project-id"
1752
- ],
1753
1814
  "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
1754
1815
  "helpGroup": "CLOUD_PROJECT",
1755
1816
  "name": "instance-id",
@@ -1759,8 +1820,12 @@
1759
1820
  "type": "option"
1760
1821
  },
1761
1822
  "org-id": {
1762
- "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
1823
+ "deprecated": {
1824
+ "message": "--org-id is a no-op. Organization ID is resolved automatically."
1825
+ },
1826
+ "description": "[Deprecated] Organization ID. Automatically resolved from --instance-id.",
1763
1827
  "helpGroup": "CLOUD_PROJECT",
1828
+ "hidden": true,
1764
1829
  "name": "org-id",
1765
1830
  "required": false,
1766
1831
  "hasDynamicHelp": false,
@@ -1768,8 +1833,12 @@
1768
1833
  "type": "option"
1769
1834
  },
1770
1835
  "project-id": {
1771
- "description": "Project ID. Manually passed if the current context has not been linked.",
1836
+ "deprecated": {
1837
+ "message": "--project-id is a no-op. Project ID is resolved automatically."
1838
+ },
1839
+ "description": "[Deprecated] Project ID. Automatically resolved from --instance-id.",
1772
1840
  "helpGroup": "CLOUD_PROJECT",
1841
+ "hidden": true,
1773
1842
  "name": "project-id",
1774
1843
  "required": false,
1775
1844
  "hasDynamicHelp": false,
@@ -1802,5 +1871,5 @@
1802
1871
  ]
1803
1872
  }
1804
1873
  },
1805
- "version": "0.9.6"
1874
+ "version": "0.10.0"
1806
1875
  }