powersync 0.7.1 → 0.9.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 (133) hide show
  1. package/LICENSE +67 -0
  2. package/README.md +1376 -165
  3. package/bin/dev.cmd +3 -3
  4. package/bin/dev.js +20 -7
  5. package/bin/run.cmd +3 -3
  6. package/bin/run.js +9 -5
  7. package/dist/api/cloud/create-cloud-instance.d.ts +15 -0
  8. package/dist/api/cloud/create-cloud-instance.js +19 -0
  9. package/dist/api/cloud/fetch-cloud-config.d.ts +12 -0
  10. package/dist/api/cloud/fetch-cloud-config.js +18 -0
  11. package/dist/api/cloud/fetch-cloud-sync-rules-content.d.ts +7 -0
  12. package/dist/api/cloud/fetch-cloud-sync-rules-content.js +26 -0
  13. package/dist/api/cloud/test-connection.d.ts +16 -0
  14. package/dist/api/cloud/test-connection.js +36 -0
  15. package/dist/api/cloud/validate-cloud-link-config.d.ts +17 -0
  16. package/dist/api/cloud/validate-cloud-link-config.js +47 -0
  17. package/dist/api/cloud/wait-for-operation.d.ts +16 -0
  18. package/dist/api/cloud/wait-for-operation.js +33 -0
  19. package/dist/api/cloud/write-cloud-link.d.ts +10 -0
  20. package/dist/api/cloud/write-cloud-link.js +21 -0
  21. package/dist/api/display-status.d.ts +4 -0
  22. package/dist/api/display-status.js +80 -0
  23. package/dist/api/ide/configure-vscode-ide.d.ts +14 -0
  24. package/dist/api/ide/configure-vscode-ide.js +62 -0
  25. package/dist/api/login-server.d.ts +26 -0
  26. package/dist/api/login-server.js +137 -0
  27. package/dist/api/run-validation-tests.d.ts +63 -0
  28. package/dist/api/run-validation-tests.js +202 -0
  29. package/dist/api/self-hosted/fetch-self-hosted-sync-rules-content.d.ts +7 -0
  30. package/dist/api/self-hosted/fetch-self-hosted-sync-rules-content.js +26 -0
  31. package/dist/commands/configure/ide.d.ts +8 -0
  32. package/dist/commands/configure/ide.js +58 -0
  33. package/dist/commands/configure/index.d.ts +8 -0
  34. package/dist/commands/configure/index.js +11 -0
  35. package/dist/commands/deploy/index.d.ts +48 -0
  36. package/dist/commands/deploy/index.js +333 -0
  37. package/dist/commands/deploy/service-config.d.ts +14 -0
  38. package/dist/commands/deploy/service-config.js +30 -0
  39. package/dist/commands/deploy/sync-config.d.ts +24 -0
  40. package/dist/commands/deploy/sync-config.js +103 -0
  41. package/dist/commands/destroy.d.ts +14 -0
  42. package/dist/commands/destroy.js +62 -0
  43. package/dist/commands/fetch/config.d.ts +14 -0
  44. package/dist/commands/fetch/config.js +33 -0
  45. package/dist/commands/fetch/index.d.ts +13 -0
  46. package/dist/commands/fetch/index.js +16 -0
  47. package/dist/commands/fetch/instances.d.ts +47 -0
  48. package/dist/commands/fetch/instances.js +177 -0
  49. package/dist/commands/fetch/status.d.ts +18 -0
  50. package/dist/commands/fetch/status.js +60 -0
  51. package/dist/commands/{instance/schema.d.ts → generate/index.d.ts} +3 -1
  52. package/dist/commands/generate/index.js +11 -0
  53. package/dist/commands/generate/schema.d.ts +19 -0
  54. package/dist/commands/generate/schema.js +72 -0
  55. package/dist/commands/generate/token.d.ts +25 -0
  56. package/dist/commands/generate/token.js +124 -0
  57. package/dist/commands/init/cloud.d.ts +11 -0
  58. package/dist/commands/init/cloud.js +64 -0
  59. package/dist/commands/{init.d.ts → init/index.d.ts} +2 -1
  60. package/dist/commands/init/index.js +11 -0
  61. package/dist/commands/init/self-hosted.d.ts +11 -0
  62. package/dist/commands/init/self-hosted.js +60 -0
  63. package/dist/commands/link/cloud.d.ts +15 -0
  64. package/dist/commands/link/cloud.js +111 -0
  65. package/dist/commands/{instance/config.d.ts → link/index.d.ts} +3 -1
  66. package/dist/commands/link/index.js +11 -0
  67. package/dist/commands/link/self-hosted.d.ts +12 -0
  68. package/dist/commands/link/self-hosted.js +54 -0
  69. package/dist/commands/login.d.ts +8 -0
  70. package/dist/commands/login.js +107 -0
  71. package/dist/commands/logout.d.ts +8 -0
  72. package/dist/commands/logout.js +19 -0
  73. package/dist/commands/migrate/index.d.ts +7 -0
  74. package/dist/commands/migrate/index.js +10 -0
  75. package/dist/commands/migrate/sync-rules.d.ts +15 -0
  76. package/dist/commands/migrate/sync-rules.js +51 -0
  77. package/dist/commands/{instances.d.ts → pull/index.d.ts} +3 -1
  78. package/dist/commands/pull/index.js +11 -0
  79. package/dist/commands/pull/instance.d.ts +14 -0
  80. package/dist/commands/pull/instance.js +108 -0
  81. package/dist/commands/status.d.ts +1 -0
  82. package/dist/commands/status.js +2 -0
  83. package/dist/commands/stop.d.ts +14 -0
  84. package/dist/commands/stop.js +62 -0
  85. package/dist/commands/validate.d.ts +16 -0
  86. package/dist/commands/validate.js +165 -0
  87. package/dist/help.d.ts +31 -0
  88. package/dist/help.js +123 -0
  89. package/oclif.manifest.json +1250 -275
  90. package/package.json +104 -75
  91. package/templates/cloud/powersync/cli.yaml +3 -0
  92. package/templates/cloud/powersync/service.yaml +174 -0
  93. package/templates/cloud/powersync/sync-config.yaml +22 -0
  94. package/templates/self-hosted/base/powersync/cli.yaml +3 -0
  95. package/templates/self-hosted/base/powersync/service.yaml +243 -0
  96. package/templates/self-hosted/base/powersync/sync-config.yaml +22 -0
  97. package/templates/vscode/settings.json +3 -0
  98. package/dist/commands/init.js +0 -66
  99. package/dist/commands/instance/config.js +0 -23
  100. package/dist/commands/instance/create.d.ts +0 -20
  101. package/dist/commands/instance/create.js +0 -121
  102. package/dist/commands/instance/deploy.d.ts +0 -18
  103. package/dist/commands/instance/deploy.js +0 -91
  104. package/dist/commands/instance/destroy.d.ts +0 -9
  105. package/dist/commands/instance/destroy.js +0 -46
  106. package/dist/commands/instance/generate-dev-token.d.ts +0 -10
  107. package/dist/commands/instance/generate-dev-token.js +0 -54
  108. package/dist/commands/instance/schema.js +0 -20
  109. package/dist/commands/instance/set.d.ts +0 -9
  110. package/dist/commands/instance/set.js +0 -31
  111. package/dist/commands/instance/status.d.ts +0 -12
  112. package/dist/commands/instance/status.js +0 -50
  113. package/dist/commands/instance/stop.d.ts +0 -9
  114. package/dist/commands/instance/stop.js +0 -42
  115. package/dist/commands/instance/sync-rules/deploy.d.ts +0 -10
  116. package/dist/commands/instance/sync-rules/deploy.js +0 -49
  117. package/dist/commands/instance/sync-rules/generate-schema.d.ts +0 -10
  118. package/dist/commands/instance/sync-rules/generate-schema.js +0 -56
  119. package/dist/commands/instance/sync-rules/validate.d.ts +0 -9
  120. package/dist/commands/instance/sync-rules/validate.js +0 -29
  121. package/dist/commands/instances.js +0 -29
  122. package/dist/commands.utils.d.ts +0 -2
  123. package/dist/commands.utils.js +0 -92
  124. package/dist/constants.d.ts +0 -8
  125. package/dist/constants.js +0 -10
  126. package/dist/instance-command-flags.d.ts +0 -12
  127. package/dist/instance-command-flags.js +0 -13
  128. package/dist/service/accounts.client.js +0 -11307
  129. package/dist/service/powersync.client.js +0 -75510
  130. package/dist/service/types.js +0 -1
  131. package/dist/service/utils.js +0 -153
  132. package/dist/utils.d.ts +0 -14
  133. package/dist/utils.js +0 -68
