Skip to content

Commit 78c4f15

Browse files
wip: cleanup commands and topics
1 parent 3c4329d commit 78c4f15

12 files changed

Lines changed: 106 additions & 186 deletions

File tree

cli/README.md

Lines changed: 82 additions & 174 deletions
Large diffs are not rendered by default.

cli/package.json

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,26 @@
7575
],
7676
"topicSeparator": " ",
7777
"topics": {
78+
"deploy": {
79+
"description": "[Cloud only] Deploy local config changes to the Cloud instance. Run \"powersync deploy --help\" to list subcommands."
80+
},
7881
"fetch": {
79-
"description": "run \"powersync fetch\" to see a list of subcommands"
82+
"description": "Inspect Cloud instances and configuration (instances, config, status). Run \"powersync fetch --help\" to list subcommands."
8083
},
8184
"generate": {
82-
"description": "run \"powersync generate\" to see a list of subcommands"
85+
"description": "Generate client artifacts from instance/config data (schema, token). Run \"powersync generate --help\" to list subcommands."
8386
},
8487
"init": {
85-
"description": "run \"powersync init\" to see a list of subcommands"
88+
"description": "Scaffold a new PowerSync project configuration from templates. Run \"powersync init --help\" to list subcommands."
8689
},
8790
"link": {
88-
"description": "run \"powersync link\" to see a list of subcommands"
91+
"description": "Bind this directory to a Cloud or self-hosted instance (writes cli.yaml). Run \"powersync link --help\" to list subcommands."
92+
},
93+
"migrate": {
94+
"description": "Migrate config to newer formats (for example Sync Rules to Sync Streams). Run \"powersync migrate --help\" to list subcommands."
8995
},
9096
"pull": {
91-
"description": "run \"powersync pull\" to see a list of subcommands"
97+
"description": "[Cloud only] Download Cloud instance configuration into local files. Run \"powersync pull --help\" to list subcommands."
9298
}
9399
}
94100
},

cli/src/commands/deploy/sync-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class DeploySyncConfig extends DeployAll {
1212
static flags = {
1313
...DeployAll.flags
1414
};
15-
static summary = '[Cloud only] Deploy local sync config to the linked Cloud instance.';
15+
static summary = '[Cloud only] Deploy only local sync config to the linked Cloud instance.';
1616

1717
/**
1818
* Deploys only the sync config.

cli/src/commands/fetch/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default class Fetch extends Command {
1010
static description =
1111
'Subcommands: list Cloud instances in org/project (fetch instances), print instance config as YAML/JSON (fetch config), or show instance diagnostics (fetch status).';
1212
static examples = ['<%= config.bin %> <%= command.id %>'];
13+
static hidden = true;
1314
static summary = 'List instances, fetch config, or fetch instance diagnostics.';
1415

1516
async run(): Promise<void> {

cli/src/commands/generate/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default class Generate extends Command {
44
static description =
55
'Generate client artifacts: schema (from instance schema + sync config) or a development token for connecting clients. Cloud and self-hosted where supported.';
66
static examples = ['<%= config.bin %> <%= command.id %>'];
7+
static hidden = true;
78
static summary = 'Generate client schema or development token.';
89

910
async run(): Promise<void> {

cli/src/commands/init/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default class Init extends Command {
44
static description =
55
'Scaffold a PowerSync config directory from a template. Use init cloud or init self-hosted. For Cloud, edit service.yaml then run link cloud and deploy.';
66
static examples = ['<%= config.bin %> <%= command.id %>'];
7+
static hidden = true;
78
static summary = 'Scaffold a PowerSync config directory from a template.';
89

910
async run(): Promise<void> {

cli/src/commands/link/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default class Link extends Command {
44
static description =
55
"Write cli.yaml so this directory's config is bound to a PowerSync instance. Once linked, commands use that instance without passing IDs. Use link cloud or link self-hosted.";
66
static examples = ['<%= config.bin %> <%= command.id %>'];
7+
static hidden = true;
78
static summary = 'Bind this directory to a Cloud or self-hosted instance (writes cli.yaml).';
89

910
async run(): Promise<void> {

cli/src/commands/migrate/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Command, ux } from '@oclif/core';
33
export default class Migrate extends Command {
44
static description =
55
'Migrate PowerSync config to newer formats. Use migrate sync-rules to convert Sync Rules to Sync Streams.';
6+
static hidden = true;
67
static summary = 'Migrate config to newer formats (e.g. Sync Rules → Sync Streams).';
78

89
async run(): Promise<void> {

cli/src/commands/pull/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default class Pull extends Command {
44
static description =
55
'Download current config from PowerSync Cloud into local YAML files. Use pull instance; pass --instance-id and --project-id when the directory is not yet linked (--org-id is optional when the token has a single organization).';
66
static examples = ['<%= config.bin %> <%= command.id %>'];
7+
static hidden = true;
78
static summary = '[Cloud only] Download Cloud config into local service.yaml and sync.yaml.';
89

910
async run(): Promise<void> {

docs/cli-documentation-conventions.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ This document describes how we document commands and help text in the PowerSync
1717
- Use sentence case (e.g. "Optionally write instance information to a file." not "Optionally Write...").
1818
- For optional/override flags, mention resolution order when helpful (e.g. "Resolved: flag → INSTANCE_ID → cli.yaml.").
1919

20-
## Topics (package.json)
20+
## Topic index commands
2121

22-
In `cli/package.json`, under `oclif.topics`, add an entry for each topic (e.g. `fetch`, `generate`, `init`, `link`, `pull`, `deploy`) with a description that directs users to run the topic command to see subcommands, e.g.:
22+
For grouped commands (e.g. `fetch`, `generate`, `init`, `link`, `pull`, `migrate`), use an `index.ts` command that prints available subcommands when run directly.
2323

24-
```json
25-
"fetch": { "description": "run \"powersync fetch\" to see a list of subcommands" }
26-
```
24+
- Mark these index commands as hidden (`static hidden = true`) so they do not appear as separate entries in generated command lists.
25+
- Add matching `oclif.topics` entries in `cli/package.json` with a short purpose summary plus guidance in this form: `... Run "powersync <topic> --help" to list subcommands.`
2726

2827
## README
2928

0 commit comments

Comments
 (0)