powersync 0.0.0-dev-20260305082615

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 (99) hide show
  1. package/LICENSE +67 -0
  2. package/README.md +1596 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/dev.js +22 -0
  5. package/bin/run.cmd +3 -0
  6. package/bin/run.js +12 -0
  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/generate/index.d.ts +8 -0
  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/index.d.ts +8 -0
  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/link/index.d.ts +8 -0
  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/pull/index.d.ts +8 -0
  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/dist/index.d.ts +1 -0
  90. package/dist/index.js +1 -0
  91. package/oclif.manifest.json +1629 -0
  92. package/package.json +131 -0
  93. package/templates/cloud/powersync/cli.yaml +3 -0
  94. package/templates/cloud/powersync/service.yaml +174 -0
  95. package/templates/cloud/powersync/sync-config.yaml +22 -0
  96. package/templates/self-hosted/base/powersync/cli.yaml +3 -0
  97. package/templates/self-hosted/base/powersync/service.yaml +243 -0
  98. package/templates/self-hosted/base/powersync/sync-config.yaml +22 -0
  99. package/templates/vscode/settings.json +3 -0
package/README.md ADDED
@@ -0,0 +1,1596 @@
1
+ # powersync
2
+
3
+ Programmatically manage your PowerSync environment.
4
+
5
+ For an overview, see the docs [here](https://docs.powersync.com/tools/cli).
6
+
7
+ ## Note: Beta Release
8
+
9
+ This package is currently in a [beta release](https://docs.powersync.com/resources/feature-status).
10
+
11
+ ## Upgrading from 0.8.0
12
+
13
+ Version 0.9.0 and above are **not backwards compatible** with 0.8.0. If you are using the previous CLI commands and are not ready to migrate, you can continue using the old version:
14
+
15
+ ```bash
16
+ npm install -g @powersync/cli@0.8.0
17
+ ```
18
+
19
+ Otherwise, refer to the [docs](https://docs.powersync.com/tools/cli) for guidance on migrating to the new version.
20
+
21
+ [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
22
+ [![Version](https://img.shields.io/npm/v/@powersync/cli.svg)](https://npmjs.org/package/@powersync/cli)
23
+ [![Downloads/week](https://img.shields.io/npm/dw/@powersync/cli.svg)](https://npmjs.org/package/@powersync/cli)
24
+
25
+ <!-- toc -->
26
+
27
+ - [powersync](#powersync)
28
+ - [Getting Started](#getting-started)
29
+ - [Overview](#overview)
30
+ - [Cloud](#cloud)
31
+ - [Self-hosted](#self-hosted)
32
+ - [powersync/service.yaml (self-hosted instance config)](#powersyncserviceyaml-self-hosted-instance-config)
33
+ - [powersync/cli.yaml (self-hosted)](#powersynccliyaml-self-hosted)
34
+ - [Known Limitations](#known-limitations)
35
+ - [OCLIF plugins](#oclif-plugins)
36
+ - [list installed plugins](#list-installed-plugins)
37
+ - [install a published plugin](#install-a-published-plugin)
38
+ - [link a local plugin during development](#link-a-local-plugin-during-development)
39
+ - [inspect a plugin](#inspect-a-plugin)
40
+ - [Usage](#usage)
41
+ - [Commands](#commands)
42
+ <!-- tocstop -->
43
+
44
+ # Getting Started
45
+
46
+ Install globally or run via `npx`:
47
+
48
+ ```bash
49
+ npm install -g powersync
50
+ ```
51
+
52
+ ```bash
53
+ npx powersync --version
54
+ ```
55
+
56
+ # Overview
57
+
58
+ The PowerSync CLI lets you manage PowerSync instances and run commands (generate schemas, tokens, validate config, fetch status, and more). Support is split into two modes:
59
+
60
+ - **Cloud** – Full support for [PowerSync Cloud](https://powersync.com). You can create new instances, deploy and pull config from the Dashboard, and run all Cloud commands. Authenticate with **`powersync login`** (or the `PS_ADMIN_TOKEN` env var), then use **`powersync init cloud`** / **`powersync link cloud`** or **`powersync pull instance`** to work with projects.
61
+ - **Self-hosted** – Limited support for your own PowerSync Service. You link to an existing running instance and can run a subset of commands (e.g. **`powersync status`**, **`powersync generate schema`**, **`powersync validate`**). The CLI does not create, deploy to, or pull config from self-hosted instances; you manage the server and its config yourself. We also expose a [PowerSync Docker topic](../plugins/docker/README.md) for local self-hosted development.
62
+
63
+ The sections below go into detail for [Cloud](#cloud) and [Self-hosted](#self-hosted).
64
+
65
+ # Cloud
66
+
67
+ The CLI supports **PowerSync Cloud** for creating instances, deploying config, pulling config, and running commands. Cloud workflows use a **config directory** (default `powersync/`) containing **`service.yaml`**, **`sync-config.yaml`**, and optionally **`cli.yaml`** (the link file written by **powersync link cloud**). All PowerSync YAML files support the **`!env`** custom tag (e.g. `!env MY_VAR` or `!env MY_VAR::number`) for secrets and environment-specific values.
68
+
69
+ ## Login
70
+
71
+ Cloud commands require a PowerSync **personal access token (PAT)**. You can authenticate in two ways:
72
+
73
+ **1. Interactive login (recommended for local use)**
74
+ Run **`powersync login`**. You can either open a browser to create a token in the [PowerSync Dashboard](https://dashboard.powersync.com/account/access-tokens/create) or paste an existing token.
75
+
76
+ - If secure storage is available, the token is saved there (for example, macOS Keychain).
77
+ - If secure storage is unavailable, the CLI asks for confirmation before storing the token in plaintext at **`$XDG_CONFIG_HOME/powersync/config.yaml`** (or **`~/.config/powersync/config.yaml`** when `XDG_CONFIG_HOME` is unset).
78
+ - If you decline, login exits without storing a token.
79
+
80
+ **2. Environment variable (CI, scripts, or non-persistent use)**
81
+ Set **`PS_ADMIN_TOKEN`** to your PAT. The CLI uses **`PS_ADMIN_TOKEN`** when set; otherwise it uses the token from **`powersync login`**. Example:
82
+
83
+ ```sh
84
+ export PS_ADMIN_TOKEN=your-personal-access-token
85
+ powersync fetch instances
86
+ ```
87
+
88
+ To stop using stored credentials, run **`powersync logout`**. This clears the stored token from the active backend (secure storage or config-file fallback).
89
+
90
+ ## Creating a new instance
91
+
92
+ Run **`powersync init cloud`** to scaffold the config directory. Configure **`service.yaml`** (name, region, replication, optional client auth) and sync config; use **`!env`** for all secrets. Then run **`powersync link cloud --create`** with `--project-id` to create the instance and write **`cli.yaml`**. (Add `--org-id` only if your token has access to multiple organizations.) After that you can run **`powersync deploy`** and manage config from the project (or switch to managing it externally if you prefer).
93
+
94
+ ```sh
95
+ powersync init cloud
96
+ # then edit powersync/service.yaml and sync config
97
+ powersync login
98
+ powersync link cloud --create --project-id=<project-id> # add --org-id if token has multiple orgs
99
+ powersync deploy
100
+ ```
101
+
102
+ Use `--directory` for a different config folder. The **powersync init cloud** command has a `--vscode` flag to configure your workspace for YAML custom tag support.
103
+
104
+ ## Cloud secrets format (`service.yaml`)
105
+
106
+ For Cloud config, secret-backed fields use an object shape. For example, the replication connection password is configured as `replication.connections[].password`.
107
+
108
+ Use `secret: !env ...` when you want to provide the value from an environment variable during deploy:
109
+
110
+ ```yaml
111
+ replication:
112
+ connections:
113
+ - type: postgresql
114
+ password:
115
+ secret: !env POWERSYNC_DATABASE_PASSWORD
116
+ ```
117
+
118
+ After an initial deploy, you can keep using the same stored value by switching to `secret_ref` and referencing the default password secret:
119
+
120
+ ```yaml
121
+ replication:
122
+ connections:
123
+ - type: postgresql
124
+ password:
125
+ secret_ref: default_password
126
+ ```
127
+
128
+ This avoids re-supplying the raw password in subsequent deploys while reusing the previously stored secret.
129
+
130
+ ## Using an existing instance (pull)
131
+
132
+ Run **`powersync pull instance`** with the instance identifiers (from the PowerSync Dashboard URL or **`powersync fetch instances`**). This creates the config directory, writes **`cli.yaml`**, and downloads **`service.yaml`** and **`sync-config.yaml`**. Edit as needed, then run **`powersync deploy`**.
133
+
134
+ ```sh
135
+ powersync login
136
+ powersync pull instance --project-id=<project-id> --instance-id=<instance-id> # add --org-id if multiple orgs
137
+ # then edit powersync/service.yaml and sync-config.yaml as needed
138
+ powersync deploy
139
+ ```
140
+
141
+ To refresh local config after external edits from the cloud when already linked, run **`powersync pull instance`** again.
142
+
143
+ ## Running commands against externally managed instances
144
+
145
+ You can run CLI commands (e.g. **`powersync generate schema`**, **`powersync generate token`**, **`powersync status`**) against a Cloud instance whose configuration is managed elsewhere—for example in the PowerSync Dashboard. No local config directory or link file is required.
146
+
147
+ Specify the instance using **environment variables** or **CLI flags** (flags take precedence): `--instance-id` and `--project-id` (or `INSTANCE_ID`, `PROJECT_ID`). **`--org-id` is optional**: when omitted, the CLI uses the token’s single organization if the token has access to exactly one; if the token has multiple orgs, you must pass **`--org-id`** (or set `ORG_ID`).
148
+
149
+ ```sh
150
+ powersync login
151
+ powersync generate schema --instance-id=<id> --project-id=<project-id> --output-path=schema.ts --output=ts # add --org-id if multiple orgs
152
+ # or with env vars (set ORG_ID only if your token has multiple orgs):
153
+ export PROJECT_ID=<project-id>
154
+ export INSTANCE_ID=<instance-id>
155
+ powersync generate schema --output-path=schema.ts --output=ts
156
+ ```
157
+
158
+ **Tip:** To avoid passing instance params on every command, run **`powersync link cloud`** (e.g. `powersync link cloud --instance-id=<id> --project-id=<project-id>`) once. The CLI writes `cli.yaml` in the current directory, and subsequent commands use that instance without flags or env vars.
159
+
160
+ # Self-hosted
161
+
162
+ The CLI can run a subset of commands against **self-hosted** PowerSync instances (your own API). Self-hosted support is more limited than Cloud: you link to an existing running API and use the same config directory concept, but only certain commands apply (e.g. **`powersync status`**, **`powersync generate schema`**, **`powersync generate token`**, **`powersync validate`**). There is no **deploy** or **pull instance** for self-hosted; you manage config on the server yourself.
163
+
164
+ ## Authentication
165
+
166
+ For any self-hosted instance (local or remote), you must link the running API to the CLI and configure an API key. On the **server** (your PowerSync instance config), define the tokens that are valid in **`service.yaml`**:
167
+
168
+ ```yaml
169
+ # powersync/service.yaml (self-hosted instance config)
170
+ api:
171
+ tokens:
172
+ - dev-token-do-not-use-in-production # or use !env MY_API_TOKEN for secrets
173
+ ```
174
+
175
+ Then tell the CLI which token to use when running commands. Run **`powersync link self-hosted --api-url <url>`** to write **`cli.yaml`** with the API URL, and either set the **`PS_ADMIN_TOKEN`** environment variable or set **`api_key`** in **`cli.yaml`**:
176
+
177
+ ```yaml
178
+ # powersync/cli.yaml (self-hosted)
179
+ type: self-hosted
180
+ api_url: https://powersync.example.com
181
+ api_key: !env PS_ADMIN_TOKEN # or a literal value matching one of the tokens in service.yaml
182
+ ```
183
+
184
+ The CLI resolves **`!env PS_ADMIN_TOKEN`** from the `PS_ADMIN_TOKEN` environment variable at runtime. If both are set, the environment variable takes precedence.
185
+
186
+ ## Creating a self-hosted project and limitations
187
+
188
+ Run **`powersync init self-hosted`** to scaffold a config directory. Edit **`service.yaml`** with your instance details and use **`!env`** for secrets. This gives you a **partial** project: the CLI does not create or provision a self-hosted instance. You must already have a running PowerSync API. The CLI cannot deploy config to or pull config from a self-hosted instance; you manage **`service.yaml`** and **`sync-config.yaml`** on the server yourself. Use the CLI to link (**`powersync link self-hosted --api-url <url>`**), then run the supported commands (e.g. **`powersync status`**, **`powersync generate schema`**) against that API.
189
+
190
+ ```sh
191
+ powersync init self-hosted
192
+ # then edit powersync/service.yaml
193
+ powersync link self-hosted --api-url https://powersync.example.com
194
+ powersync status
195
+ ```
196
+
197
+ Use `--directory` for a different config folder.
198
+
199
+ ## PowerSync Docker topic for local development
200
+
201
+ We expose a [PowerSync Docker topic](../plugins/docker/README.md) for running a self-hosted stack locally. Use **`powersync docker configure`** then **`powersync docker start`** to run the stack. Use **`powersync docker reset`** only when you need to start from a clean state (stop and remove, then start).
202
+
203
+ ## Command support
204
+
205
+ Only some CLI commands work with self-hosted instances. Supported commands include **`powersync status`**, **`powersync generate schema`**, **`powersync generate token`**, **`powersync validate`**, and **`powersync link self-hosted`**. Cloud-only commands such as **`powersync deploy`**, **`powersync destroy`**, **`powersync pull instance`**, **`powersync fetch config`**, and **`powersync fetch instances`** do not apply to self-hosted.
206
+
207
+ # Known Limitations
208
+
209
+ - **Plaintext fallback storage**: When secure storage is unavailable, login can store the token in plaintext config (`$XDG_CONFIG_HOME/powersync/config.yaml` or `~/.config/powersync/config.yaml`) only after explicit confirmation.
210
+
211
+ # OCLIF plugins
212
+
213
+ The CLI honors standard [OCLIF plugin behavior](https://oclif.io/docs/plugins/), so plugins can register commands or hook into command lifecycles. The bundled PowerSync Docker topic (`@powersync/cli-plugin-docker`) is implemented this way and serves as a reference.
214
+
215
+ For PowerSync-specific plugins, the optional `@powersync/cli-core` package exposes base command helpers and shared types; the PowerSync Docker topic consumes these helpers to add its Docker-focused commands.
216
+
217
+ You can manage plugins dynamically at runtime:
218
+
219
+ ```sh
220
+ # list installed plugins
221
+ powersync plugins
222
+
223
+ # install a published plugin
224
+ powersync plugins install @example/powersync-plugin-foo
225
+
226
+ # link a local plugin during development
227
+ powersync plugins link ../my-plugin
228
+
229
+ # inspect a plugin
230
+ powersync plugins:inspect @example/powersync-plugin-foo
231
+ ```
232
+
233
+ # Usage
234
+
235
+ <!-- usage -->
236
+
237
+ ```sh-session
238
+ $ npm install -g powersync
239
+ $ powersync COMMAND
240
+ running command...
241
+ $ powersync (--version)
242
+ powersync/0.0.0-dev-20260305082615 linux-x64 node-v24.14.0
243
+ $ powersync --help [COMMAND]
244
+ USAGE
245
+ $ powersync COMMAND
246
+ ...
247
+ ```
248
+
249
+ <!-- usagestop -->
250
+
251
+ ## Environment variables
252
+
253
+ You can supply instance and auth context via environment variables (useful for CI or scripts):
254
+
255
+ - **`PS_ADMIN_TOKEN`** — PowerSync personal access token for Cloud commands. [Learn more](https://docs.powersync.com/usage/tools/cli#personal-access-token).
256
+ - **`ORG_ID`** — Organization ID (optional for Cloud). Omit when your token has a single organization; required when it has multiple.
257
+ - **`PROJECT_ID`** — Project ID (Cloud).
258
+ - **`INSTANCE_ID`** — Instance ID (Cloud). Get IDs from the [PowerSync Dashboard](https://dashboard.powersync.com) or **`powersync fetch instances`**.
259
+ - **`API_URL`** — Self-hosted PowerSync API base URL (e.g. `https://powersync.example.com`).
260
+
261
+ Example (Cloud):
262
+
263
+ ```sh
264
+ PS_ADMIN_TOKEN=your-token PROJECT_ID=456 INSTANCE_ID=789 powersync status
265
+ ```
266
+
267
+ See [docs/usage.md](../docs/usage.md) for full usage and resolution order (flags, env, cli.yaml).
268
+
269
+ # Commands
270
+
271
+ <!-- commands -->
272
+
273
+ - [`powersync autocomplete [SHELL]`](#powersync-autocomplete-shell)
274
+ - [`powersync commands`](#powersync-commands)
275
+ - [`powersync configure ide`](#powersync-configure-ide)
276
+ - [`powersync deploy`](#powersync-deploy)
277
+ - [`powersync deploy service-config`](#powersync-deploy-service-config)
278
+ - [`powersync deploy sync-config`](#powersync-deploy-sync-config)
279
+ - [`powersync destroy`](#powersync-destroy)
280
+ - [`powersync docker configure`](#powersync-docker-configure)
281
+ - [`powersync docker reset`](#powersync-docker-reset)
282
+ - [`powersync docker start`](#powersync-docker-start)
283
+ - [`powersync docker stop`](#powersync-docker-stop)
284
+ - [`powersync edit config`](#powersync-edit-config)
285
+ - [`powersync fetch config`](#powersync-fetch-config)
286
+ - [`powersync fetch instances`](#powersync-fetch-instances)
287
+ - [`powersync fetch status`](#powersync-fetch-status)
288
+ - [`powersync generate schema`](#powersync-generate-schema)
289
+ - [`powersync generate token`](#powersync-generate-token)
290
+ - [`powersync help [COMMAND]`](#powersync-help-command)
291
+ - [`powersync init cloud`](#powersync-init-cloud)
292
+ - [`powersync init self-hosted`](#powersync-init-self-hosted)
293
+ - [`powersync link cloud`](#powersync-link-cloud)
294
+ - [`powersync link self-hosted`](#powersync-link-self-hosted)
295
+ - [`powersync login`](#powersync-login)
296
+ - [`powersync logout`](#powersync-logout)
297
+ - [`powersync migrate sync-rules`](#powersync-migrate-sync-rules)
298
+ - [`powersync plugins`](#powersync-plugins)
299
+ - [`powersync plugins add PLUGIN`](#powersync-plugins-add-plugin)
300
+ - [`powersync plugins:inspect PLUGIN...`](#powersync-pluginsinspect-plugin)
301
+ - [`powersync plugins install PLUGIN`](#powersync-plugins-install-plugin)
302
+ - [`powersync plugins link PATH`](#powersync-plugins-link-path)
303
+ - [`powersync plugins remove [PLUGIN]`](#powersync-plugins-remove-plugin)
304
+ - [`powersync plugins reset`](#powersync-plugins-reset)
305
+ - [`powersync plugins uninstall [PLUGIN]`](#powersync-plugins-uninstall-plugin)
306
+ - [`powersync plugins unlink [PLUGIN]`](#powersync-plugins-unlink-plugin)
307
+ - [`powersync plugins update`](#powersync-plugins-update)
308
+ - [`powersync pull instance`](#powersync-pull-instance)
309
+ - [`powersync status`](#powersync-status)
310
+ - [`powersync stop`](#powersync-stop)
311
+ - [`powersync validate`](#powersync-validate)
312
+
313
+ ## `powersync autocomplete [SHELL]`
314
+
315
+ Display autocomplete installation instructions.
316
+
317
+ ```
318
+ USAGE
319
+ $ powersync autocomplete [SHELL] [-r]
320
+
321
+ ARGUMENTS
322
+ [SHELL] (zsh|bash|powershell) Shell type
323
+
324
+ FLAGS
325
+ -r, --refresh-cache Refresh cache (ignores displaying instructions)
326
+
327
+ DESCRIPTION
328
+ Display autocomplete installation instructions.
329
+
330
+ EXAMPLES
331
+ $ powersync autocomplete
332
+
333
+ $ powersync autocomplete bash
334
+
335
+ $ powersync autocomplete zsh
336
+
337
+ $ powersync autocomplete powershell
338
+
339
+ $ powersync autocomplete --refresh-cache
340
+ ```
341
+
342
+ _See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v3.2.40/src/commands/autocomplete/index.ts)_
343
+
344
+ ## `powersync commands`
345
+
346
+ List all powersync commands.
347
+
348
+ ```
349
+ USAGE
350
+ $ powersync commands [--json] [-c id|plugin|summary|type... | --tree] [--deprecated] [-x | ] [--hidden]
351
+ [--no-truncate | ] [--sort id|plugin|summary|type | ]
352
+
353
+ FLAGS
354
+ -c, --columns=<option>... Only show provided columns (comma-separated).
355
+ <options: id|plugin|summary|type>
356
+ -x, --extended Show extra columns.
357
+ --deprecated Show deprecated commands.
358
+ --hidden Show hidden commands.
359
+ --no-truncate Do not truncate output.
360
+ --sort=<option> [default: id] Property to sort by.
361
+ <options: id|plugin|summary|type>
362
+ --tree Show tree of commands.
363
+
364
+ GLOBAL FLAGS
365
+ --json Format output as json.
366
+
367
+ DESCRIPTION
368
+ List all powersync commands.
369
+ ```
370
+
371
+ _See code: [@oclif/plugin-commands](https://github.com/oclif/plugin-commands/blob/v4.1.40/src/commands/commands.ts)_
372
+
373
+ ## `powersync configure ide`
374
+
375
+ Configure your IDE for the best PowerSync CLI developer experience.
376
+
377
+ ```
378
+ USAGE
379
+ $ powersync configure ide
380
+
381
+ DESCRIPTION
382
+ Configure your IDE for the best PowerSync CLI developer experience.
383
+
384
+ Configure or guide your IDE setup for the best PowerSync CLI developer experience. Enables YAML schema validation and
385
+ autocompletion, sets up !env custom tag support, and patches existing config files with language server directives.
386
+
387
+ EXAMPLES
388
+ $ powersync configure ide
389
+ ```
390
+
391
+ _See code: [src/commands/configure/ide.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/configure/ide.ts)_
392
+
393
+ ## `powersync deploy`
394
+
395
+ [Cloud only] Deploy local config to the linked Cloud instance (connections + auth + sync config).
396
+
397
+ ```
398
+ USAGE
399
+ $ powersync deploy [--deploy-timeout <value>] [--directory <value>] [--instance-id <value> --project-id
400
+ <value>] [--org-id <value>]
401
+
402
+ FLAGS
403
+ --deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
404
+ status (default 300 seconds).
405
+
406
+ PROJECT FLAGS
407
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
408
+ required if multiple powersync config files are present in subdirectories of the current working
409
+ directory.
410
+
411
+ CLOUD_PROJECT FLAGS
412
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
413
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
414
+ explicitly if the token has multiple orgs.
415
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
416
+
417
+ DESCRIPTION
418
+ [Cloud only] Deploy local config to the linked Cloud instance (connections + auth + sync config).
419
+
420
+ Deploy local config (service.yaml, sync config) to the linked PowerSync Cloud instance.
421
+ Validates connections and sync config before deploying.
422
+ See also powersync deploy sync-config to deploy only sync config changes.
423
+ See also powersync deploy service-config to deploy only service config changes.
424
+
425
+ EXAMPLES
426
+ $ powersync deploy
427
+
428
+ $ powersync deploy --instance-id=<id> --project-id=<id>
429
+ ```
430
+
431
+ _See code: [src/commands/deploy/index.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/deploy/index.ts)_
432
+
433
+ ## `powersync deploy service-config`
434
+
435
+ [Cloud only] Deploy only local service config to the linked Cloud instance.
436
+
437
+ ```
438
+ USAGE
439
+ $ powersync deploy service-config [--deploy-timeout <value>] [--directory <value>] [--instance-id <value> --project-id
440
+ <value>] [--org-id <value>]
441
+
442
+ FLAGS
443
+ --deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while polling
444
+ status (default 300 seconds).
445
+
446
+ PROJECT FLAGS
447
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
448
+ required if multiple powersync config files are present in subdirectories of the current working
449
+ directory.
450
+
451
+ CLOUD_PROJECT FLAGS
452
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
453
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
454
+ explicitly if the token has multiple orgs.
455
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
456
+
457
+ DESCRIPTION
458
+ [Cloud only] Deploy only local service config to the linked Cloud instance.
459
+
460
+ Deploy only service config changes (without sync config updates).
461
+
462
+ EXAMPLES
463
+ $ powersync deploy service-config
464
+
465
+ $ powersync deploy service-config --instance-id=<id> --project-id=<id>
466
+ ```
467
+
468
+ _See code: [src/commands/deploy/service-config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/deploy/service-config.ts)_
469
+
470
+ ## `powersync deploy sync-config`
471
+
472
+ [Cloud only] Deploy only local sync config to the linked Cloud instance.
473
+
474
+ ```
475
+ USAGE
476
+ $ powersync deploy sync-config [--deploy-timeout <value>] [--directory <value>] [--instance-id <value> --project-id
477
+ <value>] [--org-id <value>] [--sync-config-file-path <value>]
478
+
479
+ FLAGS
480
+ --deploy-timeout=<value> [default: 300] Seconds to wait after scheduling a deploy before timing out while
481
+ polling status (default 300 seconds).
482
+ --sync-config-file-path=<value> Path to a sync config file. If provided, this file will be validated and deployed
483
+ instead of the default sync-config.yaml.
484
+
485
+ PROJECT FLAGS
486
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
487
+ required if multiple powersync config files are present in subdirectories of the current working
488
+ directory.
489
+
490
+ CLOUD_PROJECT FLAGS
491
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
492
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
493
+ explicitly if the token has multiple orgs.
494
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
495
+
496
+ DESCRIPTION
497
+ [Cloud only] Deploy only local sync config to the linked Cloud instance.
498
+
499
+ Deploy only sync config changes.
500
+
501
+ EXAMPLES
502
+ $ powersync deploy sync-config
503
+
504
+ $ powersync deploy sync-config --instance-id=<id> --project-id=<id>
505
+ ```
506
+
507
+ _See code: [src/commands/deploy/sync-config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/deploy/sync-config.ts)_
508
+
509
+ ## `powersync destroy`
510
+
511
+ [Cloud only] Permanently destroy the linked Cloud instance.
512
+
513
+ ```
514
+ USAGE
515
+ $ powersync destroy [--confirm yes] [--directory <value>] [--instance-id <value> --project-id <value>]
516
+ [--org-id <value>]
517
+
518
+ FLAGS
519
+ --confirm=<option> Set to "yes" to confirm destruction of the instance.
520
+ <options: yes>
521
+
522
+ PROJECT FLAGS
523
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
524
+ required if multiple powersync config files are present in subdirectories of the current working
525
+ directory.
526
+
527
+ CLOUD_PROJECT FLAGS
528
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
529
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
530
+ explicitly if the token has multiple orgs.
531
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
532
+
533
+ DESCRIPTION
534
+ [Cloud only] Permanently destroy the linked Cloud instance.
535
+
536
+ Permanently delete the linked PowerSync Cloud instance and its data. Requires --confirm=yes.
537
+
538
+ EXAMPLES
539
+ $ powersync destroy
540
+
541
+ $ powersync destroy --confirm=yes
542
+ ```
543
+
544
+ _See code: [src/commands/destroy.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/destroy.ts)_
545
+
546
+ ## `powersync docker configure`
547
+
548
+ Configures a self hosted project with Docker Compose services.
549
+
550
+ ```
551
+ USAGE
552
+ $ powersync docker configure [--directory <value>] [--api-url <value>] [--database postgres|external|none]
553
+ [--storage postgres|external|none]
554
+
555
+ FLAGS
556
+ --database=<option> Database module for replication source. Omit to be prompted.
557
+ <options: postgres|external|none>
558
+ --storage=<option> Storage module for PowerSync bucket metadata. Omit to be prompted.
559
+ <options: postgres|external|none>
560
+
561
+ SELF_HOSTED_PROJECT FLAGS
562
+ --api-url=<value> PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.
563
+
564
+ PROJECT FLAGS
565
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
566
+ required if multiple powersync config files are present in subdirectories of the current working
567
+ directory.
568
+
569
+ DESCRIPTION
570
+ Configures a self hosted project with Docker Compose services.
571
+
572
+ Configures a self hosted project with Docker Compose services.
573
+ Docker configuration is located in ./powersync/docker/.
574
+ Configured projects can be started with "powersync docker start".
575
+
576
+ EXAMPLES
577
+ $ powersync docker configure
578
+
579
+ $ powersync docker configure --database=postgres --storage=postgres
580
+ ```
581
+
582
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/docker/configure.ts)_
583
+
584
+ ## `powersync docker reset`
585
+
586
+ Reset the self-hosted PowerSync stack (stop and remove, then start).
587
+
588
+ ```
589
+ USAGE
590
+ $ powersync docker reset [--directory <value>] [--api-url <value>]
591
+
592
+ SELF_HOSTED_PROJECT FLAGS
593
+ --api-url=<value> PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.
594
+
595
+ PROJECT FLAGS
596
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
597
+ required if multiple powersync config files are present in subdirectories of the current working
598
+ directory.
599
+
600
+ DESCRIPTION
601
+ Reset the self-hosted PowerSync stack (stop and remove, then start).
602
+
603
+ Run `docker compose down` then `docker compose up -d --wait`: stops and removes containers, then starts the stack and
604
+ waits for services (including PowerSync) to be healthy. Use when you want a clean bring-up (e.g. after config
605
+ changes). Use `powersync status` to debug running instances.
606
+
607
+ EXAMPLES
608
+ $ powersync docker reset
609
+ ```
610
+
611
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/docker/reset.ts)_
612
+
613
+ ## `powersync docker start`
614
+
615
+ Start the self-hosted PowerSync stack via Docker Compose.
616
+
617
+ ```
618
+ USAGE
619
+ $ powersync docker start [--directory <value>] [--api-url <value>]
620
+
621
+ SELF_HOSTED_PROJECT FLAGS
622
+ --api-url=<value> PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.
623
+
624
+ PROJECT FLAGS
625
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
626
+ required if multiple powersync config files are present in subdirectories of the current working
627
+ directory.
628
+
629
+ DESCRIPTION
630
+ Start the self-hosted PowerSync stack via Docker Compose.
631
+
632
+ Runs `docker compose up -d --wait` for the project docker/ compose file; waits for services (including PowerSync) to
633
+ be healthy. Use `powersync status` to debug running instances.
634
+
635
+ EXAMPLES
636
+ $ powersync docker start
637
+ ```
638
+
639
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/docker/start.ts)_
640
+
641
+ ## `powersync docker stop`
642
+
643
+ Stop a PowerSync Docker Compose project by name.
644
+
645
+ ```
646
+ USAGE
647
+ $ powersync docker stop [--directory <value>] [--api-url <value>] [--project-name <value>] [--remove]
648
+ [--remove-volumes]
649
+
650
+ FLAGS
651
+ --project-name=<value> Docker Compose project name to stop (e.g. powersync_myapp). If omitted and run from a project
652
+ directory, uses plugins.docker.project_name from cli.yaml. Pass this to stop from any
653
+ directory without loading the project.
654
+ --remove Remove containers after stopping (docker compose down). By default only stop (docker compose
655
+ stop).
656
+ --remove-volumes Remove named volumes (docker compose down -v). Use to reset database/storage so init scripts
657
+ run again on next reset. Implies --remove.
658
+
659
+ SELF_HOSTED_PROJECT FLAGS
660
+ --api-url=<value> PowerSync API URL. Resolved: flag → cli.yaml → API_URL environment variable.
661
+
662
+ PROJECT FLAGS
663
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
664
+ required if multiple powersync config files are present in subdirectories of the current working
665
+ directory.
666
+
667
+ DESCRIPTION
668
+ Stop a PowerSync Docker Compose project by name.
669
+
670
+ Run `docker compose -p <project-name> stop` (containers are not removed by default). Does not require the project
671
+ directory or a compose file, so you can run it from anywhere (e.g. after a reset conflict). Use --project-name or run
672
+ from a project with cli.yaml to choose which project to stop. Use --remove to also remove the containers. Use
673
+ --remove-volumes to also remove volumes (e.g. to re-run DB init scripts on next reset).
674
+
675
+ EXAMPLES
676
+ $ powersync docker stop
677
+
678
+ $ powersync docker stop --project-name=powersync_myapp --remove
679
+ ```
680
+
681
+ _See code: [@powersync/cli-plugin-docker](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/docker/stop.ts)_
682
+
683
+ ## `powersync edit config`
684
+
685
+ Open the PowerSync configuration editor (Nitro server).
686
+
687
+ ```
688
+ USAGE
689
+ $ powersync edit config [--api-url <value> | --instance-id <value> | --org-id <value> | --project-id <value>]
690
+ [--directory <value>] [--host <value>] [--port <value>]
691
+
692
+ FLAGS
693
+ --host=<value> [default: 127.0.0.1] Host to bind the editor preview server. Pass 0.0.0.0 to expose on all interfaces.
694
+ --port=<value> [default: 3000] Port for the editor preview server.
695
+
696
+ SELF_HOSTED_PROJECT FLAGS
697
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
698
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
699
+
700
+ PROJECT FLAGS
701
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
702
+ required if multiple powersync config files are present in subdirectories of the current working
703
+ directory.
704
+
705
+ CLOUD_PROJECT FLAGS
706
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
707
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
708
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
709
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
710
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
711
+
712
+ DESCRIPTION
713
+ Open the PowerSync configuration editor (Nitro server).
714
+
715
+ Loads the linked project context and runs the editor Nitro server to edit config files.
716
+
717
+ EXAMPLES
718
+ $ powersync edit config
719
+
720
+ $ powersync edit config --directory ./powersync
721
+ ```
722
+
723
+ _See code: [@powersync/cli-plugin-config-edit](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/edit/config.ts)_
724
+
725
+ ## `powersync fetch config`
726
+
727
+ [Cloud only] Print linked Cloud instance config (YAML or JSON).
728
+
729
+ ```
730
+ USAGE
731
+ $ powersync fetch config [--output json|yaml] [--directory <value>] [--instance-id <value> --project-id <value>]
732
+ [--org-id <value>]
733
+
734
+ FLAGS
735
+ --output=<option> [default: yaml] Output format: yaml or json.
736
+ <options: json|yaml>
737
+
738
+ PROJECT FLAGS
739
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
740
+ required if multiple powersync config files are present in subdirectories of the current working
741
+ directory.
742
+
743
+ CLOUD_PROJECT FLAGS
744
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
745
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
746
+ explicitly if the token has multiple orgs.
747
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
748
+
749
+ DESCRIPTION
750
+ [Cloud only] Print linked Cloud instance config (YAML or JSON).
751
+
752
+ Retrieve the current instance config from PowerSync Cloud and print as YAML or JSON.
753
+
754
+ EXAMPLES
755
+ $ powersync fetch config
756
+
757
+ $ powersync fetch config --output=json
758
+ ```
759
+
760
+ _See code: [src/commands/fetch/config.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/fetch/config.ts)_
761
+
762
+ ## `powersync fetch instances`
763
+
764
+ List Cloud and linked instances.
765
+
766
+ ```
767
+ USAGE
768
+ $ powersync fetch instances [--org-id <value>] [--output human|json] [--output-file <value>] [--project-id <value>]
769
+
770
+ FLAGS
771
+ --org-id=<value> Optional Organization ID. Defaults to all organizations.
772
+ --output=<option> [default: human] Output format: human or json.
773
+ <options: human|json>
774
+ --output-file=<value> Optionally write instance information to a file.
775
+ --project-id=<value> Optional Project ID. Defaults to all projects in the org.
776
+
777
+ DESCRIPTION
778
+ List Cloud and linked instances.
779
+
780
+ List PowerSync Cloud and linked instances, Cloud instances are grouped by organization and project.
781
+
782
+ EXAMPLES
783
+ $ powersync fetch instances
784
+
785
+ $ powersync fetch instances --project-id=<id> --output=json
786
+ ```
787
+
788
+ _See code: [src/commands/fetch/instances.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/fetch/instances.ts)_
789
+
790
+ ## `powersync fetch status`
791
+
792
+ Show instance diagnostics (connections, sync config, replication).
793
+
794
+ ```
795
+ USAGE
796
+ $ powersync fetch status [--output human|json|yaml] [--api-url <value> | --instance-id <value> | --org-id
797
+ <value> | --project-id <value>] [--directory <value>]
798
+
799
+ FLAGS
800
+ --output=<option> [default: human] Output format: human-readable, json, or yaml.
801
+ <options: human|json|yaml>
802
+
803
+ SELF_HOSTED_PROJECT FLAGS
804
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
805
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
806
+
807
+ PROJECT FLAGS
808
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
809
+ required if multiple powersync config files are present in subdirectories of the current working
810
+ directory.
811
+
812
+ CLOUD_PROJECT FLAGS
813
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
814
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
815
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
816
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
817
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
818
+
819
+ DESCRIPTION
820
+ Show instance diagnostics (connections, sync config, replication).
821
+
822
+ Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as
823
+ human-readable, JSON, or YAML. Cloud and self-hosted.
824
+
825
+ EXAMPLES
826
+ $ powersync fetch status
827
+
828
+ $ powersync fetch status --output=json
829
+
830
+ $ powersync fetch status --instance-id=<id> --project-id=<id>
831
+ ```
832
+
833
+ _See code: [src/commands/fetch/status.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/fetch/status.ts)_
834
+
835
+ ## `powersync generate schema`
836
+
837
+ Generate client schema file from instance schema and sync config.
838
+
839
+ ```
840
+ USAGE
841
+ $ powersync generate schema --output dart|dotNet|js|jsLegacy|kotlin|swift|ts --output-path <value> [--api-url
842
+ <value> | --instance-id <value> | --org-id <value> | --project-id <value>] [--directory <value>]
843
+
844
+ FLAGS
845
+ --output=<option> (required) [default: type] Output type: dart, dotNet, js, jsLegacy, kotlin, swift, ts
846
+ <options: dart|dotNet|js|jsLegacy|kotlin|swift|ts>
847
+ --output-path=<value> (required) Path to output the schema file.
848
+
849
+ SELF_HOSTED_PROJECT FLAGS
850
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
851
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
852
+
853
+ PROJECT FLAGS
854
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
855
+ required if multiple powersync config files are present in subdirectories of the current working
856
+ directory.
857
+
858
+ CLOUD_PROJECT FLAGS
859
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
860
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
861
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
862
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
863
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
864
+
865
+ DESCRIPTION
866
+ Generate client schema file from instance schema and sync config.
867
+
868
+ Generate a client-side schema file from the instance database schema and sync config. Supports multiple output types
869
+ (e.g. type, dart). Requires a linked instance. Cloud and self-hosted.
870
+
871
+ EXAMPLES
872
+ $ powersync generate schema --output=ts --output-path=schema.ts
873
+
874
+ $ powersync generate schema --output=dart --output-path=lib/schema.dart --instance-id=<id> --project-id=<id>
875
+ ```
876
+
877
+ _See code: [src/commands/generate/schema.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/generate/schema.ts)_
878
+
879
+ ## `powersync generate token`
880
+
881
+ Generate a development JWT for client connections.
882
+
883
+ ```
884
+ USAGE
885
+ $ powersync generate token --subject <value> [--expires-in-seconds <value>] [--kid <value>] [--api-url <value> |
886
+ --instance-id <value> | --org-id <value> | --project-id <value>] [--directory <value>]
887
+
888
+ FLAGS
889
+ --expires-in-seconds=<value> [default: 43200] Expiration time in seconds. Default is 43,200 (12 hours).
890
+ --kid=<value> [Self-hosted only] Key ID of the key to use for signing the token. If not provided, the
891
+ first key will be used.
892
+ --subject=<value> (required) Subject of the token.
893
+
894
+ SELF_HOSTED_PROJECT FLAGS
895
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
896
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
897
+
898
+ PROJECT FLAGS
899
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
900
+ required if multiple powersync config files are present in subdirectories of the current working
901
+ directory.
902
+
903
+ CLOUD_PROJECT FLAGS
904
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
905
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
906
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
907
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
908
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
909
+
910
+ DESCRIPTION
911
+ Generate a development JWT for client connections.
912
+
913
+ Generate a JWT for development clients to connect to PowerSync. Cloud: uses instance dev-token API
914
+ (allow_temporary_tokens must be enabled). Self-hosted: signs with shared secret from config. Requires --subject;
915
+ optional --expires-in-seconds.
916
+
917
+ EXAMPLES
918
+ $ powersync generate token --subject=user-123
919
+
920
+ $ powersync generate token --subject=user-123 --expires-in-seconds=3600
921
+ ```
922
+
923
+ _See code: [src/commands/generate/token.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/generate/token.ts)_
924
+
925
+ ## `powersync help [COMMAND]`
926
+
927
+ Display help for powersync.
928
+
929
+ ```
930
+ USAGE
931
+ $ powersync help [COMMAND...] [-n]
932
+
933
+ ARGUMENTS
934
+ [COMMAND...] Command to show help for.
935
+
936
+ FLAGS
937
+ -n, --nested-commands Include all nested commands in the output.
938
+
939
+ DESCRIPTION
940
+ Display help for powersync.
941
+ ```
942
+
943
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v6.2.37/src/commands/help.ts)_
944
+
945
+ ## `powersync init cloud`
946
+
947
+ Scaffold a PowerSync Cloud config directory from a template.
948
+
949
+ ```
950
+ USAGE
951
+ $ powersync init cloud [--directory <value>]
952
+
953
+ PROJECT FLAGS
954
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
955
+ required if multiple powersync config files are present in subdirectories of the current working
956
+ directory.
957
+
958
+ DESCRIPTION
959
+ Scaffold a PowerSync Cloud config directory from a template.
960
+
961
+ Copy a Cloud template into a config directory (default powersync/). Edit service.yaml then run link cloud and deploy.
962
+
963
+ EXAMPLES
964
+ $ powersync init cloud
965
+
966
+ $ powersync init cloud --directory=powersync
967
+ ```
968
+
969
+ _See code: [src/commands/init/cloud.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/init/cloud.ts)_
970
+
971
+ ## `powersync init self-hosted`
972
+
973
+ Scaffold a PowerSync self-hosted config directory from a template.
974
+
975
+ ```
976
+ USAGE
977
+ $ powersync init self-hosted [--directory <value>]
978
+
979
+ PROJECT FLAGS
980
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
981
+ required if multiple powersync config files are present in subdirectories of the current working
982
+ directory.
983
+
984
+ DESCRIPTION
985
+ Scaffold a PowerSync self-hosted config directory from a template.
986
+
987
+ Copy a self-hosted template into a config directory (default powersync/). Configure service.yaml with your self-hosted
988
+ instance details.
989
+
990
+ EXAMPLES
991
+ $ powersync init self-hosted
992
+
993
+ $ powersync init self-hosted --directory=powersync
994
+ ```
995
+
996
+ _See code: [src/commands/init/self-hosted.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/init/self-hosted.ts)_
997
+
998
+ ## `powersync link cloud`
999
+
1000
+ [Cloud only] Link to a PowerSync Cloud instance (or create one with --create).
1001
+
1002
+ ```
1003
+ USAGE
1004
+ $ powersync link cloud --project-id <value> [--create] [--instance-id <value>] [--org-id <value>] [--directory
1005
+ <value>]
1006
+
1007
+ FLAGS
1008
+ --create Create a new Cloud instance in the given org and project, then link. Do not supply
1009
+ --instance-id when using --create.
1010
+ --instance-id=<value> PowerSync Cloud instance ID. Omit when using --create. Resolved: flag → INSTANCE_ID → cli.yaml.
1011
+ --org-id=<value> Organization ID. Optional when the token has a single org; required when the token has multiple
1012
+ orgs. Resolved: flag → ORG_ID → cli.yaml.
1013
+ --project-id=<value> (required) Project ID. Resolved: flag → PROJECT_ID → cli.yaml.
1014
+
1015
+ PROJECT FLAGS
1016
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1017
+ required if multiple powersync config files are present in subdirectories of the current working
1018
+ directory.
1019
+
1020
+ DESCRIPTION
1021
+ [Cloud only] Link to a PowerSync Cloud instance (or create one with --create).
1022
+
1023
+ Write or update cli.yaml with a Cloud instance (instance-id, org-id, project-id). Use --create to create a new
1024
+ instance from service.yaml name/region and link it; omit --instance-id when using --create. Org ID is optional when
1025
+ the token has a single organization.
1026
+
1027
+ EXAMPLES
1028
+ $ powersync link cloud --project-id=<project-id>
1029
+
1030
+ $ powersync link cloud --create --project-id=<project-id>
1031
+
1032
+ $ powersync link cloud --instance-id=<id> --project-id=<project-id> --org-id=<org-id>
1033
+ ```
1034
+
1035
+ _See code: [src/commands/link/cloud.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/link/cloud.ts)_
1036
+
1037
+ ## `powersync link self-hosted`
1038
+
1039
+ Link to a self-hosted PowerSync instance by API URL.
1040
+
1041
+ ```
1042
+ USAGE
1043
+ $ powersync link self-hosted --api-url <value> [--directory <value>]
1044
+
1045
+ FLAGS
1046
+ --api-url=<value> (required) Self-hosted PowerSync API base URL (e.g. https://powersync.example.com).
1047
+
1048
+ PROJECT FLAGS
1049
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1050
+ required if multiple powersync config files are present in subdirectories of the current working
1051
+ directory.
1052
+
1053
+ DESCRIPTION
1054
+ Link to a self-hosted PowerSync instance by API URL.
1055
+
1056
+ Links a self hosted PowerSync instance by API URL.
1057
+ API Keys can be specified via input or specified in the PS_ADMIN_TOKEN environment variable.
1058
+
1059
+ EXAMPLES
1060
+ $ powersync link self-hosted --api-url=https://powersync.example.com
1061
+ ```
1062
+
1063
+ _See code: [src/commands/link/self-hosted.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/link/self-hosted.ts)_
1064
+
1065
+ ## `powersync login`
1066
+
1067
+ Store auth token for Cloud commands.
1068
+
1069
+ ```
1070
+ USAGE
1071
+ $ powersync login
1072
+
1073
+ DESCRIPTION
1074
+ Store auth token for Cloud commands.
1075
+
1076
+ Store a PowerSync auth token (PAT) in secure storage so later Cloud commands run without passing a token. If secure
1077
+ storage is unavailable, login can optionally store it in a local config file. Use PS_ADMIN_TOKEN env var for CI or
1078
+ scripts instead.
1079
+
1080
+ EXAMPLES
1081
+ $ powersync login
1082
+ ```
1083
+
1084
+ _See code: [src/commands/login.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/login.ts)_
1085
+
1086
+ ## `powersync logout`
1087
+
1088
+ Remove stored auth token.
1089
+
1090
+ ```
1091
+ USAGE
1092
+ $ powersync logout
1093
+
1094
+ DESCRIPTION
1095
+ Remove stored auth token.
1096
+
1097
+ Remove the stored PowerSync auth token from secure storage or local fallback config storage. Cloud commands will no
1098
+ longer use stored credentials until you run login again.
1099
+
1100
+ EXAMPLES
1101
+ $ powersync logout
1102
+ ```
1103
+
1104
+ _See code: [src/commands/logout.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/logout.ts)_
1105
+
1106
+ ## `powersync migrate sync-rules`
1107
+
1108
+ Migrates Sync Rules to Sync Streams
1109
+
1110
+ ```
1111
+ USAGE
1112
+ $ powersync migrate sync-rules [--input-file <value>] [--output-file <value>] [--api-url <value> | --instance-id
1113
+ <value> | --org-id <value> | --project-id <value>] [--directory <value>]
1114
+
1115
+ FLAGS
1116
+ --input-file=<value> Path to the input sync rules file. Defaults to the project sync-config.yaml file.
1117
+ --output-file=<value> Path to the output sync streams file. Defaults to overwrite the input file.
1118
+
1119
+ SELF_HOSTED_PROJECT FLAGS
1120
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
1121
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
1122
+
1123
+ PROJECT FLAGS
1124
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1125
+ required if multiple powersync config files are present in subdirectories of the current working
1126
+ directory.
1127
+
1128
+ CLOUD_PROJECT FLAGS
1129
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
1130
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
1131
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
1132
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
1133
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
1134
+
1135
+ DESCRIPTION
1136
+ Migrates Sync Rules to Sync Streams
1137
+
1138
+ Migrates Sync Rules to Sync Streams
1139
+ ```
1140
+
1141
+ _See code: [src/commands/migrate/sync-rules.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/migrate/sync-rules.ts)_
1142
+
1143
+ ## `powersync plugins`
1144
+
1145
+ List installed plugins.
1146
+
1147
+ ```
1148
+ USAGE
1149
+ $ powersync plugins [--json] [--core]
1150
+
1151
+ FLAGS
1152
+ --core Show core plugins.
1153
+
1154
+ GLOBAL FLAGS
1155
+ --json Format output as json.
1156
+
1157
+ DESCRIPTION
1158
+ List installed plugins.
1159
+
1160
+ EXAMPLES
1161
+ $ powersync plugins
1162
+ ```
1163
+
1164
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/index.ts)_
1165
+
1166
+ ## `powersync plugins add PLUGIN`
1167
+
1168
+ Installs a plugin into powersync.
1169
+
1170
+ ```
1171
+ USAGE
1172
+ $ powersync plugins add PLUGIN... [--json] [-f] [-h] [-s | -v]
1173
+
1174
+ ARGUMENTS
1175
+ PLUGIN... Plugin to install.
1176
+
1177
+ FLAGS
1178
+ -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
1179
+ -h, --help Show CLI help.
1180
+ -s, --silent Silences npm output.
1181
+ -v, --verbose Show verbose npm output.
1182
+
1183
+ GLOBAL FLAGS
1184
+ --json Format output as json.
1185
+
1186
+ DESCRIPTION
1187
+ Installs a plugin into powersync.
1188
+
1189
+ Uses npm to install plugins.
1190
+
1191
+ Installation of a user-installed plugin will override a core plugin.
1192
+
1193
+ Use the POWERSYNC_NPM_LOG_LEVEL environment variable to set the npm loglevel.
1194
+ Use the POWERSYNC_NPM_REGISTRY environment variable to set the npm registry.
1195
+
1196
+ ALIASES
1197
+ $ powersync plugins add
1198
+
1199
+ EXAMPLES
1200
+ Install a plugin from npm registry.
1201
+
1202
+ $ powersync plugins add myplugin
1203
+
1204
+ Install a plugin from a github url.
1205
+
1206
+ $ powersync plugins add https://github.com/someuser/someplugin
1207
+
1208
+ Install a plugin from a github slug.
1209
+
1210
+ $ powersync plugins add someuser/someplugin
1211
+ ```
1212
+
1213
+ ## `powersync plugins:inspect PLUGIN...`
1214
+
1215
+ Displays installation properties of a plugin.
1216
+
1217
+ ```
1218
+ USAGE
1219
+ $ powersync plugins inspect PLUGIN...
1220
+
1221
+ ARGUMENTS
1222
+ PLUGIN... [default: .] Plugin to inspect.
1223
+
1224
+ FLAGS
1225
+ -h, --help Show CLI help.
1226
+ -v, --verbose
1227
+
1228
+ GLOBAL FLAGS
1229
+ --json Format output as json.
1230
+
1231
+ DESCRIPTION
1232
+ Displays installation properties of a plugin.
1233
+
1234
+ EXAMPLES
1235
+ $ powersync plugins inspect myplugin
1236
+ ```
1237
+
1238
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/inspect.ts)_
1239
+
1240
+ ## `powersync plugins install PLUGIN`
1241
+
1242
+ Installs a plugin into powersync.
1243
+
1244
+ ```
1245
+ USAGE
1246
+ $ powersync plugins install PLUGIN... [--json] [-f] [-h] [-s | -v]
1247
+
1248
+ ARGUMENTS
1249
+ PLUGIN... Plugin to install.
1250
+
1251
+ FLAGS
1252
+ -f, --force Force npm to fetch remote resources even if a local copy exists on disk.
1253
+ -h, --help Show CLI help.
1254
+ -s, --silent Silences npm output.
1255
+ -v, --verbose Show verbose npm output.
1256
+
1257
+ GLOBAL FLAGS
1258
+ --json Format output as json.
1259
+
1260
+ DESCRIPTION
1261
+ Installs a plugin into powersync.
1262
+
1263
+ Uses npm to install plugins.
1264
+
1265
+ Installation of a user-installed plugin will override a core plugin.
1266
+
1267
+ Use the POWERSYNC_NPM_LOG_LEVEL environment variable to set the npm loglevel.
1268
+ Use the POWERSYNC_NPM_REGISTRY environment variable to set the npm registry.
1269
+
1270
+ ALIASES
1271
+ $ powersync plugins add
1272
+
1273
+ EXAMPLES
1274
+ Install a plugin from npm registry.
1275
+
1276
+ $ powersync plugins install myplugin
1277
+
1278
+ Install a plugin from a github url.
1279
+
1280
+ $ powersync plugins install https://github.com/someuser/someplugin
1281
+
1282
+ Install a plugin from a github slug.
1283
+
1284
+ $ powersync plugins install someuser/someplugin
1285
+ ```
1286
+
1287
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/install.ts)_
1288
+
1289
+ ## `powersync plugins link PATH`
1290
+
1291
+ Links a plugin into the CLI for development.
1292
+
1293
+ ```
1294
+ USAGE
1295
+ $ powersync plugins link PATH [-h] [--install] [-v]
1296
+
1297
+ ARGUMENTS
1298
+ PATH [default: .] path to plugin
1299
+
1300
+ FLAGS
1301
+ -h, --help Show CLI help.
1302
+ -v, --verbose
1303
+ --[no-]install Install dependencies after linking the plugin.
1304
+
1305
+ DESCRIPTION
1306
+ Links a plugin into the CLI for development.
1307
+
1308
+ Installation of a linked plugin will override a user-installed or core plugin.
1309
+
1310
+ e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
1311
+ command will override the user-installed or core plugin implementation. This is useful for development work.
1312
+
1313
+
1314
+ EXAMPLES
1315
+ $ powersync plugins link myplugin
1316
+ ```
1317
+
1318
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/link.ts)_
1319
+
1320
+ ## `powersync plugins remove [PLUGIN]`
1321
+
1322
+ Removes a plugin from the CLI.
1323
+
1324
+ ```
1325
+ USAGE
1326
+ $ powersync plugins remove [PLUGIN...] [-h] [-v]
1327
+
1328
+ ARGUMENTS
1329
+ [PLUGIN...] plugin to uninstall
1330
+
1331
+ FLAGS
1332
+ -h, --help Show CLI help.
1333
+ -v, --verbose
1334
+
1335
+ DESCRIPTION
1336
+ Removes a plugin from the CLI.
1337
+
1338
+ ALIASES
1339
+ $ powersync plugins unlink
1340
+ $ powersync plugins remove
1341
+
1342
+ EXAMPLES
1343
+ $ powersync plugins remove myplugin
1344
+ ```
1345
+
1346
+ ## `powersync plugins reset`
1347
+
1348
+ Remove all user-installed and linked plugins.
1349
+
1350
+ ```
1351
+ USAGE
1352
+ $ powersync plugins reset [--hard] [--reinstall]
1353
+
1354
+ FLAGS
1355
+ --hard Delete node_modules and package manager related files in addition to uninstalling plugins.
1356
+ --reinstall Reinstall all plugins after uninstalling.
1357
+ ```
1358
+
1359
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/reset.ts)_
1360
+
1361
+ ## `powersync plugins uninstall [PLUGIN]`
1362
+
1363
+ Removes a plugin from the CLI.
1364
+
1365
+ ```
1366
+ USAGE
1367
+ $ powersync plugins uninstall [PLUGIN...] [-h] [-v]
1368
+
1369
+ ARGUMENTS
1370
+ [PLUGIN...] plugin to uninstall
1371
+
1372
+ FLAGS
1373
+ -h, --help Show CLI help.
1374
+ -v, --verbose
1375
+
1376
+ DESCRIPTION
1377
+ Removes a plugin from the CLI.
1378
+
1379
+ ALIASES
1380
+ $ powersync plugins unlink
1381
+ $ powersync plugins remove
1382
+
1383
+ EXAMPLES
1384
+ $ powersync plugins uninstall myplugin
1385
+ ```
1386
+
1387
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/uninstall.ts)_
1388
+
1389
+ ## `powersync plugins unlink [PLUGIN]`
1390
+
1391
+ Removes a plugin from the CLI.
1392
+
1393
+ ```
1394
+ USAGE
1395
+ $ powersync plugins unlink [PLUGIN...] [-h] [-v]
1396
+
1397
+ ARGUMENTS
1398
+ [PLUGIN...] plugin to uninstall
1399
+
1400
+ FLAGS
1401
+ -h, --help Show CLI help.
1402
+ -v, --verbose
1403
+
1404
+ DESCRIPTION
1405
+ Removes a plugin from the CLI.
1406
+
1407
+ ALIASES
1408
+ $ powersync plugins unlink
1409
+ $ powersync plugins remove
1410
+
1411
+ EXAMPLES
1412
+ $ powersync plugins unlink myplugin
1413
+ ```
1414
+
1415
+ ## `powersync plugins update`
1416
+
1417
+ Update installed plugins.
1418
+
1419
+ ```
1420
+ USAGE
1421
+ $ powersync plugins update [-h] [-v]
1422
+
1423
+ FLAGS
1424
+ -h, --help Show CLI help.
1425
+ -v, --verbose
1426
+
1427
+ DESCRIPTION
1428
+ Update installed plugins.
1429
+ ```
1430
+
1431
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v5.4.55/src/commands/plugins/update.ts)_
1432
+
1433
+ ## `powersync pull instance`
1434
+
1435
+ [Cloud only] Pull an existing Cloud instance: link and download config into local service.yaml and sync-config.yaml.
1436
+
1437
+ ```
1438
+ USAGE
1439
+ $ powersync pull instance [--directory <value>] [--instance-id <value> --project-id <value>] [--org-id <value>]
1440
+
1441
+ PROJECT FLAGS
1442
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1443
+ required if multiple powersync config files are present in subdirectories of the current working
1444
+ directory.
1445
+
1446
+ CLOUD_PROJECT FLAGS
1447
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
1448
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
1449
+ explicitly if the token has multiple orgs.
1450
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
1451
+
1452
+ DESCRIPTION
1453
+ [Cloud only] Pull an existing Cloud instance: link and download config into local service.yaml and sync-config.yaml.
1454
+
1455
+ Fetch an existing Cloud instance by ID: create the config directory if needed, write cli.yaml, and download
1456
+ service.yaml and sync-config.yaml. Pass --instance-id and --project-id when the directory is not yet linked; --org-id
1457
+ is optional when the token has a single organization. Cloud only.
1458
+
1459
+ EXAMPLES
1460
+ $ powersync pull instance
1461
+
1462
+ $ powersync pull instance --instance-id=<id> --project-id=<id>
1463
+
1464
+ $ powersync pull instance --instance-id=<id> --project-id=<id> --org-id=<org-id>
1465
+ ```
1466
+
1467
+ _See code: [src/commands/pull/instance.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/pull/instance.ts)_
1468
+
1469
+ ## `powersync status`
1470
+
1471
+ Show instance diagnostics (connections, sync config, replication).
1472
+
1473
+ ```
1474
+ USAGE
1475
+ $ powersync status [--output human|json|yaml] [--api-url <value> | --instance-id <value> | --org-id
1476
+ <value> | --project-id <value>] [--directory <value>]
1477
+
1478
+ FLAGS
1479
+ --output=<option> [default: human] Output format: human-readable, json, or yaml.
1480
+ <options: human|json|yaml>
1481
+
1482
+ SELF_HOSTED_PROJECT FLAGS
1483
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
1484
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
1485
+
1486
+ PROJECT FLAGS
1487
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1488
+ required if multiple powersync config files are present in subdirectories of the current working
1489
+ directory.
1490
+
1491
+ CLOUD_PROJECT FLAGS
1492
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
1493
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
1494
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
1495
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
1496
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
1497
+
1498
+ DESCRIPTION
1499
+ Show instance diagnostics (connections, sync config, replication).
1500
+
1501
+ Fetch instance diagnostics: connection status, active and deploying sync config, replication state. Output as
1502
+ human-readable, JSON, or YAML. Cloud and self-hosted.
1503
+
1504
+ EXAMPLES
1505
+ $ powersync status
1506
+
1507
+ $ powersync status --output=json
1508
+
1509
+ $ powersync status --instance-id=<id> --project-id=<id>
1510
+ ```
1511
+
1512
+ _See code: [src/commands/status.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/status.ts)_
1513
+
1514
+ ## `powersync stop`
1515
+
1516
+ [Cloud only] Stop the linked Cloud instance (restart with deploy).
1517
+
1518
+ ```
1519
+ USAGE
1520
+ $ powersync stop [--confirm yes] [--directory <value>] [--instance-id <value> --project-id <value>]
1521
+ [--org-id <value>]
1522
+
1523
+ FLAGS
1524
+ --confirm=<option> Set to "yes" to confirm stopping the instance.
1525
+ <options: yes>
1526
+
1527
+ PROJECT FLAGS
1528
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1529
+ required if multiple powersync config files are present in subdirectories of the current working
1530
+ directory.
1531
+
1532
+ CLOUD_PROJECT FLAGS
1533
+ --instance-id=<value> PowerSync Cloud instance ID. Manually passed if the current context has not been linked.
1534
+ --org-id=<value> Organization ID (optional). Defaults to the token’s single org when only one is available; pass
1535
+ explicitly if the token has multiple orgs.
1536
+ --project-id=<value> Project ID. Manually passed if the current context has not been linked.
1537
+
1538
+ DESCRIPTION
1539
+ [Cloud only] Stop the linked Cloud instance (restart with deploy).
1540
+
1541
+ Deactivate the linked PowerSync Cloud instance. Requires --confirm=yes. Restart later with powersync deploy.
1542
+
1543
+ EXAMPLES
1544
+ $ powersync stop
1545
+
1546
+ $ powersync stop --confirm=yes
1547
+ ```
1548
+
1549
+ _See code: [src/commands/stop.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/stop.ts)_
1550
+
1551
+ ## `powersync validate`
1552
+
1553
+ Validate config schema, connections, and sync config before deploy.
1554
+
1555
+ ```
1556
+ USAGE
1557
+ $ powersync validate [--output human|json|yaml] [--api-url <value> | --instance-id <value> | --org-id
1558
+ <value> | --project-id <value>] [--directory <value>]
1559
+
1560
+ FLAGS
1561
+ --output=<option> [default: human] Output format: human-readable, json, or yaml.
1562
+ <options: human|json|yaml>
1563
+
1564
+ SELF_HOSTED_PROJECT FLAGS
1565
+ --api-url=<value> [Self-hosted] PowerSync API URL. When set, context is treated as self-hosted (exclusive with
1566
+ --instance-id). Resolved: flag → cli.yaml → API_URL.
1567
+
1568
+ PROJECT FLAGS
1569
+ --directory=<value> [default: powersync] Directory containing PowerSync config. Defaults to "powersync". This is
1570
+ required if multiple powersync config files are present in subdirectories of the current working
1571
+ directory.
1572
+
1573
+ CLOUD_PROJECT FLAGS
1574
+ --instance-id=<value> [Cloud] PowerSync Cloud instance ID (BSON ObjectID). When set, context is treated as cloud
1575
+ (exclusive with --api-url). Resolved: flag → cli.yaml → INSTANCE_ID.
1576
+ --org-id=<value> [Cloud] Organization ID (optional). Defaults to the token’s single org when only one is
1577
+ available; pass explicitly if the token has multiple orgs. Resolved: flag → cli.yaml → ORG_ID.
1578
+ --project-id=<value> [Cloud] Project ID. Resolved: flag → cli.yaml → PROJECT_ID.
1579
+
1580
+ DESCRIPTION
1581
+ Validate config schema, connections, and sync config before deploy.
1582
+
1583
+ Run validation checks on local config: config schema, database connections, and sync config. Requires a linked
1584
+ instance. Works with Cloud and self-hosted.
1585
+
1586
+ EXAMPLES
1587
+ $ powersync validate
1588
+
1589
+ $ powersync validate --output=json
1590
+
1591
+ $ powersync validate --api-url=https://powersync.example.com
1592
+ ```
1593
+
1594
+ _See code: [src/commands/validate.ts](https://github.com/powersync-ja/powersync-cli/blob/v0.0.0-dev-20260305082615/src/commands/validate.ts)_
1595
+
1596
+ <!-- commandsstop -->