Merged
Conversation
…date self hosted schemas.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 182 out of 193 changed files in this pull request and generated 8 comments.
Files not reviewed (1)
- examples/self-hosted/local-postgres-node/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/cli-core/src/command-types/SelfHostedInstanceCommand.ts
Outdated
Show resolved
Hide resolved
Chriztiaan
reviewed
Feb 26, 2026
Chriztiaan
reviewed
Feb 26, 2026
Chriztiaan
previously approved these changes
Mar 2, 2026
Chriztiaan
left a comment
There was a problem hiding this comment.
Awesome work! A welcome iteration.
Chriztiaan
approved these changes
Mar 2, 2026
stevensJourney
commented
Mar 2, 2026
Collaborator
Author
stevensJourney
left a comment
There was a problem hiding this comment.
Due to the size of this PR. I'd like to merge it now, and address any additional feedback as additional PRs.
Feedback is still welcome.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementation of https://docs.google.com/document/d/1iqpJF2gog2jB-ZWeN8TBEjcad8aBKNKbue2yJ21q_-s/edit?tab=t.0#heading=h.tlu0tywj9wmg
Summary
This PR introduces a new PowerSync CLI monorepo for managing PowerSync instances (Cloud and self-hosted). The CLI provides project scaffolding, linking, deployment, config management, validation, and client artifact generation, with an optional Docker plugin for running a local self-hosted PowerSync stack via Docker Compose - primarily for local development.
What’s in scope
Monorepo layout
cli/— Main CLI (@powersync/cli): OCLIF-based entrypoint, commands, Cloud/self-hosted API clients, and YAML templates (cloud + self-hosted).packages/cli-core/— Shared base command types, YAML helpers (including!env), and project-config utilities used by the CLI and plugins.packages/schemas/— Shared config schemas for validation and typing.plugins/docker/— Docker plugin (@powersync/cli-plugin-docker): configure, reset, start, stop for a Compose-based self-hosted stack.Workspace roots:
cli,packages/*,plugins/*(pnpm).Main CLI capabilities
init cloud,init self-hosted,link(cloud / self-hosted)powersync/from a template withinit cloudorinit self-hosted; bind to an instance vialink.yaml.deploy,stop,destroyfetch config,pull config,fetch instances,fetch statusvalidategenerate schema,generate tokenloginPS_TOKENsupported for CI/scripts.Not all commands require a PowerSync config folder: commands that don’t need local config (e.g.
fetch status,generate schema,generate token) can be run with instance specified by flags (and/or env) only, without apowersync/directory orlink.yaml. Where a config directory is used,--directory(defaultpowersync/) applies.Docker plugin (self-hosted)
docker configure— Composes database and storage modules (e.g. postgres / external) intopowersync/docker/, generatesdocker-compose.yamland.env, merges replication/storage intoservice.yaml, and setslink.yaml(includingplugins.docker.project_name). If--databaseor--storageare omitted, the CLI prompts interactively (Inquirer); usenoneto skip configuring a module.docker reset— Stop and remove containers (docker compose down), then start (docker compose up -d --wait); use for a clean bring-up (e.g. after config changes).docker start/docker stop— Start stack or stop by project name;stopsupports--removeand--remove-volumes. After a failed start/reset, the CLI lists only running PowerSync Docker projects (fromdocker compose ls -q) so you can stop the right one.Templates support postgres and external options for source database and bucket storage.
Config and conventions
powersync/; holdsservice.yaml,sync.yaml,link.yaml, and (with Docker plugin)docker/.link.yamlstores Cloud IDs or self-hostedapi_url(and optionalapi_key); supports!envfor env-based values.!envtag for substituting env vars (with optional::number/::booleancast); used in link and service config.Quality and CI
cli/test/.main); matrix: Node 24, Ubuntu + Windows.docs/usage.md(general usage, linking, auth, Cloud vs self-hosted),docs/usage-docker.md(Docker plugin workflow and flags), plus READMEs in repo root,cli/, andplugins/docker/.Todos
These will be done in future PRs
How to run
nvm use # Node from .nvmrc (e.g. 24) pnpm install pnpm build pnpm powersync -- --helpDocker self-hosted flow:
See
README.md,docs/usage.md, anddocs/usage-docker.mdfor full usage.