Programmatically manage your PowerSync environment.
For an overview, see the docs here.
$ npx powersync
$ npx powersync COMMAND
running command...
$ npx powersync --help [COMMAND]
USAGE
$ npx powersync COMMAND
...
The following environment variables can be injected:
-
AUTH_TOKEN
- The access token used to authenticate with the PowerSync service. Learn more. -
ORG_ID
- The PowerSync organization ID. This is the first UUID in your project's dashboard URL.123
in this example:https://powersync.journeyapps.com/org/123/app/456
. -
PROJECT_ID
- The PowerSync project ID. This is the second UUID in your project's dashboard URL.456
in this example:https://powersync.journeyapps.com/org/123/app/456
. -
INSTANCE_ID
- The PowerSync instance ID. Get this by runningnpx powersync instances
.
Example:
ORG_ID=123 PROJECT_ID=456 INSTANCE_ID=789 npx powersync instance status
powersync help [COMMAND]
powersync init
powersync instance config
powersync instance create
powersync instance deploy
powersync instance destroy
powersync instance schema
powersync instance set
powersync instance status
powersync instance stop
powersync instance sync-rules deploy
powersync instance sync-rules generate-schema
powersync instance sync-rules validate
powersync instances
Display help for powersync.
USAGE
$ npx powersync help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for powersync.
See code: @oclif/plugin-help
Initialize the CLI. Requires an access token. Learn how to generate these here.
USAGE
$ npx powersync init
DESCRIPTION
Initialize the CLI.
EXAMPLES
$ npx powersync init
See code: src/commands/init.ts
Display the instance config.
USAGE
$ npx powersync instance config
DESCRIPTION
Display the instance config.
EXAMPLES
$ npx powersync instance config
See code: src/commands/instance/config.ts
Create a new instance.
USAGE
$ npx powersync instance create [--databaseName <value>] [--hostname <value>] [--name <value>] [--port <value>]
[--region <value>] [--useSupabaseAuth]
FLAGS
--databaseName=<value> Name of the database.
--hostname=<value> Hostname to connect to database.
--name=<value> Name of the instance.
--port=<value> Port number to connect to database.
--region=<value> Region to deploy instance to.
--useSupabaseAuth Use Supabase for auth.
DESCRIPTION
Create a new instance.
EXAMPLES
$ npx powersync instance create
See code: src/commands/instance/create.ts
Deploy changes to an existing instance.
USAGE
$ npx powersync instance deploy [--databaseName <value>] [--hostname <value>] [--name <value>] [--port <value>]
[--useSupabaseAuth]
FLAGS
--databaseName=<value> Name of the database.
--hostname=<value> Hostname to connect to database.
--name=<value> Name of the instance.
--port=<value> Port number to connect to database.
--useSupabaseAuth Use Supabase auth.
DESCRIPTION
Deploy changes to an existing instance.
EXAMPLES
$ npx powersync instance deploy
See code: src/commands/instance/deploy.ts
Destroy the current instance - THIS CANNOT BE UNDONE.
USAGE
$ npx powersync instance destroy [-s]
FLAGS
-s, --skipConfirmation Ignore confirmation question.
DESCRIPTION
Destroy the current instance - THIS CANNOT BE UNDONE.
EXAMPLES
$ npx powersync instance destroy
See code: src/commands/instance/destroy.ts
View the schema of the current instance.
USAGE
$ npx powersync instance schema
DESCRIPTION
View the schema of the current instance.
EXAMPLES
$ npx powersync instance schema
See code: src/commands/instance/schema.ts
Set the current instance.
USAGE
$ npx powersync instance set [-i <value>]
FLAGS
-i, --instanceId=<value> Instance ID to change to.
DESCRIPTION
Set the current instance.
EXAMPLES
$ npx powersync instance set
$ npx powersync instance set --instanceId=1234
See code: src/commands/instance/set.ts
View the status of the current instance. View the status of a different instance by using flags.
USAGE
$ npx powersync instance status [-t <value>] [-i <value>] [-o <value>] [-p <value>]
FLAGS
-i, --instanceId=<value> Override current instance by providing the ID of a different instance.
-o, --orgId=<value> Override current organization by providing the ID of a different organization.
-p, --projectId=<value> Override current project by providing the ID of a different project.
-t, --authToken=<value> Override current auth token.
DESCRIPTION
View the status of the current instance. View the status of a different instance by using flags.
EXAMPLES
$ npx powersync instance status
$ npx powersync instance status --orgId=1234 --projectId=1234 --instanceId=1234 --authToken=1234
See code: src/commands/instance/status.ts
Stop the current instance.
USAGE
$ npx powersync instance stop [-s]
FLAGS
-s, --skipConfirmation Ignore confirmation question.
DESCRIPTION
Stop the current instance.
EXAMPLES
$ npx powersync instance stop
See code: src/commands/instance/stop.ts
Deploy sync rules from a local sync rules config file to the current instance.
USAGE
$ npx powersync instance sync-rules deploy -f <value> [-s]
FLAGS
-f, --filePath=<value> (required) Path to the sync rules config file.
-s, --skipConfirmation Ignore confirmation question.
DESCRIPTION
Deploy sync rules from a local sync rules config file to the current instance.
EXAMPLES
$ npx powersync instance sync-rules deploy
$ npx powersync instance sync-rules deploy --filePath path/to/file
$ npx powersync instance sync-rules deploy -f path/to/file
See code: src/commands/instance/sync-rules/deploy.ts
Generate schema in your language from your sync rules config file.
USAGE
$ npx powersync instance sync-rules generate-schema -f <value> [-l js|dart]
FLAGS
-f, --filePath=<value> (required) Path to the sync rules config file.
-l, --language=<option> Choose language for output.
<options: js|dart>
DESCRIPTION
Generate schema in your language from your sync rules config file.
EXAMPLES
$ npx powersync instance sync-rules generate-schema
$ npx powersync instance sync-rules generate-schema --filePath path/to/file
$ npx powersync instance sync-rules generate-schema -f path/to/file
See code: src/commands/instance/sync-rules/generate-schema.ts
Validate sync rules from a local sync rules config file.
USAGE
$ npx powersync instance sync-rules validate -f <value>
FLAGS
-f, --filePath=<value> (required) Path to the sync rules config file.
DESCRIPTION
Validate sync rules from a local sync rules config file.
EXAMPLES
$ npx powersync instance sync-rules validate
$ npx powersync instance sync-rules validate --filePath path/to/file
$ npx powersync instance sync-rules validate -f path/to/file
See code: src/commands/instance/sync-rules/validate.ts
View list of instances.
USAGE
$ npx powersync instances
DESCRIPTION
View list of instances.
EXAMPLES
$ npx powersync instances
See code: src/commands/instances.ts