Skip to content

Commit e8aea02

Browse files
readme cleanup
1 parent c3a19f4 commit e8aea02

1 file changed

Lines changed: 14 additions & 27 deletions

File tree

cli/README.md

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,9 @@ CLI for PowerSync
1010
* [@powersync/cli](#powersynccli)
1111
* [Overview](#overview)
1212
* [Cloud](#cloud)
13-
* [Edit powersync/service.yaml and sync rules](#edit-powersyncserviceyaml-and-sync-rules)
14-
* [If your token has multiple orgs: add --org-id=<org-id>](#if-your-token-has-multiple-orgs-add---org-idorg-id)
15-
* [If your token has multiple orgs: add --org-id=<org-id>](#if-your-token-has-multiple-orgs-add---org-idorg-id)
16-
* [Edit powersync/service.yaml and sync.yaml as needed](#edit-powersyncserviceyaml-and-syncyaml-as-needed)
17-
* [If your token has multiple orgs: add --org-id=<org-id>](#if-your-token-has-multiple-orgs-add---org-idorg-id)
18-
* [Or with environment variables (set ORG_ID only if your token has multiple orgs)](#or-with-environment-variables-set-org_id-only-if-your-token-has-multiple-orgs)
1913
* [Self-hosted](#self-hosted)
20-
* [powersync/service.yaml (self-hosted instance config)](#powersyncserviceyaml-self-hosted-instance-config)
21-
* [powersync/cli.yaml (self-hosted)](#powersynccliyaml-self-hosted)
22-
* [Edit powersync/service.yaml](#edit-powersyncserviceyaml)
23-
* [Usage](#usage)
2414
* [Known Limitations](#known-limitations)
15+
* [Usage](#usage)
2516
* [Commands](#commands)
2617
<!-- tocstop -->
2718

@@ -61,10 +52,9 @@ Run **`powersync init cloud`** to scaffold the config directory. Configure **`se
6152

6253
```sh
6354
powersync init cloud
64-
# Edit powersync/service.yaml and sync rules
55+
# then edit powersync/service.yaml and sync rules
6556
powersync login
66-
powersync link cloud --create --project-id=<project-id>
67-
# If your token has multiple orgs: add --org-id=<org-id>
57+
powersync link cloud --create --project-id=<project-id> # add --org-id if token has multiple orgs
6858
powersync deploy
6959
```
7060

@@ -76,9 +66,8 @@ Run **`powersync pull instance`** with the instance identifiers (from the PowerS
7666

7767
```sh
7868
powersync login
79-
powersync pull instance --project-id=<project-id> --instance-id=<instance-id>
80-
# If your token has multiple orgs: add --org-id=<org-id>
81-
# Edit powersync/service.yaml and sync.yaml as needed
69+
powersync pull instance --project-id=<project-id> --instance-id=<instance-id> # add --org-id if multiple orgs
70+
# then edit powersync/service.yaml and sync.yaml as needed
8271
powersync deploy
8372
```
8473

@@ -92,10 +81,8 @@ Specify the instance using **environment variables** or **CLI flags** (flags tak
9281

9382
```sh
9483
powersync login
95-
powersync generate schema --instance-id=<id> --project-id=<project-id> --output-path=schema.ts --output=ts
96-
# If your token has multiple orgs: add --org-id=<org-id>
97-
98-
# Or with environment variables (set ORG_ID only if your token has multiple orgs)
84+
powersync generate schema --instance-id=<id> --project-id=<project-id> --output-path=schema.ts --output=ts # add --org-id if multiple orgs
85+
# or with env vars (set ORG_ID only if your token has multiple orgs):
9986
export PROJECT_ID=<project-id>
10087
export INSTANCE_ID=<instance-id>
10188
powersync generate schema --output-path=schema.ts --output=ts
@@ -112,7 +99,7 @@ The CLI can run a subset of commands against **self-hosted** PowerSync instances
11299
For any self-hosted instance (local or remote), you must link the running API to the CLI and configure an API key. On the **server** (your PowerSync instance config), define the tokens that are valid in **`service.yaml`**:
113100

114101
```yaml
115-
# powersync/service.yaml (self-hosted instance config)
102+
# powersync/service.yaml (self-hosted instance config)
116103
api:
117104
tokens:
118105
- dev-token-do-not-use-in-production # or use !env MY_API_TOKEN for secrets
@@ -121,7 +108,7 @@ api:
121108
Then tell the CLI which token to use when running commands. Run **`powersync link self-hosted --api-url <url>`** to write **`cli.yaml`** with the API URL, and either set the **`TOKEN`** environment variable or set **`api_key`** in **`cli.yaml`**:
122109

123110
```yaml
124-
# powersync/cli.yaml (self-hosted)
111+
# powersync/cli.yaml (self-hosted)
125112
type: self-hosted
126113
api_url: https://powersync.example.com
127114
api_key: !env TOKEN # or a literal value matching one of the tokens in service.yaml
@@ -135,7 +122,7 @@ Run **`powersync init self-hosted`** to scaffold a config directory. Edit **`ser
135122

136123
```sh
137124
powersync init self-hosted
138-
# Edit powersync/service.yaml
125+
# then edit powersync/service.yaml
139126
powersync link self-hosted --api-url https://powersync.example.com
140127
powersync fetch status
141128
```
@@ -150,6 +137,10 @@ We provide a [Docker plugin](../plugins/docker/README.md) for running a self-hos
150137

151138
Only some CLI commands work with self-hosted instances. Supported commands include **`powersync fetch status`**, **`powersync generate schema`**, **`powersync generate token`**, **`powersync validate`**, and **`powersync link self-hosted`**. Cloud-only commands such as **`powersync deploy`**, **`powersync destroy`**, **`powersync pull instance`**, **`powersync fetch config`**, and **`powersync fetch instances`** do not apply to self-hosted.
152139

140+
# Known Limitations
141+
142+
- **Login secure storage**: Secure storage for auth tokens is only supported on macOS (via Keychain). On Windows and Linux, `powersync login` will not persist credentials; use the `TOKEN` environment variable instead for Cloud commands.
143+
153144
# Usage
154145

155146
<!-- usage -->
@@ -166,10 +157,6 @@ USAGE
166157
```
167158
<!-- usagestop -->
168159

169-
# Known Limitations
170-
171-
- **Login secure storage**: Secure storage for auth tokens is only supported on macOS (via Keychain). On Windows and Linux, `powersync login` will not persist credentials; use the `TOKEN` environment variable instead for Cloud commands.
172-
173160
# Commands
174161

175162
<!-- commands -->

0 commit comments

Comments
 (0)