powersync
v0.6.1
Published
PowerSync CLI
Downloads
1,596
Readme
PowerSync CLI
Programmatically manage your PowerSync environment.
For an overview, see the docs here.
Table of contents:
Usage
$ npx powersync
$ npx powersync COMMAND
running command...
$ npx powersync --help [COMMAND]
USAGE
$ npx powersync COMMAND
...
Inject ENV variables
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
Commands
powersync help [COMMAND]
powersync init
powersync instance config
powersync instance create
powersync instance deploy
powersync instance destroy
powersync instance generate-dev-token
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
powersync help [COMMAND]
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
powersync init
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
powersync instance config
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
powersync instance create
Create a new instance.
USAGE
$ npx powersync instance create [-n <value>] [-h <value>] [-w <value>] [-a <value>] [-i <value>] [-o <value>] [-r
<value>] [-s] [-b]
FLAGS
-a, --jwtAudiences=<value> JWT audiences (comma separated).
-b, --[no-]useSupabaseAuth Use Supabase auth.
-h, --hostname=<value> Hostname to connect to database.
-i, --name=<value> Name of the instance.
-n, --databaseName=<value> Name of the database.
-o, --port=<value> Port number to connect to database.
-r, --region=<value> Region to deploy instance to.
-s, --skipInteraction Skip interactivity.
-w, --jwksUri=<value> JWKS URI (must include https://).
DESCRIPTION
Create a new instance.
EXAMPLES
$ npx powersync instance create
See code: src/commands/instance/create.ts
powersync instance deploy
Deploy changes to an existing instance.
USAGE
$ npx powersync instance deploy [-n <value>] [-h <value>] [-w <value>] [-a <value>] [-o <value>] [-s] [-b]
FLAGS
-a, --jwtAudiences=<value> JWT audiences (comma separated).
-b, --[no-]useSupabaseAuth Use Supabase auth.
-h, --hostname=<value> Hostname to connect to database.
-n, --databaseName=<value> Name of the database.
-o, --port=<value> Port number to connect to database.
-s, --skipInteraction Skip interactivity.
-w, --jwksUri=<value> JWKS URI (must include https://).
DESCRIPTION
Deploy changes to an existing instance.
EXAMPLES
$ npx powersync instance deploy
See code: src/commands/instance/deploy.ts
powersync instance destroy
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
powersync instance generate-dev-token
Generate a developer token using the Token subject/ User ID.
USAGE
$ npx powersync instance generate-dev-token [-e <value>] [-u <value>]
FLAGS
-e, --expiresInSeconds=<value> The token expiry in seconds.
-u, --userId=<value> The Token subject/User ID for the developer token
DESCRIPTION
Generate a developer token using the Token subject/ User ID.
EXAMPLES
$ npx powersync instance generate-dev-token
See code: src/commands/instance/generate-dev-token.ts
powersync instance schema
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
powersync instance set
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
powersync instance status
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
powersync instance stop
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
powersync instance sync-rules deploy
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
powersync instance sync-rules generate-schema
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
powersync instance sync-rules validate
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
powersync instances
View list of instances.
USAGE
$ npx powersync instances
DESCRIPTION
View list of instances.
EXAMPLES
$ npx powersync instances
See code: src/commands/instances.ts