@@ -1,355 +1,1195 @@
1
1
  {
2
2
  "commands": {
3
- "init": {
3
+ "destroy": {
4
+ "aliases": [],
5
+ "args": {},
6
+ "description": "Permanently delete the linked PowerSync Cloud instance and its data. Requires --confirm=yes.",
7
+ "examples": [
8
+ "<%= config.bin %> <%= command.id %>",
9
+ "<%= config.bin %> <%= command.id %> --confirm=yes"
10
+ ],
11
+ "flags": {
12
+ "confirm": {
13
+ "description": "Set to \"yes\" to confirm destruction of the instance.",
14
+ "name": "confirm",
15
+ "hasDynamicHelp": false,
16
+ "multiple": false,
17
+ "options": [
18
+ "yes"
19
+ ],
20
+ "type": "option"
21
+ },
22
+ "directory": {
23
+ "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.",
24
+ "helpGroup": "PROJECT",
25
+ "name": "directory",
26
+ "default": "powersync",
27
+ "hasDynamicHelp": false,
28
+ "multiple": false,
29
+ "type": "option"
30
+ },
31
+ "instance-id": {
32
+ "dependsOn": [
33
+ "project-id"
34
+ ],
35
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
36
+ "helpGroup": "CLOUD_PROJECT",
37
+ "name": "instance-id",
38
+ "required": false,
39
+ "hasDynamicHelp": false,
40
+ "multiple": false,
41
+ "type": "option"
42
+ },
43
+ "org-id": {
44
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
45
+ "helpGroup": "CLOUD_PROJECT",
46
+ "name": "org-id",
47
+ "required": false,
48
+ "hasDynamicHelp": false,
49
+ "multiple": false,
50
+ "type": "option"
51
+ },
52
+ "project-id": {
53
+ "description": "Project ID. Manually passed if the current context has not been linked.",
54
+ "helpGroup": "CLOUD_PROJECT",
55
+ "name": "project-id",
56
+ "required": false,
57
+ "hasDynamicHelp": false,
58
+ "multiple": false,
59
+ "type": "option"
60
+ }
61
+ },
62
+ "hasDynamicHelp": false,
63
+ "hiddenAliases": [],
64
+ "id": "destroy",
65
+ "pluginAlias": "powersync",
66
+ "pluginName": "powersync",
67
+ "pluginType": "core",
68
+ "strict": true,
69
+ "summary": "[Cloud only] Permanently destroy the linked Cloud instance.",
70
+ "enableJsonFlag": false,
71
+ "commandHelpGroup": "CLOUD",
72
+ "isESM": true,
73
+ "relativePath": [
74
+ "dist",
75
+ "commands",
76
+ "destroy.js"
77
+ ]
78
+ },
79
+ "login": {
80
+ "aliases": [],
81
+ "args": {},
82
+ "description": "Store a PowerSync auth token (PAT) in secure storage so later Cloud commands run without passing a token. If secure storage is unavailable, login can optionally store it in a local config file. Use PS_ADMIN_TOKEN env var for CI or scripts instead.",
83
+ "examples": [
84
+ "<%= config.bin %> <%= command.id %>"
85
+ ],
86
+ "flags": {},
87
+ "hasDynamicHelp": false,
88
+ "hiddenAliases": [],
89
+ "id": "login",
90
+ "pluginAlias": "powersync",
91
+ "pluginName": "powersync",
92
+ "pluginType": "core",
93
+ "strict": true,
94
+ "summary": "Store auth token for Cloud commands.",
95
+ "enableJsonFlag": false,
96
+ "commandHelpGroup": "AUTHENTICATION",
97
+ "isESM": true,
98
+ "relativePath": [
99
+ "dist",
100
+ "commands",
101
+ "login.js"
102
+ ]
103
+ },
104
+ "logout": {
105
+ "aliases": [],
106
+ "args": {},
107
+ "description": "Remove the stored PowerSync auth token from secure storage or local fallback config storage. Cloud commands will no longer use stored credentials until you run login again.",
108
+ "examples": [
109
+ "<%= config.bin %> <%= command.id %>"
110
+ ],
111
+ "flags": {},
112
+ "hasDynamicHelp": false,
113
+ "hiddenAliases": [],
114
+ "id": "logout",
115
+ "pluginAlias": "powersync",
116
+ "pluginName": "powersync",
117
+ "pluginType": "core",
118
+ "strict": true,
119
+ "summary": "Remove stored auth token.",
120
+ "enableJsonFlag": false,
121
+ "commandHelpGroup": "AUTHENTICATION",
122
+ "isESM": true,
123
+ "relativePath": [
124
+ "dist",
125
+ "commands",
126
+ "logout.js"
127
+ ]
128
+ },
129
+ "status": {
130
+ "aliases": [],
131
+ "args": {},
132
+ "description": "Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as human-readable, JSON, or YAML. Cloud and self-hosted.",
133
+ "examples": [
134
+ "<%= config.bin %> <%= command.id %>",
135
+ "<%= config.bin %> <%= command.id %> --output=json",
136
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
137
+ ],
138
+ "flags": {
139
+ "output": {
140
+ "description": "Output format: human-readable, json, or yaml.",
141
+ "name": "output",
142
+ "default": "human",
143
+ "hasDynamicHelp": false,
144
+ "multiple": false,
145
+ "options": [
146
+ "human",
147
+ "json",
148
+ "yaml"
149
+ ],
150
+ "type": "option"
151
+ },
152
+ "api-url": {
153
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
154
+ "exclusive": [
155
+ "instance-id",
156
+ "org-id",
157
+ "project-id"
158
+ ],
159
+ "helpGroup": "SELF_HOSTED_PROJECT",
160
+ "name": "api-url",
161
+ "required": false,
162
+ "hasDynamicHelp": false,
163
+ "multiple": false,
164
+ "type": "option"
165
+ },
166
+ "instance-id": {
167
+ "dependsOn": [
168
+ "project-id"
169
+ ],
170
+ "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.",
171
+ "helpGroup": "CLOUD_PROJECT",
172
+ "name": "instance-id",
173
+ "required": false,
174
+ "hasDynamicHelp": false,
175
+ "multiple": false,
176
+ "type": "option"
177
+ },
178
+ "org-id": {
179
+ "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.",
180
+ "helpGroup": "CLOUD_PROJECT",
181
+ "name": "org-id",
182
+ "required": false,
183
+ "hasDynamicHelp": false,
184
+ "multiple": false,
185
+ "type": "option"
186
+ },
187
+ "project-id": {
188
+ "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
189
+ "helpGroup": "CLOUD_PROJECT",
190
+ "name": "project-id",
191
+ "required": false,
192
+ "hasDynamicHelp": false,
193
+ "multiple": false,
194
+ "type": "option"
195
+ },
196
+ "directory": {
197
+ "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.",
198
+ "helpGroup": "PROJECT",
199
+ "name": "directory",
200
+ "default": "powersync",
201
+ "hasDynamicHelp": false,
202
+ "multiple": false,
203
+ "type": "option"
204
+ }
205
+ },
206
+ "hasDynamicHelp": false,
207
+ "hiddenAliases": [],
208
+ "id": "status",
209
+ "pluginAlias": "powersync",
210
+ "pluginName": "powersync",
211
+ "pluginType": "core",
212
+ "strict": true,
213
+ "summary": "Show instance diagnostics (connections, sync config, replication).",
214
+ "enableJsonFlag": false,
215
+ "commandHelpGroup": "INSTANCE",
216
+ "isESM": true,
217
+ "relativePath": [
218
+ "dist",
219
+ "commands",
220
+ "status.js"
221
+ ]
222
+ },
223
+ "stop": {
224
+ "aliases": [],
225
+ "args": {},
226
+ "description": "Deactivate the linked PowerSync Cloud instance. Requires --confirm=yes. Restart later with powersync deploy.",
227
+ "examples": [
228
+ "<%= config.bin %> <%= command.id %>",
229
+ "<%= config.bin %> <%= command.id %> --confirm=yes"
230
+ ],
231
+ "flags": {
232
+ "confirm": {
233
+ "description": "Set to \"yes\" to confirm stopping the instance.",
234
+ "name": "confirm",
235
+ "hasDynamicHelp": false,
236
+ "multiple": false,
237
+ "options": [
238
+ "yes"
239
+ ],
240
+ "type": "option"
241
+ },
242
+ "directory": {
243
+ "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.",
244
+ "helpGroup": "PROJECT",
245
+ "name": "directory",
246
+ "default": "powersync",
247
+ "hasDynamicHelp": false,
248
+ "multiple": false,
249
+ "type": "option"
250
+ },
251
+ "instance-id": {
252
+ "dependsOn": [
253
+ "project-id"
254
+ ],
255
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
256
+ "helpGroup": "CLOUD_PROJECT",
257
+ "name": "instance-id",
258
+ "required": false,
259
+ "hasDynamicHelp": false,
260
+ "multiple": false,
261
+ "type": "option"
262
+ },
263
+ "org-id": {
264
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
265
+ "helpGroup": "CLOUD_PROJECT",
266
+ "name": "org-id",
267
+ "required": false,
268
+ "hasDynamicHelp": false,
269
+ "multiple": false,
270
+ "type": "option"
271
+ },
272
+ "project-id": {
273
+ "description": "Project ID. Manually passed if the current context has not been linked.",
274
+ "helpGroup": "CLOUD_PROJECT",
275
+ "name": "project-id",
276
+ "required": false,
277
+ "hasDynamicHelp": false,
278
+ "multiple": false,
279
+ "type": "option"
280
+ }
281
+ },
282
+ "hasDynamicHelp": false,
283
+ "hiddenAliases": [],
284
+ "id": "stop",
285
+ "pluginAlias": "powersync",
286
+ "pluginName": "powersync",
287
+ "pluginType": "core",
288
+ "strict": true,
289
+ "summary": "[Cloud only] Stop the linked Cloud instance (restart with deploy).",
290
+ "enableJsonFlag": false,
291
+ "commandHelpGroup": "CLOUD",
292
+ "isESM": true,
293
+ "relativePath": [
294
+ "dist",
295
+ "commands",
296
+ "stop.js"
297
+ ]
298
+ },
299
+ "validate": {
300
+ "aliases": [],
301
+ "args": {},
302
+ "description": "Run validation checks on local config: config schema, database connections, and sync config. Requires a linked instance. Works with Cloud and self-hosted.",
303
+ "examples": [
304
+ "<%= config.bin %> <%= command.id %>",
305
+ "<%= config.bin %> <%= command.id %> --output=json",
306
+ "<%= config.bin %> <%= command.id %> --api-url=https://powersync.example.com"
307
+ ],
308
+ "flags": {
309
+ "output": {
310
+ "description": "Output format: human-readable, json, or yaml.",
311
+ "name": "output",
312
+ "default": "human",
313
+ "hasDynamicHelp": false,
314
+ "multiple": false,
315
+ "options": [
316
+ "human",
317
+ "json",
318
+ "yaml"
319
+ ],
320
+ "type": "option"
321
+ },
322
+ "api-url": {
323
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
324
+ "exclusive": [
325
+ "instance-id",
326
+ "org-id",
327
+ "project-id"
328
+ ],
329
+ "helpGroup": "SELF_HOSTED_PROJECT",
330
+ "name": "api-url",
331
+ "required": false,
332
+ "hasDynamicHelp": false,
333
+ "multiple": false,
334
+ "type": "option"
335
+ },
336
+ "instance-id": {
337
+ "dependsOn": [
338
+ "project-id"
339
+ ],
340
+ "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.",
341
+ "helpGroup": "CLOUD_PROJECT",
342
+ "name": "instance-id",
343
+ "required": false,
344
+ "hasDynamicHelp": false,
345
+ "multiple": false,
346
+ "type": "option"
347
+ },
348
+ "org-id": {
349
+ "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.",
350
+ "helpGroup": "CLOUD_PROJECT",
351
+ "name": "org-id",
352
+ "required": false,
353
+ "hasDynamicHelp": false,
354
+ "multiple": false,
355
+ "type": "option"
356
+ },
357
+ "project-id": {
358
+ "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
359
+ "helpGroup": "CLOUD_PROJECT",
360
+ "name": "project-id",
361
+ "required": false,
362
+ "hasDynamicHelp": false,
363
+ "multiple": false,
364
+ "type": "option"
365
+ },
366
+ "directory": {
367
+ "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.",
368
+ "helpGroup": "PROJECT",
369
+ "name": "directory",
370
+ "default": "powersync",
371
+ "hasDynamicHelp": false,
372
+ "multiple": false,
373
+ "type": "option"
374
+ }
375
+ },
376
+ "hasDynamicHelp": false,
377
+ "hiddenAliases": [],
378
+ "id": "validate",
379
+ "pluginAlias": "powersync",
380
+ "pluginName": "powersync",
381
+ "pluginType": "core",
382
+ "strict": true,
383
+ "summary": "Validate config schema, connections, and sync config before deploy.",
384
+ "enableJsonFlag": false,
385
+ "commandHelpGroup": "INSTANCE",
386
+ "isESM": true,
387
+ "relativePath": [
388
+ "dist",
389
+ "commands",
390
+ "validate.js"
391
+ ]
392
+ },
393
+ "configure:ide": {
4
394
  "aliases": [],
5
395
  "args": {},
6
- "description": "Initialize the CLI.",
396
+ "description": "Configure or guide your IDE setup for the best PowerSync CLI developer experience. Enables YAML schema validation and autocompletion, sets up !env custom tag support, and patches existing config files with language server directives.",
7
397
  "examples": [
8
398
  "<%= config.bin %> <%= command.id %>"
9
399
  ],
10
400
  "flags": {},
11
401
  "hasDynamicHelp": false,
12
402
  "hiddenAliases": [],
13
- "id": "init",
403
+ "id": "configure:ide",
404
+ "pluginAlias": "powersync",
405
+ "pluginName": "powersync",
406
+ "pluginType": "core",
407
+ "strict": true,
408
+ "summary": "Configure your IDE for the best PowerSync CLI developer experience.",
409
+ "enableJsonFlag": false,
410
+ "commandHelpGroup": "PROJECT SETUP",
411
+ "isESM": true,
412
+ "relativePath": [
413
+ "dist",
414
+ "commands",
415
+ "configure",
416
+ "ide.js"
417
+ ]
418
+ },
419
+ "configure": {
420
+ "aliases": [],
421
+ "args": {},
422
+ "description": "Configure your workspace or IDE for PowerSync development.",
423
+ "examples": [
424
+ "<%= config.bin %> <%= command.id %>"
425
+ ],
426
+ "flags": {},
427
+ "hasDynamicHelp": false,
428
+ "hidden": true,
429
+ "hiddenAliases": [],
430
+ "id": "configure",
431
+ "pluginAlias": "powersync",
432
+ "pluginName": "powersync",
433
+ "pluginType": "core",
434
+ "strict": true,
435
+ "summary": "Configure your workspace or IDE for PowerSync development.",
436
+ "enableJsonFlag": false,
437
+ "isESM": true,
438
+ "relativePath": [
439
+ "dist",
440
+ "commands",
441
+ "configure",
442
+ "index.js"
443
+ ]
444
+ },
445
+ "deploy": {
446
+ "aliases": [],
447
+ "args": {},
448
+ "description": "Deploy local config (service.yaml, sync config) to the linked PowerSync Cloud instance.\nValidates connections and sync config before deploying.\nSee also \u001b[34mpowersync deploy sync-config\u001b[39m to deploy only sync config changes.\nSee also \u001b[34mpowersync deploy service-config\u001b[39m to deploy only service config changes.",
449
+ "examples": [
450
+ "<%= config.bin %> <%= command.id %>",
451
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
452
+ ],
453
+ "flags": {
454
+ "deploy-timeout": {
455
+ "description": "Seconds to wait after scheduling a deploy before timing out while polling status (default 300 seconds).",
456
+ "name": "deploy-timeout",
457
+ "default": 300,
458
+ "hasDynamicHelp": false,
459
+ "multiple": false,
460
+ "type": "option"
461
+ },
462
+ "directory": {
463
+ "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.",
464
+ "helpGroup": "PROJECT",
465
+ "name": "directory",
466
+ "default": "powersync",
467
+ "hasDynamicHelp": false,
468
+ "multiple": false,
469
+ "type": "option"
470
+ },
471
+ "instance-id": {
472
+ "dependsOn": [
473
+ "project-id"
474
+ ],
475
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
476
+ "helpGroup": "CLOUD_PROJECT",
477
+ "name": "instance-id",
478
+ "required": false,
479
+ "hasDynamicHelp": false,
480
+ "multiple": false,
481
+ "type": "option"
482
+ },
483
+ "org-id": {
484
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
485
+ "helpGroup": "CLOUD_PROJECT",
486
+ "name": "org-id",
487
+ "required": false,
488
+ "hasDynamicHelp": false,
489
+ "multiple": false,
490
+ "type": "option"
491
+ },
492
+ "project-id": {
493
+ "description": "Project ID. Manually passed if the current context has not been linked.",
494
+ "helpGroup": "CLOUD_PROJECT",
495
+ "name": "project-id",
496
+ "required": false,
497
+ "hasDynamicHelp": false,
498
+ "multiple": false,
499
+ "type": "option"
500
+ }
501
+ },
502
+ "hasDynamicHelp": false,
503
+ "hiddenAliases": [],
504
+ "id": "deploy",
505
+ "pluginAlias": "powersync",
506
+ "pluginName": "powersync",
507
+ "pluginType": "core",
508
+ "strict": true,
509
+ "summary": "[Cloud only] Deploy local config to the linked Cloud instance (connections + auth + sync config).",
510
+ "enableJsonFlag": false,
511
+ "commandHelpGroup": "CLOUD",
512
+ "isESM": true,
513
+ "relativePath": [
514
+ "dist",
515
+ "commands",
516
+ "deploy",
517
+ "index.js"
518
+ ]
519
+ },
520
+ "deploy:service-config": {
521
+ "aliases": [],
522
+ "args": {},
523
+ "description": "Deploy only service config changes (without sync config updates).",
524
+ "examples": [
525
+ "<%= config.bin %> <%= command.id %>",
526
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
527
+ ],
528
+ "flags": {
529
+ "deploy-timeout": {
530
+ "description": "Seconds to wait after scheduling a deploy before timing out while polling status (default 300 seconds).",
531
+ "name": "deploy-timeout",
532
+ "default": 300,
533
+ "hasDynamicHelp": false,
534
+ "multiple": false,
535
+ "type": "option"
536
+ },
537
+ "directory": {
538
+ "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.",
539
+ "helpGroup": "PROJECT",
540
+ "name": "directory",
541
+ "default": "powersync",
542
+ "hasDynamicHelp": false,
543
+ "multiple": false,
544
+ "type": "option"
545
+ },
546
+ "instance-id": {
547
+ "dependsOn": [
548
+ "project-id"
549
+ ],
550
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
551
+ "helpGroup": "CLOUD_PROJECT",
552
+ "name": "instance-id",
553
+ "required": false,
554
+ "hasDynamicHelp": false,
555
+ "multiple": false,
556
+ "type": "option"
557
+ },
558
+ "org-id": {
559
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
560
+ "helpGroup": "CLOUD_PROJECT",
561
+ "name": "org-id",
562
+ "required": false,
563
+ "hasDynamicHelp": false,
564
+ "multiple": false,
565
+ "type": "option"
566
+ },
567
+ "project-id": {
568
+ "description": "Project ID. Manually passed if the current context has not been linked.",
569
+ "helpGroup": "CLOUD_PROJECT",
570
+ "name": "project-id",
571
+ "required": false,
572
+ "hasDynamicHelp": false,
573
+ "multiple": false,
574
+ "type": "option"
575
+ }
576
+ },
577
+ "hasDynamicHelp": false,
578
+ "hiddenAliases": [],
579
+ "id": "deploy:service-config",
580
+ "pluginAlias": "powersync",
581
+ "pluginName": "powersync",
582
+ "pluginType": "core",
583
+ "strict": true,
584
+ "summary": "[Cloud only] Deploy only local service config to the linked Cloud instance.",
585
+ "enableJsonFlag": false,
586
+ "commandHelpGroup": "CLOUD",
587
+ "isESM": true,
588
+ "relativePath": [
589
+ "dist",
590
+ "commands",
591
+ "deploy",
592
+ "service-config.js"
593
+ ]
594
+ },
595
+ "deploy:sync-config": {
596
+ "aliases": [],
597
+ "args": {},
598
+ "description": "Deploy only sync config changes.",
599
+ "examples": [
600
+ "<%= config.bin %> <%= command.id %>",
601
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
602
+ ],
603
+ "flags": {
604
+ "deploy-timeout": {
605
+ "description": "Seconds to wait after scheduling a deploy before timing out while polling status (default 300 seconds).",
606
+ "name": "deploy-timeout",
607
+ "default": 300,
608
+ "hasDynamicHelp": false,
609
+ "multiple": false,
610
+ "type": "option"
611
+ },
612
+ "directory": {
613
+ "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.",
614
+ "helpGroup": "PROJECT",
615
+ "name": "directory",
616
+ "default": "powersync",
617
+ "hasDynamicHelp": false,
618
+ "multiple": false,
619
+ "type": "option"
620
+ },
621
+ "instance-id": {
622
+ "dependsOn": [
623
+ "project-id"
624
+ ],
625
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
626
+ "helpGroup": "CLOUD_PROJECT",
627
+ "name": "instance-id",
628
+ "required": false,
629
+ "hasDynamicHelp": false,
630
+ "multiple": false,
631
+ "type": "option"
632
+ },
633
+ "org-id": {
634
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
635
+ "helpGroup": "CLOUD_PROJECT",
636
+ "name": "org-id",
637
+ "required": false,
638
+ "hasDynamicHelp": false,
639
+ "multiple": false,
640
+ "type": "option"
641
+ },
642
+ "project-id": {
643
+ "description": "Project ID. Manually passed if the current context has not been linked.",
644
+ "helpGroup": "CLOUD_PROJECT",
645
+ "name": "project-id",
646
+ "required": false,
647
+ "hasDynamicHelp": false,
648
+ "multiple": false,
649
+ "type": "option"
650
+ },
651
+ "sync-config-file-path": {
652
+ "description": "Path to a sync config file. If provided, this file will be validated and deployed instead of the default sync-config.yaml.",
653
+ "name": "sync-config-file-path",
654
+ "hasDynamicHelp": false,
655
+ "multiple": false,
656
+ "type": "option"
657
+ }
658
+ },
659
+ "hasDynamicHelp": false,
660
+ "hiddenAliases": [],
661
+ "id": "deploy:sync-config",
14
662
  "pluginAlias": "powersync",
15
663
  "pluginName": "powersync",
16
664
  "pluginType": "core",
17
665
  "strict": true,
666
+ "summary": "[Cloud only] Deploy only local sync config to the linked Cloud instance.",
18
667
  "enableJsonFlag": false,
668
+ "commandHelpGroup": "CLOUD",
19
669
  "isESM": true,
20
670
  "relativePath": [
21
671
  "dist",
22
672
  "commands",
23
- "init.js"
673
+ "deploy",
674
+ "sync-config.js"
24
675
  ]
25
676
  },
26
- "instances": {
677
+ "fetch:config": {
27
678
  "aliases": [],
28
679
  "args": {},
29
- "description": "View list of instances.",
680
+ "description": "Retrieve the current instance config from PowerSync Cloud and print as YAML or JSON.",
30
681
  "examples": [
31
- "<%= config.bin %> <%= command.id %>"
682
+ "<%= config.bin %> <%= command.id %>",
683
+ "<%= config.bin %> <%= command.id %> --output=json"
32
684
  ],
33
- "flags": {},
685
+ "flags": {
686
+ "output": {
687
+ "description": "Output format: yaml or json.",
688
+ "name": "output",
689
+ "default": "yaml",
690
+ "hasDynamicHelp": false,
691
+ "multiple": false,
692
+ "options": [
693
+ "json",
694
+ "yaml"
695
+ ],
696
+ "type": "option"
697
+ },
698
+ "directory": {
699
+ "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.",
700
+ "helpGroup": "PROJECT",
701
+ "name": "directory",
702
+ "default": "powersync",
703
+ "hasDynamicHelp": false,
704
+ "multiple": false,
705
+ "type": "option"
706
+ },
707
+ "instance-id": {
708
+ "dependsOn": [
709
+ "project-id"
710
+ ],
711
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
712
+ "helpGroup": "CLOUD_PROJECT",
713
+ "name": "instance-id",
714
+ "required": false,
715
+ "hasDynamicHelp": false,
716
+ "multiple": false,
717
+ "type": "option"
718
+ },
719
+ "org-id": {
720
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
721
+ "helpGroup": "CLOUD_PROJECT",
722
+ "name": "org-id",
723
+ "required": false,
724
+ "hasDynamicHelp": false,
725
+ "multiple": false,
726
+ "type": "option"
727
+ },
728
+ "project-id": {
729
+ "description": "Project ID. Manually passed if the current context has not been linked.",
730
+ "helpGroup": "CLOUD_PROJECT",
731
+ "name": "project-id",
732
+ "required": false,
733
+ "hasDynamicHelp": false,
734
+ "multiple": false,
735
+ "type": "option"
736
+ }
737
+ },
34
738
  "hasDynamicHelp": false,
35
739
  "hiddenAliases": [],
36
- "id": "instances",
740
+ "id": "fetch:config",
37
741
  "pluginAlias": "powersync",
38
742
  "pluginName": "powersync",
39
743
  "pluginType": "core",
40
744
  "strict": true,
745
+ "summary": "[Cloud only] Print linked Cloud instance config (YAML or JSON).",
41
746
  "enableJsonFlag": false,
747
+ "commandHelpGroup": "CLOUD",
42
748
  "isESM": true,
43
749
  "relativePath": [
44
750
  "dist",
45
751
  "commands",
46
- "instances.js"
752
+ "fetch",
753
+ "config.js"
47
754
  ]
48
755
  },
49
- "instance:config": {
756
+ "fetch": {
50
757
  "aliases": [],
51
758
  "args": {},
52
- "description": "Display the instance config.",
759
+ "description": "Subcommands: list Cloud instances in org/project (fetch instances), print instance config as YAML/JSON (fetch config), or show instance diagnostics (fetch status).",
53
760
  "examples": [
54
761
  "<%= config.bin %> <%= command.id %>"
55
762
  ],
56
763
  "flags": {},
57
764
  "hasDynamicHelp": false,
765
+ "hidden": true,
58
766
  "hiddenAliases": [],
59
- "id": "instance:config",
767
+ "id": "fetch",
60
768
  "pluginAlias": "powersync",
61
769
  "pluginName": "powersync",
62
770
  "pluginType": "core",
63
771
  "strict": true,
772
+ "summary": "List instances, fetch config, or fetch instance diagnostics.",
64
773
  "enableJsonFlag": false,
65
774
  "isESM": true,
66
775
  "relativePath": [
67
776
  "dist",
68
777
  "commands",
69
- "instance",
70
- "config.js"
778
+ "fetch",
779
+ "index.js"
71
780
  ]
72
781
  },
73
- "instance:create": {
782
+ "fetch:instances": {
74
783
  "aliases": [],
75
784
  "args": {},
76
- "description": "Create a new instance.",
785
+ "description": "List PowerSync Cloud and linked instances, Cloud instances are grouped by organization and project.",
77
786
  "examples": [
78
- "<%= config.bin %> <%= command.id %>"
787
+ "<%= config.bin %> <%= command.id %>",
788
+ "<%= config.bin %> <%= command.id %> --project-id=<id> --output=json"
79
789
  ],
80
790
  "flags": {
81
- "name": {
82
- "char": "i",
83
- "description": "Name of the instance.",
84
- "name": "name",
791
+ "org-id": {
792
+ "description": "Optional Organization ID. Defaults to all organizations.",
793
+ "name": "org-id",
794
+ "required": false,
85
795
  "hasDynamicHelp": false,
86
796
  "multiple": false,
87
797
  "type": "option"
88
798
  },
89
- "region": {
90
- "char": "r",
91
- "description": "Region to deploy instance to.",
92
- "name": "region",
799
+ "output": {
800
+ "description": "Output format: human or json.",
801
+ "name": "output",
802
+ "default": "human",
93
803
  "hasDynamicHelp": false,
94
804
  "multiple": false,
805
+ "options": [
806
+ "human",
807
+ "json"
808
+ ],
95
809
  "type": "option"
96
810
  },
97
- "databaseName": {
98
- "char": "n",
99
- "description": "Name of the database.",
100
- "name": "databaseName",
811
+ "output-file": {
812
+ "description": "Optionally write instance information to a file.",
813
+ "name": "output-file",
814
+ "required": false,
101
815
  "hasDynamicHelp": false,
102
816
  "multiple": false,
103
817
  "type": "option"
104
818
  },
105
- "databasePassword": {
106
- "char": "p",
107
- "description": "Password of the database.",
108
- "hidden": true,
109
- "name": "databasePassword",
819
+ "project-id": {
820
+ "description": "Optional Project ID. Defaults to all projects in the org.",
821
+ "name": "project-id",
822
+ "required": false,
110
823
  "hasDynamicHelp": false,
111
824
  "multiple": false,
112
825
  "type": "option"
113
- },
114
- "databaseUsername": {
115
- "char": "u",
116
- "description": "Username of the database.",
117
- "hidden": true,
118
- "name": "databaseUsername",
826
+ }
827
+ },
828
+ "hasDynamicHelp": false,
829
+ "hiddenAliases": [],
830
+ "id": "fetch:instances",
831
+ "pluginAlias": "powersync",
832
+ "pluginName": "powersync",
833
+ "pluginType": "core",
834
+ "strict": true,
835
+ "summary": "List Cloud and linked instances.",
836
+ "enableJsonFlag": false,
837
+ "commandHelpGroup": "CLOUD",
838
+ "isESM": true,
839
+ "relativePath": [
840
+ "dist",
841
+ "commands",
842
+ "fetch",
843
+ "instances.js"
844
+ ]
845
+ },
846
+ "fetch:status": {
847
+ "aliases": [],
848
+ "args": {},
849
+ "description": "Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as human-readable, JSON, or YAML. Cloud and self-hosted.",
850
+ "examples": [
851
+ "<%= config.bin %> <%= command.id %>",
852
+ "<%= config.bin %> <%= command.id %> --output=json",
853
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>"
854
+ ],
855
+ "flags": {
856
+ "output": {
857
+ "description": "Output format: human-readable, json, or yaml.",
858
+ "name": "output",
859
+ "default": "human",
119
860
  "hasDynamicHelp": false,
120
861
  "multiple": false,
862
+ "options": [
863
+ "human",
864
+ "json",
865
+ "yaml"
866
+ ],
121
867
  "type": "option"
122
868
  },
123
- "hostname": {
124
- "char": "h",
125
- "description": "Hostname to connect to database.",
126
- "name": "hostname",
869
+ "api-url": {
870
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
871
+ "exclusive": [
872
+ "instance-id",
873
+ "org-id",
874
+ "project-id"
875
+ ],
876
+ "helpGroup": "SELF_HOSTED_PROJECT",
877
+ "name": "api-url",
878
+ "required": false,
127
879
  "hasDynamicHelp": false,
128
880
  "multiple": false,
129
881
  "type": "option"
130
882
  },
131
- "jwksUri": {
132
- "char": "w",
133
- "description": "JWKS URI (must include https://).",
134
- "name": "jwksUri",
883
+ "instance-id": {
884
+ "dependsOn": [
885
+ "project-id"
886
+ ],
887
+ "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.",
888
+ "helpGroup": "CLOUD_PROJECT",
889
+ "name": "instance-id",
890
+ "required": false,
135
891
  "hasDynamicHelp": false,
136
892
  "multiple": false,
137
893
  "type": "option"
138
894
  },
139
- "jwtAudiences": {
140
- "char": "a",
141
- "description": "JWT audiences (comma separated).",
142
- "name": "jwtAudiences",
143
- "default": "",
895
+ "org-id": {
896
+ "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.",
897
+ "helpGroup": "CLOUD_PROJECT",
898
+ "name": "org-id",
899
+ "required": false,
144
900
  "hasDynamicHelp": false,
145
901
  "multiple": false,
146
902
  "type": "option"
147
903
  },
148
- "port": {
149
- "char": "o",
150
- "description": "Port number to connect to database.",
151
- "name": "port",
904
+ "project-id": {
905
+ "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
906
+ "helpGroup": "CLOUD_PROJECT",
907
+ "name": "project-id",
908
+ "required": false,
152
909
  "hasDynamicHelp": false,
153
910
  "multiple": false,
154
911
  "type": "option"
155
912
  },
156
- "skipInteraction": {
157
- "char": "s",
158
- "description": "Skip interactivity.",
159
- "name": "skipInteraction",
160
- "allowNo": false,
161
- "type": "boolean"
162
- },
163
- "supabaseJWTSecret": {
164
- "char": "j",
165
- "description": "Supabase JWT secret",
166
- "name": "supabaseJWTSecret",
913
+ "directory": {
914
+ "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.",
915
+ "helpGroup": "PROJECT",
916
+ "name": "directory",
917
+ "default": "powersync",
167
918
  "hasDynamicHelp": false,
168
919
  "multiple": false,
169
920
  "type": "option"
170
- },
171
- "useSupabaseAuth": {
172
- "char": "b",
173
- "description": "Use Supabase auth.",
174
- "name": "useSupabaseAuth",
175
- "allowNo": true,
176
- "type": "boolean"
177
921
  }
178
922
  },
179
923
  "hasDynamicHelp": false,
180
924
  "hiddenAliases": [],
181
- "id": "instance:create",
925
+ "id": "fetch:status",
182
926
  "pluginAlias": "powersync",
183
927
  "pluginName": "powersync",
184
928
  "pluginType": "core",
185
929
  "strict": true,
930
+ "summary": "Show instance diagnostics (connections, sync config, replication).",
186
931
  "enableJsonFlag": false,
932
+ "commandHelpGroup": "INSTANCE",
187
933
  "isESM": true,
188
934
  "relativePath": [
189
935
  "dist",
190
936
  "commands",
191
- "instance",
192
- "create.js"
937
+ "status.js"
193
938
  ]
194
939
  },
195
- "instance:deploy": {
940
+ "generate": {
196
941
  "aliases": [],
197
942
  "args": {},
198
- "description": "Deploy changes to an existing instance.",
943
+ "description": "Generate client artifacts: schema (from instance schema + sync config) or a development token for connecting clients. Cloud and self-hosted where supported.",
199
944
  "examples": [
200
945
  "<%= config.bin %> <%= command.id %>"
201
946
  ],
947
+ "flags": {},
948
+ "hasDynamicHelp": false,
949
+ "hidden": true,
950
+ "hiddenAliases": [],
951
+ "id": "generate",
952
+ "pluginAlias": "powersync",
953
+ "pluginName": "powersync",
954
+ "pluginType": "core",
955
+ "strict": true,
956
+ "summary": "Generate client schema or development token.",
957
+ "enableJsonFlag": false,
958
+ "isESM": true,
959
+ "relativePath": [
960
+ "dist",
961
+ "commands",
962
+ "generate",
963
+ "index.js"
964
+ ]
965
+ },
966
+ "generate:schema": {
967
+ "aliases": [],
968
+ "args": {},
969
+ "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.",
970
+ "examples": [
971
+ "<%= config.bin %> <%= command.id %> --output=ts --output-path=schema.ts",
972
+ "<%= config.bin %> <%= command.id %> --output=dart --output-path=lib/schema.dart --instance-id=<id> --project-id=<id>"
973
+ ],
202
974
  "flags": {
203
- "databaseName": {
204
- "char": "n",
205
- "description": "Name of the database.",
206
- "name": "databaseName",
207
- "hasDynamicHelp": false,
208
- "multiple": false,
209
- "type": "option"
210
- },
211
- "databasePassword": {
212
- "char": "p",
213
- "description": "Password of the database.",
214
- "hidden": true,
215
- "name": "databasePassword",
975
+ "output": {
976
+ "description": "Output type: dart, dotNet, js, jsLegacy, kotlin, swift, ts",
977
+ "name": "output",
978
+ "required": true,
979
+ "default": "type",
216
980
  "hasDynamicHelp": false,
217
981
  "multiple": false,
982
+ "options": [
983
+ "dart",
984
+ "dotNet",
985
+ "js",
986
+ "jsLegacy",
987
+ "kotlin",
988
+ "swift",
989
+ "ts"
990
+ ],
218
991
  "type": "option"
219
992
  },
220
- "databaseUsername": {
221
- "char": "u",
222
- "description": "Username of the database.",
223
- "hidden": true,
224
- "name": "databaseUsername",
993
+ "output-path": {
994
+ "description": "Path to output the schema file.",
995
+ "name": "output-path",
996
+ "required": true,
225
997
  "hasDynamicHelp": false,
226
998
  "multiple": false,
227
999
  "type": "option"
228
1000
  },
229
- "hostname": {
230
- "char": "h",
231
- "description": "Hostname to connect to database.",
232
- "name": "hostname",
1001
+ "api-url": {
1002
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
1003
+ "exclusive": [
1004
+ "instance-id",
1005
+ "org-id",
1006
+ "project-id"
1007
+ ],
1008
+ "helpGroup": "SELF_HOSTED_PROJECT",
1009
+ "name": "api-url",
1010
+ "required": false,
233
1011
  "hasDynamicHelp": false,
234
1012
  "multiple": false,
235
1013
  "type": "option"
236
1014
  },
237
- "jwksUri": {
238
- "char": "w",
239
- "description": "JWKS URI (must include https://).",
240
- "name": "jwksUri",
1015
+ "instance-id": {
1016
+ "dependsOn": [
1017
+ "project-id"
1018
+ ],
1019
+ "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.",
1020
+ "helpGroup": "CLOUD_PROJECT",
1021
+ "name": "instance-id",
1022
+ "required": false,
241
1023
  "hasDynamicHelp": false,
242
1024
  "multiple": false,
243
1025
  "type": "option"
244
1026
  },
245
- "jwtAudiences": {
246
- "char": "a",
247
- "description": "JWT audiences (comma separated).",
248
- "name": "jwtAudiences",
249
- "default": "",
1027
+ "org-id": {
1028
+ "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.",
1029
+ "helpGroup": "CLOUD_PROJECT",
1030
+ "name": "org-id",
1031
+ "required": false,
250
1032
  "hasDynamicHelp": false,
251
1033
  "multiple": false,
252
1034
  "type": "option"
253
1035
  },
254
- "port": {
255
- "char": "o",
256
- "description": "Port number to connect to database.",
257
- "name": "port",
1036
+ "project-id": {
1037
+ "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
1038
+ "helpGroup": "CLOUD_PROJECT",
1039
+ "name": "project-id",
1040
+ "required": false,
258
1041
  "hasDynamicHelp": false,
259
1042
  "multiple": false,
260
1043
  "type": "option"
261
1044
  },
262
- "skipInteraction": {
263
- "char": "s",
264
- "description": "Skip interactivity.",
265
- "name": "skipInteraction",
266
- "allowNo": false,
267
- "type": "boolean"
268
- },
269
- "supabaseJWTSecret": {
270
- "char": "j",
271
- "description": "Supabase JWT secret",
272
- "name": "supabaseJWTSecret",
1045
+ "directory": {
1046
+ "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.",
1047
+ "helpGroup": "PROJECT",
1048
+ "name": "directory",
1049
+ "default": "powersync",
273
1050
  "hasDynamicHelp": false,
274
1051
  "multiple": false,
275
1052
  "type": "option"
276
- },
277
- "useSupabaseAuth": {
278
- "char": "b",
279
- "description": "Use Supabase auth.",
280
- "name": "useSupabaseAuth",
281
- "allowNo": true,
282
- "type": "boolean"
283
1053
  }
284
1054
  },
285
1055
  "hasDynamicHelp": false,
286
1056
  "hiddenAliases": [],
287
- "id": "instance:deploy",
1057
+ "id": "generate:schema",
288
1058
  "pluginAlias": "powersync",
289
1059
  "pluginName": "powersync",
290
1060
  "pluginType": "core",
291
1061
  "strict": true,
1062
+ "summary": "Generate client schema file from instance schema and sync config.",
292
1063
  "enableJsonFlag": false,
1064
+ "commandHelpGroup": "INSTANCE",
293
1065
  "isESM": true,
294
1066
  "relativePath": [
295
1067
  "dist",
296
1068
  "commands",
297
- "instance",
298
- "deploy.js"
1069
+ "generate",
1070
+ "schema.js"
299
1071
  ]
300
1072
  },
301
- "instance:destroy": {
1073
+ "generate:token": {
302
1074
  "aliases": [],
303
1075
  "args": {},
304
- "description": "Destroy the current instance - THIS CANNOT BE UNDONE.",
1076
+ "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.",
305
1077
  "examples": [
306
- "<%= config.bin %> <%= command.id %>"
1078
+ "<%= config.bin %> <%= command.id %> --subject=user-123",
1079
+ "<%= config.bin %> <%= command.id %> --subject=user-123 --expires-in-seconds=3600"
307
1080
  ],
308
1081
  "flags": {
309
- "skipConfirmation": {
310
- "char": "s",
311
- "description": "Ignore confirmation question.",
312
- "name": "skipConfirmation",
313
- "allowNo": false,
314
- "type": "boolean"
1082
+ "expires-in-seconds": {
1083
+ "description": "Expiration time in seconds. Default is 43,200 (12 hours).",
1084
+ "name": "expires-in-seconds",
1085
+ "required": false,
1086
+ "default": 43200,
1087
+ "hasDynamicHelp": false,
1088
+ "multiple": false,
1089
+ "type": "option"
1090
+ },
1091
+ "kid": {
1092
+ "description": "[Self-hosted only] Key ID of the key to use for signing the token. If not provided, the first key will be used.",
1093
+ "name": "kid",
1094
+ "required": false,
1095
+ "hasDynamicHelp": false,
1096
+ "multiple": false,
1097
+ "type": "option"
1098
+ },
1099
+ "subject": {
1100
+ "description": "Subject of the token.",
1101
+ "name": "subject",
1102
+ "required": true,
1103
+ "hasDynamicHelp": false,
1104
+ "multiple": false,
1105
+ "type": "option"
1106
+ },
1107
+ "api-url": {
1108
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
1109
+ "exclusive": [
1110
+ "instance-id",
1111
+ "org-id",
1112
+ "project-id"
1113
+ ],
1114
+ "helpGroup": "SELF_HOSTED_PROJECT",
1115
+ "name": "api-url",
1116
+ "required": false,
1117
+ "hasDynamicHelp": false,
1118
+ "multiple": false,
1119
+ "type": "option"
1120
+ },
1121
+ "instance-id": {
1122
+ "dependsOn": [
1123
+ "project-id"
1124
+ ],
1125
+ "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.",
1126
+ "helpGroup": "CLOUD_PROJECT",
1127
+ "name": "instance-id",
1128
+ "required": false,
1129
+ "hasDynamicHelp": false,
1130
+ "multiple": false,
1131
+ "type": "option"
1132
+ },
1133
+ "org-id": {
1134
+ "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.",
1135
+ "helpGroup": "CLOUD_PROJECT",
1136
+ "name": "org-id",
1137
+ "required": false,
1138
+ "hasDynamicHelp": false,
1139
+ "multiple": false,
1140
+ "type": "option"
1141
+ },
1142
+ "project-id": {
1143
+ "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
1144
+ "helpGroup": "CLOUD_PROJECT",
1145
+ "name": "project-id",
1146
+ "required": false,
1147
+ "hasDynamicHelp": false,
1148
+ "multiple": false,
1149
+ "type": "option"
1150
+ },
1151
+ "directory": {
1152
+ "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.",
1153
+ "helpGroup": "PROJECT",
1154
+ "name": "directory",
1155
+ "default": "powersync",
1156
+ "hasDynamicHelp": false,
1157
+ "multiple": false,
1158
+ "type": "option"
315
1159
  }
316
1160
  },
317
1161
  "hasDynamicHelp": false,
318
1162
  "hiddenAliases": [],
319
- "id": "instance:destroy",
1163
+ "id": "generate:token",
320
1164
  "pluginAlias": "powersync",
321
1165
  "pluginName": "powersync",
322
1166
  "pluginType": "core",
323
1167
  "strict": true,
1168
+ "summary": "Generate a development JWT for client connections.",
324
1169
  "enableJsonFlag": false,
1170
+ "commandHelpGroup": "INSTANCE",
325
1171
  "isESM": true,
326
1172
  "relativePath": [
327
1173
  "dist",
328
1174
  "commands",
329
- "instance",
330
- "destroy.js"
1175
+ "generate",
1176
+ "token.js"
331
1177
  ]
332
1178
  },
333
- "instance:generate-dev-token": {
1179
+ "init:cloud": {
334
1180
  "aliases": [],
335
1181
  "args": {},
336
- "description": "Generate a developer token using the Token subject/ User ID.",
1182
+ "description": "Copy a Cloud template into a config directory (default powersync/). Edit service.yaml then run link cloud and deploy.",
337
1183
  "examples": [
338
- "<%= config.bin %> <%= command.id %>"
1184
+ "<%= config.bin %> <%= command.id %>",
1185
+ "<%= config.bin %> <%= command.id %> --directory=powersync"
339
1186
  ],
340
1187
  "flags": {
341
- "expiresInSeconds": {
342
- "char": "e",
343
- "description": "The token expiry in seconds.",
344
- "name": "expiresInSeconds",
345
- "hasDynamicHelp": false,
346
- "multiple": false,
347
- "type": "option"
348
- },
349
- "userId": {
350
- "char": "u",
351
- "description": "The Token subject/User ID for the developer token",
352
- "name": "userId",
1188
+ "directory": {
1189
+ "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.",
1190
+ "helpGroup": "PROJECT",
1191
+ "name": "directory",
1192
+ "default": "powersync",
353
1193
  "hasDynamicHelp": false,
354
1194
  "multiple": false,
355
1195
  "type": "option"
@@ -357,57 +1197,62 @@
357
1197
  },
358
1198
  "hasDynamicHelp": false,
359
1199
  "hiddenAliases": [],
360
- "id": "instance:generate-dev-token",
1200
+ "id": "init:cloud",
361
1201
  "pluginAlias": "powersync",
362
1202
  "pluginName": "powersync",
363
1203
  "pluginType": "core",
364
1204
  "strict": true,
1205
+ "summary": "Scaffold a PowerSync Cloud config directory from a template.",
365
1206
  "enableJsonFlag": false,
1207
+ "commandHelpGroup": "PROJECT SETUP",
366
1208
  "isESM": true,
367
1209
  "relativePath": [
368
1210
  "dist",
369
1211
  "commands",
370
- "instance",
371
- "generate-dev-token.js"
1212
+ "init",
1213
+ "cloud.js"
372
1214
  ]
373
1215
  },
374
- "instance:schema": {
1216
+ "init": {
375
1217
  "aliases": [],
376
1218
  "args": {},
377
- "description": "View the schema of the current instance.",
1219
+ "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.",
378
1220
  "examples": [
379
1221
  "<%= config.bin %> <%= command.id %>"
380
1222
  ],
381
1223
  "flags": {},
382
1224
  "hasDynamicHelp": false,
1225
+ "hidden": true,
383
1226
  "hiddenAliases": [],
384
- "id": "instance:schema",
1227
+ "id": "init",
385
1228
  "pluginAlias": "powersync",
386
1229
  "pluginName": "powersync",
387
1230
  "pluginType": "core",
388
1231
  "strict": true,
1232
+ "summary": "Scaffold a PowerSync config directory from a template.",
389
1233
  "enableJsonFlag": false,
390
1234
  "isESM": true,
391
1235
  "relativePath": [
392
1236
  "dist",
393
1237
  "commands",
394
- "instance",
395
- "schema.js"
1238
+ "init",
1239
+ "index.js"
396
1240
  ]
397
1241
  },
398
- "instance:set": {
1242
+ "init:self-hosted": {
399
1243
  "aliases": [],
400
1244
  "args": {},
401
- "description": "Set the current instance.",
1245
+ "description": "Copy a self-hosted template into a config directory (default powersync/). Configure service.yaml with your self-hosted instance details.",
402
1246
  "examples": [
403
1247
  "<%= config.bin %> <%= command.id %>",
404
- "<%= config.bin %> <%= command.id %> --instanceId=1234"
1248
+ "<%= config.bin %> <%= command.id %> --directory=powersync"
405
1249
  ],
406
1250
  "flags": {
407
- "instanceId": {
408
- "char": "i",
409
- "description": "Instance ID to change to.",
410
- "name": "instanceId",
1251
+ "directory": {
1252
+ "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.",
1253
+ "helpGroup": "PROJECT",
1254
+ "name": "directory",
1255
+ "default": "powersync",
411
1256
  "hasDynamicHelp": false,
412
1257
  "multiple": false,
413
1258
  "type": "option"
@@ -415,57 +1260,67 @@
415
1260
  },
416
1261
  "hasDynamicHelp": false,
417
1262
  "hiddenAliases": [],
418
- "id": "instance:set",
1263
+ "id": "init:self-hosted",
419
1264
  "pluginAlias": "powersync",
420
1265
  "pluginName": "powersync",
421
1266
  "pluginType": "core",
422
1267
  "strict": true,
1268
+ "summary": "Scaffold a PowerSync self-hosted config directory from a template.",
423
1269
  "enableJsonFlag": false,
1270
+ "commandHelpGroup": "PROJECT SETUP",
424
1271
  "isESM": true,
425
1272
  "relativePath": [
426
1273
  "dist",
427
1274
  "commands",
428
- "instance",
429
- "set.js"
1275
+ "init",
1276
+ "self-hosted.js"
430
1277
  ]
431
1278
  },
432
- "instance:status": {
1279
+ "link:cloud": {
433
1280
  "aliases": [],
434
1281
  "args": {},
435
- "description": "View the status of the current instance. View the status of a different instance by using flags.",
1282
+ "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.",
436
1283
  "examples": [
437
- "<%= config.bin %> <%= command.id %>",
438
- "<%= config.bin %> <%= command.id %> --orgId=1234 --projectId=1234 --instanceId=1234 --authToken=1234"
1284
+ "<%= config.bin %> <%= command.id %> --project-id=<project-id>",
1285
+ "<%= config.bin %> <%= command.id %> --create --project-id=<project-id>",
1286
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<project-id> --org-id=<org-id>"
439
1287
  ],
440
1288
  "flags": {
441
- "authToken": {
442
- "char": "t",
443
- "description": "Override current auth token.",
444
- "name": "authToken",
1289
+ "create": {
1290
+ "description": "Create a new Cloud instance in the given org and project, then link. Do not supply --instance-id when using --create.",
1291
+ "name": "create",
1292
+ "allowNo": false,
1293
+ "type": "boolean"
1294
+ },
1295
+ "instance-id": {
1296
+ "description": "PowerSync Cloud instance ID. Omit when using --create. Resolved: flag → INSTANCE_ID → cli.yaml.",
1297
+ "name": "instance-id",
1298
+ "required": false,
445
1299
  "hasDynamicHelp": false,
446
1300
  "multiple": false,
447
1301
  "type": "option"
448
1302
  },
449
- "instanceId": {
450
- "char": "i",
451
- "description": "Override current instance by providing the ID of a different instance.",
452
- "name": "instanceId",
1303
+ "org-id": {
1304
+ "description": "Organization ID. Optional when the token has a single org; required when the token has multiple orgs. Resolved: flag → ORG_ID → cli.yaml.",
1305
+ "name": "org-id",
1306
+ "required": false,
453
1307
  "hasDynamicHelp": false,
454
1308
  "multiple": false,
455
1309
  "type": "option"
456
1310
  },
457
- "orgId": {
458
- "char": "o",
459
- "description": "Override current organization by providing the ID of a different organization.",
460
- "name": "orgId",
1311
+ "project-id": {
1312
+ "description": "Project ID. Resolved: flag → PROJECT_ID → cli.yaml.",
1313
+ "name": "project-id",
1314
+ "required": true,
461
1315
  "hasDynamicHelp": false,
462
1316
  "multiple": false,
463
1317
  "type": "option"
464
1318
  },
465
- "projectId": {
466
- "char": "p",
467
- "description": "Override current project by providing the ID of a different project.",
468
- "name": "projectId",
1319
+ "directory": {
1320
+ "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.",
1321
+ "helpGroup": "PROJECT",
1322
+ "name": "directory",
1323
+ "default": "powersync",
469
1324
  "hasDynamicHelp": false,
470
1325
  "multiple": false,
471
1326
  "type": "option"
@@ -473,160 +1328,279 @@
473
1328
  },
474
1329
  "hasDynamicHelp": false,
475
1330
  "hiddenAliases": [],
476
- "id": "instance:status",
1331
+ "id": "link:cloud",
477
1332
  "pluginAlias": "powersync",
478
1333
  "pluginName": "powersync",
479
1334
  "pluginType": "core",
480
1335
  "strict": true,
1336
+ "summary": "[Cloud only] Link to a PowerSync Cloud instance (or create one with --create).",
481
1337
  "enableJsonFlag": false,
1338
+ "commandHelpGroup": "PROJECT SETUP",
482
1339
  "isESM": true,
483
1340
  "relativePath": [
484
1341
  "dist",
485
1342
  "commands",
486
- "instance",
487
- "status.js"
1343
+ "link",
1344
+ "cloud.js"
488
1345
  ]
489
1346
  },
490
- "instance:stop": {
1347
+ "link": {
491
1348
  "aliases": [],
492
1349
  "args": {},
493
- "description": "Stop the current instance.",
1350
+ "description": "Write cli.yaml so this directory's config is bound to a PowerSync instance. Once linked, commands use that instance without passing IDs. Use link cloud or link self-hosted.",
494
1351
  "examples": [
495
1352
  "<%= config.bin %> <%= command.id %>"
496
1353
  ],
497
- "flags": {
498
- "skipConfirmation": {
499
- "char": "s",
500
- "description": "Ignore confirmation question.",
501
- "name": "skipConfirmation",
502
- "allowNo": false,
503
- "type": "boolean"
504
- }
505
- },
1354
+ "flags": {},
506
1355
  "hasDynamicHelp": false,
1356
+ "hidden": true,
507
1357
  "hiddenAliases": [],
508
- "id": "instance:stop",
1358
+ "id": "link",
509
1359
  "pluginAlias": "powersync",
510
1360
  "pluginName": "powersync",
511
1361
  "pluginType": "core",
512
1362
  "strict": true,
1363
+ "summary": "Bind this directory to a Cloud or self-hosted instance (writes cli.yaml).",
513
1364
  "enableJsonFlag": false,
514
1365
  "isESM": true,
515
1366
  "relativePath": [
516
1367
  "dist",
517
1368
  "commands",
518
- "instance",
519
- "stop.js"
1369
+ "link",
1370
+ "index.js"
520
1371
  ]
521
1372
  },
522
- "instance:sync-rules:deploy": {
1373
+ "link:self-hosted": {
523
1374
  "aliases": [],
524
1375
  "args": {},
525
- "description": "Deploy sync rules from a local sync rules config file to the current instance.",
1376
+ "description": "Links a self hosted PowerSync instance by API URL.\nAPI Keys can be specified via input or specified in the PS_ADMIN_TOKEN environment variable.",
526
1377
  "examples": [
527
- "<%= config.bin %> <%= command.id %>",
528
- "<%= config.bin %> <%= command.id %> --filePath path/to/file",
529
- "<%= config.bin %> <%= command.id %> -f path/to/file"
1378
+ "<%= config.bin %> <%= command.id %> --api-url=https://powersync.example.com"
530
1379
  ],
531
1380
  "flags": {
532
- "filePath": {
533
- "char": "f",
534
- "description": "Path to the sync rules config file.",
535
- "name": "filePath",
1381
+ "api-url": {
1382
+ "description": "Self-hosted PowerSync API base URL (e.g. https://powersync.example.com).",
1383
+ "name": "api-url",
536
1384
  "required": true,
537
1385
  "hasDynamicHelp": false,
538
1386
  "multiple": false,
539
1387
  "type": "option"
540
1388
  },
541
- "skipConfirmation": {
542
- "char": "s",
543
- "description": "Ignore confirmation question.",
544
- "name": "skipConfirmation",
545
- "allowNo": false,
546
- "type": "boolean"
1389
+ "directory": {
1390
+ "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.",
1391
+ "helpGroup": "PROJECT",
1392
+ "name": "directory",
1393
+ "default": "powersync",
1394
+ "hasDynamicHelp": false,
1395
+ "multiple": false,
1396
+ "type": "option"
547
1397
  }
548
1398
  },
549
1399
  "hasDynamicHelp": false,
550
1400
  "hiddenAliases": [],
551
- "id": "instance:sync-rules:deploy",
1401
+ "id": "link:self-hosted",
552
1402
  "pluginAlias": "powersync",
553
1403
  "pluginName": "powersync",
554
1404
  "pluginType": "core",
555
1405
  "strict": true,
1406
+ "summary": "Link to a self-hosted PowerSync instance by API URL.",
556
1407
  "enableJsonFlag": false,
1408
+ "commandHelpGroup": "PROJECT SETUP",
557
1409
  "isESM": true,
558
1410
  "relativePath": [
559
1411
  "dist",
560
1412
  "commands",
561
- "instance",
562
- "sync-rules",
563
- "deploy.js"
1413
+ "link",
1414
+ "self-hosted.js"
564
1415
  ]
565
1416
  },
566
- "instance:sync-rules:generate-schema": {
1417
+ "migrate": {
567
1418
  "aliases": [],
568
1419
  "args": {},
569
- "description": "Generate schema in your language from your sync rules config file.",
570
- "examples": [
571
- "<%= config.bin %> <%= command.id %>",
572
- "<%= config.bin %> <%= command.id %> --filePath path/to/file",
573
- "<%= config.bin %> <%= command.id %> -f path/to/file"
574
- ],
1420
+ "description": "Migrate PowerSync config to newer formats. Use migrate sync-rules to convert Sync Rules to Sync Streams.",
1421
+ "flags": {},
1422
+ "hasDynamicHelp": false,
1423
+ "hidden": true,
1424
+ "hiddenAliases": [],
1425
+ "id": "migrate",
1426
+ "pluginAlias": "powersync",
1427
+ "pluginName": "powersync",
1428
+ "pluginType": "core",
1429
+ "strict": true,
1430
+ "summary": "Migrate config to newer formats (e.g. Sync Rules → Sync Streams).",
1431
+ "enableJsonFlag": false,
1432
+ "isESM": true,
1433
+ "relativePath": [
1434
+ "dist",
1435
+ "commands",
1436
+ "migrate",
1437
+ "index.js"
1438
+ ]
1439
+ },
1440
+ "migrate:sync-rules": {
1441
+ "aliases": [],
1442
+ "args": {},
1443
+ "description": "Migrates Sync Rules to Sync Streams",
575
1444
  "flags": {
576
- "filePath": {
577
- "char": "f",
578
- "description": "Path to the sync rules config file.",
579
- "name": "filePath",
580
- "required": true,
1445
+ "input-file": {
1446
+ "description": "Path to the input sync rules file. Defaults to the project sync-config.yaml file.",
1447
+ "name": "input-file",
1448
+ "required": false,
581
1449
  "hasDynamicHelp": false,
582
1450
  "multiple": false,
583
1451
  "type": "option"
584
1452
  },
585
- "language": {
586
- "char": "l",
587
- "description": "Choose language for output.",
588
- "name": "language",
1453
+ "output-file": {
1454
+ "description": "Path to the output sync streams file. Defaults to overwrite the input file.",
1455
+ "name": "output-file",
1456
+ "required": false,
589
1457
  "hasDynamicHelp": false,
590
1458
  "multiple": false,
591
- "options": [
592
- "js",
593
- "dart"
1459
+ "type": "option"
1460
+ },
1461
+ "api-url": {
1462
+ "description": "[Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with --instance-id). Resolved: flag → cli.yaml → API_URL.",
1463
+ "exclusive": [
1464
+ "instance-id",
1465
+ "org-id",
1466
+ "project-id"
1467
+ ],
1468
+ "helpGroup": "SELF_HOSTED_PROJECT",
1469
+ "name": "api-url",
1470
+ "required": false,
1471
+ "hasDynamicHelp": false,
1472
+ "multiple": false,
1473
+ "type": "option"
1474
+ },
1475
+ "instance-id": {
1476
+ "dependsOn": [
1477
+ "project-id"
594
1478
  ],
1479
+ "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.",
1480
+ "helpGroup": "CLOUD_PROJECT",
1481
+ "name": "instance-id",
1482
+ "required": false,
1483
+ "hasDynamicHelp": false,
1484
+ "multiple": false,
1485
+ "type": "option"
1486
+ },
1487
+ "org-id": {
1488
+ "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.",
1489
+ "helpGroup": "CLOUD_PROJECT",
1490
+ "name": "org-id",
1491
+ "required": false,
1492
+ "hasDynamicHelp": false,
1493
+ "multiple": false,
1494
+ "type": "option"
1495
+ },
1496
+ "project-id": {
1497
+ "description": "[Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.",
1498
+ "helpGroup": "CLOUD_PROJECT",
1499
+ "name": "project-id",
1500
+ "required": false,
1501
+ "hasDynamicHelp": false,
1502
+ "multiple": false,
1503
+ "type": "option"
1504
+ },
1505
+ "directory": {
1506
+ "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.",
1507
+ "helpGroup": "PROJECT",
1508
+ "name": "directory",
1509
+ "default": "powersync",
1510
+ "hasDynamicHelp": false,
1511
+ "multiple": false,
595
1512
  "type": "option"
596
1513
  }
597
1514
  },
598
1515
  "hasDynamicHelp": false,
599
1516
  "hiddenAliases": [],
600
- "id": "instance:sync-rules:generate-schema",
1517
+ "id": "migrate:sync-rules",
1518
+ "pluginAlias": "powersync",
1519
+ "pluginName": "powersync",
1520
+ "pluginType": "core",
1521
+ "strict": true,
1522
+ "summary": "Migrates Sync Rules to Sync Streams",
1523
+ "enableJsonFlag": false,
1524
+ "commandHelpGroup": "INSTANCE",
1525
+ "isESM": true,
1526
+ "relativePath": [
1527
+ "dist",
1528
+ "commands",
1529
+ "migrate",
1530
+ "sync-rules.js"
1531
+ ]
1532
+ },
1533
+ "pull": {
1534
+ "aliases": [],
1535
+ "args": {},
1536
+ "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).",
1537
+ "examples": [
1538
+ "<%= config.bin %> <%= command.id %>"
1539
+ ],
1540
+ "flags": {},
1541
+ "hasDynamicHelp": false,
1542
+ "hidden": true,
1543
+ "hiddenAliases": [],
1544
+ "id": "pull",
601
1545
  "pluginAlias": "powersync",
602
1546
  "pluginName": "powersync",
603
1547
  "pluginType": "core",
604
1548
  "strict": true,
1549
+ "summary": "[Cloud only] Download Cloud config into local service.yaml and sync-config.yaml.",
605
1550
  "enableJsonFlag": false,
606
1551
  "isESM": true,
607
1552
  "relativePath": [
608
1553
  "dist",
609
1554
  "commands",
610
- "instance",
611
- "sync-rules",
612
- "generate-schema.js"
1555
+ "pull",
1556
+ "index.js"
613
1557
  ]
614
1558
  },
615
- "instance:sync-rules:validate": {
1559
+ "pull:instance": {
616
1560
  "aliases": [],
617
1561
  "args": {},
618
- "description": "Validate sync rules from a local sync rules config file.",
1562
+ "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.",
619
1563
  "examples": [
620
1564
  "<%= config.bin %> <%= command.id %>",
621
- "<%= config.bin %> <%= command.id %> --filePath path/to/file",
622
- "<%= config.bin %> <%= command.id %> -f path/to/file"
1565
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id>",
1566
+ "<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<id> --org-id=<org-id>"
623
1567
  ],
624
1568
  "flags": {
625
- "filePath": {
626
- "char": "f",
627
- "description": "Path to the sync rules config file.",
628
- "name": "filePath",
629
- "required": true,
1569
+ "directory": {
1570
+ "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.",
1571
+ "helpGroup": "PROJECT",
1572
+ "name": "directory",
1573
+ "default": "powersync",
1574
+ "hasDynamicHelp": false,
1575
+ "multiple": false,
1576
+ "type": "option"
1577
+ },
1578
+ "instance-id": {
1579
+ "dependsOn": [
1580
+ "project-id"
1581
+ ],
1582
+ "description": "PowerSync Cloud instance ID. Manually passed if the current context has not been linked.",
1583
+ "helpGroup": "CLOUD_PROJECT",
1584
+ "name": "instance-id",
1585
+ "required": false,
1586
+ "hasDynamicHelp": false,
1587
+ "multiple": false,
1588
+ "type": "option"
1589
+ },
1590
+ "org-id": {
1591
+ "description": "Organization ID (optional). Defaults to the token’s single org when only one is available; pass explicitly if the token has multiple orgs.",
1592
+ "helpGroup": "CLOUD_PROJECT",
1593
+ "name": "org-id",
1594
+ "required": false,
1595
+ "hasDynamicHelp": false,
1596
+ "multiple": false,
1597
+ "type": "option"
1598
+ },
1599
+ "project-id": {
1600
+ "description": "Project ID. Manually passed if the current context has not been linked.",
1601
+ "helpGroup": "CLOUD_PROJECT",
1602
+ "name": "project-id",
1603
+ "required": false,
630
1604
  "hasDynamicHelp": false,
631
1605
  "multiple": false,
632
1606
  "type": "option"
@@ -634,21 +1608,22 @@
634
1608
  },
635
1609
  "hasDynamicHelp": false,
636
1610
  "hiddenAliases": [],
637
- "id": "instance:sync-rules:validate",
1611
+ "id": "pull:instance",
638
1612
  "pluginAlias": "powersync",
639
1613
  "pluginName": "powersync",
640
1614
  "pluginType": "core",
641
1615
  "strict": true,
1616
+ "summary": "[Cloud only] Pull an existing Cloud instance: link and download config into local service.yaml and sync-config.yaml.",
642
1617
  "enableJsonFlag": false,
1618
+ "commandHelpGroup": "PROJECT SETUP",
643
1619
  "isESM": true,
644
1620
  "relativePath": [
645
1621
  "dist",
646
1622
  "commands",
647
- "instance",
648
- "sync-rules",
649
- "validate.js"
1623
+ "pull",
1624
+ "instance.js"
650
1625
  ]
651
1626
  }
652
1627
  },
653
- "version": "0.7.1"
1628
+ "version": "0.9.0"
654
1629
  }