npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

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 running npx powersync instances.

Example:

ORG_ID=123 PROJECT_ID=456 INSTANCE_ID=789 npx powersync instance status

Commands

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