diff --git a/maintenance-ops/compacting-buckets.mdx b/maintenance-ops/compacting-buckets.mdx index 9a4539d9..0ad8eab1 100644 --- a/maintenance-ops/compacting-buckets.mdx +++ b/maintenance-ops/compacting-buckets.mdx @@ -11,7 +11,10 @@ This allows clients to download incremental changes efficiently — only changed The cloud-hosted version of PowerSync will automatically compact all buckets once per day. -Support to manually trigger compacting is available in the [PowerSync Dashboard](https://dashboard.powersync.com/): Select your project and instance, go to the **Settings** view, and click the **Compact** button in the "Compact operation history" section. Support to trigger compacting from the [CLI](/tools/cli) will be added soon. +You can manually trigger compacting from the [PowerSync Dashboard](https://dashboard.powersync.com/) or the [CLI](/tools/cli): + +- **Dashboard**: Select your project and instance, go to the **Settings** view, and click the **Compact** button in the "Compact operation history" section. +- **CLI**: Run `powersync compact` against a linked Cloud instance. The CLI polls until the operation completes, with a default timeout of 30 minutes. Pass `--timeout=` to override, or `--timeout=0` to wait indefinitely. [Defragmenting](/maintenance-ops/compacting-buckets#defragmenting) may still be required. diff --git a/tools/cli.mdx b/tools/cli.mdx index a97cc1b6..0607849a 100644 --- a/tools/cli.mdx +++ b/tools/cli.mdx @@ -192,7 +192,7 @@ Use `--directory=` for a different config folder. Only these commands apply to self-hosted instances: **`powersync status`**, **`powersync generate schema`**, **`powersync generate token`**, **`powersync validate`**, **`powersync fetch instances`** (scans current directory for folders with `cli.yaml`). -Cloud-only commands (**`powersync deploy`**, **`powersync pull instance`**, **`powersync fetch config`**, **`powersync destroy`**, **`powersync stop`**) do not apply. +Cloud-only commands (**`powersync deploy`**, **`powersync pull instance`**, **`powersync fetch config`**, **`powersync destroy`**, **`powersync stop`**, **`powersync compact`**) do not apply. ### Docker (Local Development) @@ -236,6 +236,7 @@ Then use the same commands as any self-hosted instance (`powersync status`, `pow | `powersync migrate sync-rules` | Migrate Sync Rules to Sync Streams | | `powersync destroy --confirm=yes` | [Cloud] Permanently destroy instance | | `powersync stop --confirm=yes` | [Cloud] Stop instance (restart with deploy) | +| `powersync compact` | [Cloud] Trigger [bucket compacting](/maintenance-ops/compacting-buckets) on demand | Run `powersync --help` or `powersync --help` for flags. Full [command reference](https://github.com/powersync-ja/powersync-cli/blob/main/cli/README.md#commands) in the CLI repo.