powersync 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +67 -0
- package/README.md +1376 -173
- package/bin/dev.cmd +3 -3
- package/bin/dev.js +20 -7
- package/bin/run.cmd +3 -3
- package/bin/run.js +9 -5
- package/dist/api/cloud/create-cloud-instance.d.ts +15 -0
- package/dist/api/cloud/create-cloud-instance.js +19 -0
- package/dist/api/cloud/fetch-cloud-config.d.ts +12 -0
- package/dist/api/cloud/fetch-cloud-config.js +18 -0
- package/dist/api/cloud/fetch-cloud-sync-rules-content.d.ts +7 -0
- package/dist/api/cloud/fetch-cloud-sync-rules-content.js +26 -0
- package/dist/api/cloud/test-connection.d.ts +16 -0
- package/dist/api/cloud/test-connection.js +36 -0
- package/dist/api/cloud/validate-cloud-link-config.d.ts +17 -0
- package/dist/api/cloud/validate-cloud-link-config.js +47 -0
- package/dist/api/cloud/wait-for-operation.d.ts +16 -0
- package/dist/api/cloud/wait-for-operation.js +33 -0
- package/dist/api/cloud/write-cloud-link.d.ts +10 -0
- package/dist/api/cloud/write-cloud-link.js +21 -0
- package/dist/api/display-status.d.ts +4 -0
- package/dist/api/display-status.js +80 -0
- package/dist/api/ide/configure-vscode-ide.d.ts +14 -0
- package/dist/api/ide/configure-vscode-ide.js +62 -0
- package/dist/api/login-server.d.ts +26 -0
- package/dist/api/login-server.js +137 -0
- package/dist/api/run-validation-tests.d.ts +63 -0
- package/dist/api/run-validation-tests.js +202 -0
- package/dist/api/self-hosted/fetch-self-hosted-sync-rules-content.d.ts +7 -0
- package/dist/api/self-hosted/fetch-self-hosted-sync-rules-content.js +26 -0
- package/dist/commands/configure/ide.d.ts +8 -0
- package/dist/commands/configure/ide.js +58 -0
- package/dist/commands/configure/index.d.ts +8 -0
- package/dist/commands/configure/index.js +11 -0
- package/dist/commands/deploy/index.d.ts +48 -0
- package/dist/commands/deploy/index.js +333 -0
- package/dist/commands/deploy/service-config.d.ts +14 -0
- package/dist/commands/deploy/service-config.js +30 -0
- package/dist/commands/deploy/sync-config.d.ts +24 -0
- package/dist/commands/deploy/sync-config.js +103 -0
- package/dist/commands/destroy.d.ts +14 -0
- package/dist/commands/destroy.js +62 -0
- package/dist/commands/fetch/config.d.ts +14 -0
- package/dist/commands/fetch/config.js +33 -0
- package/dist/commands/fetch/index.d.ts +13 -0
- package/dist/commands/fetch/index.js +16 -0
- package/dist/commands/fetch/instances.d.ts +47 -0
- package/dist/commands/fetch/instances.js +177 -0
- package/dist/commands/fetch/status.d.ts +18 -0
- package/dist/commands/fetch/status.js +60 -0
- package/dist/commands/{instance/schema.d.ts → generate/index.d.ts} +3 -1
- package/dist/commands/generate/index.js +11 -0
- package/dist/commands/generate/schema.d.ts +19 -0
- package/dist/commands/generate/schema.js +72 -0
- package/dist/commands/generate/token.d.ts +25 -0
- package/dist/commands/generate/token.js +124 -0
- package/dist/commands/init/cloud.d.ts +11 -0
- package/dist/commands/init/cloud.js +64 -0
- package/dist/commands/{init.d.ts → init/index.d.ts} +2 -1
- package/dist/commands/init/index.js +11 -0
- package/dist/commands/init/self-hosted.d.ts +11 -0
- package/dist/commands/init/self-hosted.js +60 -0
- package/dist/commands/link/cloud.d.ts +15 -0
- package/dist/commands/link/cloud.js +111 -0
- package/dist/commands/{instance/config.d.ts → link/index.d.ts} +3 -1
- package/dist/commands/link/index.js +11 -0
- package/dist/commands/link/self-hosted.d.ts +12 -0
- package/dist/commands/link/self-hosted.js +54 -0
- package/dist/commands/login.d.ts +8 -0
- package/dist/commands/login.js +107 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.js +19 -0
- package/dist/commands/migrate/index.d.ts +7 -0
- package/dist/commands/migrate/index.js +10 -0
- package/dist/commands/migrate/sync-rules.d.ts +15 -0
- package/dist/commands/migrate/sync-rules.js +51 -0
- package/dist/commands/{instances.d.ts → pull/index.d.ts} +3 -1
- package/dist/commands/pull/index.js +11 -0
- package/dist/commands/pull/instance.d.ts +14 -0
- package/dist/commands/pull/instance.js +108 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +2 -0
- package/dist/commands/stop.d.ts +14 -0
- package/dist/commands/stop.js +62 -0
- package/dist/commands/validate.d.ts +16 -0
- package/dist/commands/validate.js +165 -0
- package/dist/help.d.ts +31 -0
- package/dist/help.js +123 -0
- package/oclif.manifest.json +1259 -330
- package/package.json +104 -75
- package/templates/cloud/powersync/cli.yaml +3 -0
- package/templates/cloud/powersync/service.yaml +174 -0
- package/templates/cloud/powersync/sync-config.yaml +22 -0
- package/templates/self-hosted/base/powersync/cli.yaml +3 -0
- package/templates/self-hosted/base/powersync/service.yaml +243 -0
- package/templates/self-hosted/base/powersync/sync-config.yaml +22 -0
- package/templates/vscode/settings.json +3 -0
- package/dist/commands/init.js +0 -66
- package/dist/commands/instance/config.js +0 -23
- package/dist/commands/instance/create.d.ts +0 -36
- package/dist/commands/instance/create.js +0 -137
- package/dist/commands/instance/deploy.d.ts +0 -21
- package/dist/commands/instance/deploy.js +0 -91
- package/dist/commands/instance/destroy.d.ts +0 -9
- package/dist/commands/instance/destroy.js +0 -46
- package/dist/commands/instance/generate-dev-token.d.ts +0 -10
- package/dist/commands/instance/generate-dev-token.js +0 -54
- package/dist/commands/instance/schema.js +0 -20
- package/dist/commands/instance/set.d.ts +0 -9
- package/dist/commands/instance/set.js +0 -31
- package/dist/commands/instance/status.d.ts +0 -12
- package/dist/commands/instance/status.js +0 -50
- package/dist/commands/instance/stop.d.ts +0 -9
- package/dist/commands/instance/stop.js +0 -42
- package/dist/commands/instance/sync-rules/deploy.d.ts +0 -10
- package/dist/commands/instance/sync-rules/deploy.js +0 -49
- package/dist/commands/instance/sync-rules/generate-schema.d.ts +0 -10
- package/dist/commands/instance/sync-rules/generate-schema.js +0 -56
- package/dist/commands/instance/sync-rules/validate.d.ts +0 -9
- package/dist/commands/instance/sync-rules/validate.js +0 -29
- package/dist/commands/instances.js +0 -29
- package/dist/commands.utils.d.ts +0 -2
- package/dist/commands.utils.js +0 -131
- package/dist/connection.utils.d.ts +0 -56
- package/dist/connection.utils.js +0 -76
- package/dist/constants.d.ts +0 -8
- package/dist/constants.js +0 -10
- package/dist/instance-command-flags.d.ts +0 -13
- package/dist/instance-command-flags.js +0 -22
- package/dist/service/accounts.client.js +0 -11307
- package/dist/service/powersync.client.js +0 -75510
- package/dist/service/types.js +0 -1
- package/dist/service/utils.js +0 -153
- package/dist/utils.d.ts +0 -14
- package/dist/utils.js +0 -68
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ux } from '@oclif/core';
|
|
2
|
+
import { CLI_FILENAME, CommandHelpGroup, InstanceCommand, SERVICE_FILENAME, SYNC_FILENAME, YAML_CLI_SCHEMA, YAML_SERVICE_SCHEMA, YAML_SYNC_RULES_SCHEMA } from '@powersync/cli-core';
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const TEMPLATES_DIR = join(__dirname, '..', '..', '..', 'templates');
|
|
8
|
+
export default class InitCloud extends InstanceCommand {
|
|
9
|
+
static commandHelpGroup = CommandHelpGroup.PROJECT_SETUP;
|
|
10
|
+
static description = 'Copy a Cloud template into a config directory (default powersync/). Edit service.yaml then run link cloud and deploy.';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %>',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --directory=powersync'
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
...InstanceCommand.flags
|
|
17
|
+
};
|
|
18
|
+
static summary = 'Scaffold a PowerSync Cloud config directory from a template.';
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(InitCloud);
|
|
21
|
+
const { directory } = flags;
|
|
22
|
+
const targetDir = this.resolveProjectDir(flags);
|
|
23
|
+
if (existsSync(targetDir)) {
|
|
24
|
+
this.styledError({
|
|
25
|
+
message: `Directory "${directory}" already exists. Delete the folder to start over, or link existing config to PowerSync Cloud with ${ux.colorize('blue', 'powersync link')}.`
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const templatePath = join(TEMPLATES_DIR, 'cloud', 'powersync');
|
|
29
|
+
if (!existsSync(templatePath)) {
|
|
30
|
+
this.styledError({
|
|
31
|
+
message: `Template not found for cloud at ${templatePath}`
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
mkdirSync(targetDir, { recursive: true });
|
|
35
|
+
cpSync(templatePath, targetDir, { recursive: true });
|
|
36
|
+
const servicePath = join(targetDir, SERVICE_FILENAME);
|
|
37
|
+
const syncPath = join(targetDir, SYNC_FILENAME);
|
|
38
|
+
const cliPath = join(targetDir, CLI_FILENAME);
|
|
39
|
+
writeFileSync(servicePath, `${YAML_SERVICE_SCHEMA}\n\n${readFileSync(servicePath, 'utf8')}`);
|
|
40
|
+
writeFileSync(syncPath, `${YAML_SYNC_RULES_SCHEMA}\n\n${readFileSync(syncPath, 'utf8')}`);
|
|
41
|
+
writeFileSync(cliPath, `${YAML_CLI_SCHEMA}\n\n${readFileSync(cliPath, 'utf8')}`);
|
|
42
|
+
const instructions = [
|
|
43
|
+
'Create a new instance with ',
|
|
44
|
+
ux.colorize('blue', '\tpowersync link cloud --create --org-id=<org-id> --project-id=<project-id>'),
|
|
45
|
+
'or pull an existing instance with ',
|
|
46
|
+
ux.colorize('blue', '\tpowersync pull instance --org-id=<org-id> --project-id=<project-id> --instance-id=<instance-id>'),
|
|
47
|
+
`Tip: use ${ux.colorize('blue', 'powersync fetch instances')} to see available organizations and projects for your token.`,
|
|
48
|
+
'Then run',
|
|
49
|
+
ux.colorize('blue', '\tpowersync deploy'),
|
|
50
|
+
'to deploy changes.'
|
|
51
|
+
].join('\n');
|
|
52
|
+
const lines = [
|
|
53
|
+
ux.colorize('green', 'Created PowerSync cloud project!'),
|
|
54
|
+
'',
|
|
55
|
+
'Configuration files are located in:',
|
|
56
|
+
`\t${targetDir}`,
|
|
57
|
+
`Check the ${SERVICE_FILENAME} and ${SYNC_FILENAME} file(s) and configure them by uncommenting the options you would like to use.`,
|
|
58
|
+
`Tip: Run ${ux.colorize('blue', 'powersync configure ide')} to configure your IDE for YAML schema support.`,
|
|
59
|
+
'',
|
|
60
|
+
instructions
|
|
61
|
+
];
|
|
62
|
+
this.log(lines.join('\n'));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Init extends Command {
|
|
3
|
+
static description = '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.';
|
|
4
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
5
|
+
static hidden = true;
|
|
6
|
+
static summary = 'Scaffold a PowerSync config directory from a template.';
|
|
7
|
+
async run() {
|
|
8
|
+
await this.parse(Init);
|
|
9
|
+
this.log('Use a subcommand: init cloud | init self-hosted');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommandHelpGroup, InstanceCommand } from '@powersync/cli-core';
|
|
2
|
+
export default class InitSelfHosted extends InstanceCommand {
|
|
3
|
+
static commandHelpGroup: CommandHelpGroup;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static summary: string;
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ux } from '@oclif/core';
|
|
2
|
+
import { CLI_FILENAME, CommandHelpGroup, InstanceCommand, SERVICE_FILENAME, SYNC_FILENAME, YAML_CLI_SCHEMA, YAML_SERVICE_SCHEMA, YAML_SYNC_RULES_SCHEMA } from '@powersync/cli-core';
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const TEMPLATES_DIR = join(__dirname, '..', '..', '..', 'templates');
|
|
8
|
+
export default class InitSelfHosted extends InstanceCommand {
|
|
9
|
+
static commandHelpGroup = CommandHelpGroup.PROJECT_SETUP;
|
|
10
|
+
static description = 'Copy a self-hosted template into a config directory (default powersync/). Configure service.yaml with your self-hosted instance details.';
|
|
11
|
+
static examples = [
|
|
12
|
+
'<%= config.bin %> <%= command.id %>',
|
|
13
|
+
'<%= config.bin %> <%= command.id %> --directory=powersync'
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
...InstanceCommand.flags
|
|
17
|
+
};
|
|
18
|
+
static summary = 'Scaffold a PowerSync self-hosted config directory from a template.';
|
|
19
|
+
async run() {
|
|
20
|
+
const { flags } = await this.parse(InitSelfHosted);
|
|
21
|
+
const { directory } = flags;
|
|
22
|
+
const targetDir = this.resolveProjectDir(flags);
|
|
23
|
+
if (existsSync(targetDir)) {
|
|
24
|
+
this.styledError({
|
|
25
|
+
message: `Directory "${directory}" already exists. Delete the folder to start over, or link existing config with ${ux.colorize('blue', 'powersync link self-hosted')}.`
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const templatePath = join(TEMPLATES_DIR, 'self-hosted', 'base', 'powersync');
|
|
29
|
+
if (!existsSync(templatePath)) {
|
|
30
|
+
this.styledError({
|
|
31
|
+
message: `Template not found for self-hosted at ${templatePath}`
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
mkdirSync(targetDir, { recursive: true });
|
|
35
|
+
cpSync(templatePath, targetDir, { recursive: true });
|
|
36
|
+
const servicePath = join(targetDir, SERVICE_FILENAME);
|
|
37
|
+
const syncPath = join(targetDir, SYNC_FILENAME);
|
|
38
|
+
const cliPath = join(targetDir, CLI_FILENAME);
|
|
39
|
+
writeFileSync(servicePath, `${YAML_SERVICE_SCHEMA}\n\n${readFileSync(servicePath, 'utf8')}`);
|
|
40
|
+
writeFileSync(syncPath, `${YAML_SYNC_RULES_SCHEMA}\n\n${readFileSync(syncPath, 'utf8')}`);
|
|
41
|
+
writeFileSync(cliPath, `${YAML_CLI_SCHEMA}\n\n${readFileSync(cliPath, 'utf8')}`);
|
|
42
|
+
const instructions = [
|
|
43
|
+
'Self Hosted projects currently require external configuration for starting and deploying.',
|
|
44
|
+
`Configure the ${SERVICE_FILENAME} file with your self-hosted instance details.`,
|
|
45
|
+
`See the Docker topic, with ${ux.colorize('blue', 'powersync docker --help')} for local development services.`,
|
|
46
|
+
'Please refer to the PowerSync Self-Hosted documentation for more information.'
|
|
47
|
+
].join('\n');
|
|
48
|
+
const lines = [
|
|
49
|
+
ux.colorize('green', 'Created PowerSync self-hosted project!'),
|
|
50
|
+
'',
|
|
51
|
+
'Configuration files are located in:',
|
|
52
|
+
`\t${targetDir}`,
|
|
53
|
+
`Check the ${SERVICE_FILENAME} and ${SYNC_FILENAME} file(s) and configure them by uncommenting the options you would like to use.`,
|
|
54
|
+
`Tip: Run ${ux.colorize('blue', 'powersync configure ide')} to configure your IDE for YAML schema support.`,
|
|
55
|
+
'',
|
|
56
|
+
instructions
|
|
57
|
+
];
|
|
58
|
+
this.log(lines.join('\n'));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CloudInstanceCommand, CommandHelpGroup } from '@powersync/cli-core';
|
|
2
|
+
export default class LinkCloud extends CloudInstanceCommand {
|
|
3
|
+
static commandHelpGroup: CommandHelpGroup;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
create: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
'instance-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'org-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'project-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
static summary: string;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Flags, ux } from '@oclif/core';
|
|
2
|
+
import { CLI_FILENAME, CloudInstanceCommand, CommandHelpGroup, ensureServiceTypeMatches, env, getDefaultOrgId, InstanceCommand, ServiceType } from '@powersync/cli-core';
|
|
3
|
+
import { createCloudInstance } from '../../api/cloud/create-cloud-instance.js';
|
|
4
|
+
import { validateCloudLinkConfig } from '../../api/cloud/validate-cloud-link-config.js';
|
|
5
|
+
import { writeCloudLink } from '../../api/cloud/write-cloud-link.js';
|
|
6
|
+
export default class LinkCloud extends CloudInstanceCommand {
|
|
7
|
+
static commandHelpGroup = CommandHelpGroup.PROJECT_SETUP;
|
|
8
|
+
static description = 'Write or update cli.yaml with a Cloud instance (instance-id, org-id, project-id). Use --create to create a new instance from service.yaml name/region and link it; omit --instance-id when using --create. Org ID is optional when the token has a single organization.';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --project-id=<project-id>',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --create --project-id=<project-id>',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --instance-id=<id> --project-id=<project-id> --org-id=<org-id>'
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
create: Flags.boolean({
|
|
16
|
+
default: false,
|
|
17
|
+
description: 'Create a new Cloud instance in the given org and project, then link. Do not supply --instance-id when using --create.'
|
|
18
|
+
}),
|
|
19
|
+
'instance-id': Flags.string({
|
|
20
|
+
default: env.INSTANCE_ID,
|
|
21
|
+
description: 'PowerSync Cloud instance ID. Omit when using --create. Resolved: flag → INSTANCE_ID → cli.yaml.',
|
|
22
|
+
required: false
|
|
23
|
+
}),
|
|
24
|
+
'org-id': Flags.string({
|
|
25
|
+
default: env.ORG_ID,
|
|
26
|
+
description: 'Organization ID. Optional when the token has a single org; required when the token has multiple orgs. Resolved: flag → ORG_ID → cli.yaml.',
|
|
27
|
+
required: false
|
|
28
|
+
}),
|
|
29
|
+
'project-id': Flags.string({
|
|
30
|
+
default: env.PROJECT_ID,
|
|
31
|
+
description: 'Project ID. Resolved: flag → PROJECT_ID → cli.yaml.',
|
|
32
|
+
required: true
|
|
33
|
+
}),
|
|
34
|
+
...InstanceCommand.flags
|
|
35
|
+
};
|
|
36
|
+
static summary = '[Cloud only] Link to a PowerSync Cloud instance (or create one with --create).';
|
|
37
|
+
async run() {
|
|
38
|
+
const { flags } = await this.parse(LinkCloud);
|
|
39
|
+
let { create, directory, 'instance-id': instanceId, 'org-id': orgId, 'project-id': projectId } = flags;
|
|
40
|
+
if (!orgId) {
|
|
41
|
+
orgId = await getDefaultOrgId();
|
|
42
|
+
}
|
|
43
|
+
const projectDirectory = this.resolveProjectDir(flags);
|
|
44
|
+
if (create) {
|
|
45
|
+
if (instanceId) {
|
|
46
|
+
this.styledError({
|
|
47
|
+
message: 'Do not supply --instance-id when using --create. The instance will be created and linked.'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
await validateCloudLinkConfig({
|
|
52
|
+
cloudClient: this.client,
|
|
53
|
+
input: { orgId, projectId },
|
|
54
|
+
validateInstance: false
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
this.styledError({ message: error instanceof Error ? error.message : String(error) });
|
|
59
|
+
}
|
|
60
|
+
const config = this.parseLocalConfig(projectDirectory);
|
|
61
|
+
const { client } = this;
|
|
62
|
+
let newInstanceId;
|
|
63
|
+
try {
|
|
64
|
+
const result = await createCloudInstance(client, {
|
|
65
|
+
name: config.name,
|
|
66
|
+
orgId,
|
|
67
|
+
projectId,
|
|
68
|
+
region: config.region
|
|
69
|
+
});
|
|
70
|
+
newInstanceId = result.instanceId;
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
this.styledError({ error, message: 'Failed to create Cloud instance' });
|
|
74
|
+
}
|
|
75
|
+
ensureServiceTypeMatches({
|
|
76
|
+
command: this,
|
|
77
|
+
configRequired: false,
|
|
78
|
+
directoryLabel: directory,
|
|
79
|
+
expectedType: ServiceType.CLOUD,
|
|
80
|
+
projectDir: projectDirectory
|
|
81
|
+
});
|
|
82
|
+
writeCloudLink(projectDirectory, { instanceId: newInstanceId, orgId, projectId });
|
|
83
|
+
this.log(ux.colorize('green', `Created Cloud instance ${newInstanceId} and updated ${directory}/${CLI_FILENAME}.`));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!instanceId) {
|
|
87
|
+
this.styledError({
|
|
88
|
+
message: 'Linking requires an instance ID. Supply --instance-id (or use --create to create a new instance and link).'
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
await validateCloudLinkConfig({
|
|
93
|
+
cloudClient: this.client,
|
|
94
|
+
input: { instanceId, orgId, projectId },
|
|
95
|
+
validateInstance: true
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
this.styledError({ message: error instanceof Error ? error.message : String(error) });
|
|
100
|
+
}
|
|
101
|
+
writeCloudLink(projectDirectory, { instanceId, orgId, projectId });
|
|
102
|
+
ensureServiceTypeMatches({
|
|
103
|
+
command: this,
|
|
104
|
+
configRequired: false,
|
|
105
|
+
directoryLabel: directory,
|
|
106
|
+
expectedType: ServiceType.CLOUD,
|
|
107
|
+
projectDir: projectDirectory
|
|
108
|
+
});
|
|
109
|
+
this.log(ux.colorize('green', `Updated ${directory}/${CLI_FILENAME} with Cloud instance link.`));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class Link extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
+
static hidden: boolean;
|
|
6
|
+
static summary: string;
|
|
5
7
|
run(): Promise<void>;
|
|
6
8
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Link extends Command {
|
|
3
|
+
static description = "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.";
|
|
4
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
5
|
+
static hidden = true;
|
|
6
|
+
static summary = 'Bind this directory to a Cloud or self-hosted instance (writes cli.yaml).';
|
|
7
|
+
async run() {
|
|
8
|
+
await this.parse(Link);
|
|
9
|
+
this.log('Use a subcommand: link cloud | link self-hosted');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommandHelpGroup, SelfHostedInstanceCommand } from '@powersync/cli-core';
|
|
2
|
+
export default class LinkSelfHosted extends SelfHostedInstanceCommand {
|
|
3
|
+
static commandHelpGroup: CommandHelpGroup;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
static summary: string;
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { input } from '@inquirer/prompts';
|
|
2
|
+
import { Flags, ux } from '@oclif/core';
|
|
3
|
+
import { CLI_FILENAME, CommandHelpGroup, ensureServiceTypeMatches, env, InstanceCommand, parseYamlFile, SelfHostedInstanceCommand, ServiceType } from '@powersync/cli-core';
|
|
4
|
+
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { Document } from 'yaml';
|
|
7
|
+
export default class LinkSelfHosted extends SelfHostedInstanceCommand {
|
|
8
|
+
static commandHelpGroup = CommandHelpGroup.PROJECT_SETUP;
|
|
9
|
+
static description = [
|
|
10
|
+
`Links a self hosted PowerSync instance by API URL.`,
|
|
11
|
+
`API Keys can be specified via input or specified in the PS_ADMIN_TOKEN environment variable.`
|
|
12
|
+
].join('\n');
|
|
13
|
+
static examples = ['<%= config.bin %> <%= command.id %> --api-url=https://powersync.example.com'];
|
|
14
|
+
static flags = {
|
|
15
|
+
'api-url': Flags.string({
|
|
16
|
+
description: 'Self-hosted PowerSync API base URL (e.g. https://powersync.example.com).',
|
|
17
|
+
required: true
|
|
18
|
+
}),
|
|
19
|
+
...InstanceCommand.flags
|
|
20
|
+
};
|
|
21
|
+
static summary = 'Link to a self-hosted PowerSync instance by API URL.';
|
|
22
|
+
async run() {
|
|
23
|
+
const { flags } = await this.parse(LinkSelfHosted);
|
|
24
|
+
const { 'api-url': apiUrl, directory } = flags;
|
|
25
|
+
const projectDir = this.resolveProjectDir(flags);
|
|
26
|
+
if (!existsSync(projectDir)) {
|
|
27
|
+
mkdirSync(projectDir, { recursive: true });
|
|
28
|
+
}
|
|
29
|
+
const defaultApiKey = '!env PS_ADMIN_TOKEN';
|
|
30
|
+
// If running non-interactively, default to !env PS_ADMIN_TOKEN instead of prompting.
|
|
31
|
+
const shouldPromptForApiKey = !env.PS_ADMIN_TOKEN && Boolean(process.stdin.isTTY);
|
|
32
|
+
const apiKey = shouldPromptForApiKey
|
|
33
|
+
? await input({
|
|
34
|
+
default: '!env PS_ADMIN_TOKEN',
|
|
35
|
+
message: 'API key (default: !env PS_ADMIN_TOKEN — read from PS_ADMIN_TOKEN when running commands):'
|
|
36
|
+
})
|
|
37
|
+
: defaultApiKey;
|
|
38
|
+
// Preserve comments
|
|
39
|
+
const linkPath = join(projectDir, CLI_FILENAME);
|
|
40
|
+
const doc = existsSync(linkPath) ? parseYamlFile(linkPath) : new Document();
|
|
41
|
+
doc.set('type', 'self-hosted');
|
|
42
|
+
doc.set('api_url', apiUrl);
|
|
43
|
+
doc.set('api_key', apiKey.trim() || '!env PS_ADMIN_TOKEN');
|
|
44
|
+
writeFileSync(linkPath, doc.toString(), 'utf8');
|
|
45
|
+
ensureServiceTypeMatches({
|
|
46
|
+
command: this,
|
|
47
|
+
configRequired: false,
|
|
48
|
+
directoryLabel: directory,
|
|
49
|
+
expectedType: ServiceType.SELF_HOSTED,
|
|
50
|
+
projectDir
|
|
51
|
+
});
|
|
52
|
+
this.log(ux.colorize('green', `Updated ${directory}/${CLI_FILENAME} with self-hosted link.`));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommandHelpGroup, PowerSyncCommand } from '@powersync/cli-core';
|
|
2
|
+
export default class Login extends PowerSyncCommand {
|
|
3
|
+
static commandHelpGroup: CommandHelpGroup;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static summary: string;
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { confirm, password } from '@inquirer/prompts';
|
|
2
|
+
import { ux } from '@oclif/core';
|
|
3
|
+
import { CommandHelpGroup, createAccountsHubClient, PowerSyncCommand, Services } from '@powersync/cli-core';
|
|
4
|
+
import { startPATLoginServer } from '../api/login-server.js';
|
|
5
|
+
export default class Login extends PowerSyncCommand {
|
|
6
|
+
static commandHelpGroup = CommandHelpGroup.AUTHENTICATION;
|
|
7
|
+
static description = 'Store a PowerSync auth token (PAT) in secure storage so later Cloud commands run without passing a token. If secure storage is unavailable, login can optionally store it in a local config file. Use PS_ADMIN_TOKEN env var for CI or scripts instead.';
|
|
8
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
9
|
+
static summary = 'Store auth token for Cloud commands.';
|
|
10
|
+
async run() {
|
|
11
|
+
await this.parse(Login);
|
|
12
|
+
const { authentication, storage } = Services;
|
|
13
|
+
const shouldUseInsecureStorage = !storage.capabilities.supportsSecureStorage &&
|
|
14
|
+
(await confirm({
|
|
15
|
+
default: false,
|
|
16
|
+
message: `Keychain storage is unavailable on this platform. Store token in plaintext at ${storage.insecureStoragePath}? Set the ${ux.colorize('blue', 'PS_ADMIN_TOKEN')} environment variable instead to avoid this.`
|
|
17
|
+
}));
|
|
18
|
+
if (!storage.capabilities.supportsSecureStorage && !shouldUseInsecureStorage) {
|
|
19
|
+
this.log(`Login cancelled. Use ${ux.colorize('blue', 'PS_ADMIN_TOKEN')} environment variable for commands, or rerun login and allow local fallback storage.`);
|
|
20
|
+
this.exit(0);
|
|
21
|
+
}
|
|
22
|
+
const listOrgs = async () => {
|
|
23
|
+
const accountsHubClient = createAccountsHubClient();
|
|
24
|
+
const orgs = await accountsHubClient.listOrganizations({});
|
|
25
|
+
const objects = orgs?.objects ?? [];
|
|
26
|
+
return objects.map((org) => `\t - ${org.label} - ${org.id}`).join('\n');
|
|
27
|
+
};
|
|
28
|
+
const existingToken = await authentication.getToken();
|
|
29
|
+
if (existingToken) {
|
|
30
|
+
this.log('An existing token was found. This existing token has access to the following organizations:');
|
|
31
|
+
try {
|
|
32
|
+
this.log(await listOrgs());
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
this.log(`\tFailed to list organizations. This is normal if the token is not valid. ${ux.colorize('blue', JSON.stringify(error))}`);
|
|
36
|
+
}
|
|
37
|
+
const overwrite = await confirm({
|
|
38
|
+
default: false,
|
|
39
|
+
message: 'Do you want to overwrite the existing token?'
|
|
40
|
+
});
|
|
41
|
+
if (overwrite) {
|
|
42
|
+
await authentication.deleteToken();
|
|
43
|
+
this.log('Existing token deleted.');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
this.exit(0);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const openBrowser = await confirm({
|
|
50
|
+
default: true,
|
|
51
|
+
message: 'Would you like to open a browser to generate a token?'
|
|
52
|
+
});
|
|
53
|
+
// Allows aborting the prompt if the server returns the token
|
|
54
|
+
const abortController = new AbortController();
|
|
55
|
+
const serverResponse = openBrowser ? await startPATLoginServer(abortController.signal) : null;
|
|
56
|
+
if (serverResponse) {
|
|
57
|
+
this.log(`Waiting on ${ux.colorize('blue', serverResponse.address)} for you to create a token in the dashboard...`);
|
|
58
|
+
}
|
|
59
|
+
const serverTokenPromise = serverResponse
|
|
60
|
+
? serverResponse.tokenPromise.then((token) => {
|
|
61
|
+
// Abort the prompt if the server returns the token
|
|
62
|
+
abortController.abort();
|
|
63
|
+
return token.trim();
|
|
64
|
+
})
|
|
65
|
+
: null;
|
|
66
|
+
const promptTokenPromise = password({
|
|
67
|
+
mask: true,
|
|
68
|
+
message: openBrowser
|
|
69
|
+
? 'Enter the token if the browser failed to send it to the CLI'
|
|
70
|
+
: 'Enter your API token (https://docs.powersync.com/usage/tools/cli#personal-access-token):'
|
|
71
|
+
}, { signal: abortController.signal })
|
|
72
|
+
.then((token) => {
|
|
73
|
+
abortController.abort();
|
|
74
|
+
return token.trim();
|
|
75
|
+
})
|
|
76
|
+
.catch((error) => {
|
|
77
|
+
// When the browser flow succeeds first, aborting the prompt rejects with AbortError; swallow it.
|
|
78
|
+
if (abortController.signal.aborted)
|
|
79
|
+
return '';
|
|
80
|
+
throw error;
|
|
81
|
+
});
|
|
82
|
+
const pendingOperations = [promptTokenPromise];
|
|
83
|
+
if (serverTokenPromise) {
|
|
84
|
+
pendingOperations.push(serverTokenPromise);
|
|
85
|
+
}
|
|
86
|
+
const tokenResults = await Promise.allSettled(pendingOperations);
|
|
87
|
+
const promptToken = tokenResults[0]?.status === 'fulfilled' ? tokenResults[0].value.trim() : '';
|
|
88
|
+
const serverToken = serverTokenPromise && tokenResults[1]?.status === 'fulfilled' ? tokenResults[1].value.trim() : '';
|
|
89
|
+
const token = serverToken || promptToken;
|
|
90
|
+
if (!token?.trim()) {
|
|
91
|
+
this.styledError({ message: 'Token is required.' });
|
|
92
|
+
}
|
|
93
|
+
this.log('Testing token...');
|
|
94
|
+
try {
|
|
95
|
+
await authentication.setToken(token.trim());
|
|
96
|
+
const orgs = await listOrgs();
|
|
97
|
+
this.log('You have access to the following organizations:');
|
|
98
|
+
this.log(orgs);
|
|
99
|
+
this.log('Token is valid.');
|
|
100
|
+
this.log(ux.colorize('green', 'Token stored successfully.'));
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
await authentication.deleteToken();
|
|
104
|
+
this.styledError({ error, message: 'Invalid token. Please try again.' });
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CommandHelpGroup, PowerSyncCommand } from '@powersync/cli-core';
|
|
2
|
+
export default class Logout extends PowerSyncCommand {
|
|
3
|
+
static commandHelpGroup: CommandHelpGroup;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static summary: string;
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ux } from '@oclif/core';
|
|
2
|
+
import { CommandHelpGroup, PowerSyncCommand, Services } from '@powersync/cli-core';
|
|
3
|
+
export default class Logout extends PowerSyncCommand {
|
|
4
|
+
static commandHelpGroup = CommandHelpGroup.AUTHENTICATION;
|
|
5
|
+
static description = 'Remove the stored PowerSync auth token from secure storage or local fallback config storage. Cloud commands will no longer use stored credentials until you run login again.';
|
|
6
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
7
|
+
static summary = 'Remove stored auth token.';
|
|
8
|
+
async run() {
|
|
9
|
+
await this.parse(Logout);
|
|
10
|
+
const { authentication } = Services;
|
|
11
|
+
const token = await authentication.getToken();
|
|
12
|
+
if (!token) {
|
|
13
|
+
this.log('You were not logged in. Logout is a no-op.');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
await authentication.deleteToken();
|
|
17
|
+
this.log(ux.colorize('green', 'Logged out successfully.'));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command, ux } from '@oclif/core';
|
|
2
|
+
export default class Migrate extends Command {
|
|
3
|
+
static description = 'Migrate PowerSync config to newer formats. Use migrate sync-rules to convert Sync Rules to Sync Streams.';
|
|
4
|
+
static hidden = true;
|
|
5
|
+
static summary = 'Migrate config to newer formats (e.g. Sync Rules → Sync Streams).';
|
|
6
|
+
async run() {
|
|
7
|
+
await this.parse(Migrate);
|
|
8
|
+
this.log(ux.colorize('yellow', 'Use a subcommand: ') + ux.colorize('blue', 'migrate sync-rules'));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SharedInstanceCommand } from '@powersync/cli-core';
|
|
2
|
+
export default class MigrateSyncRules extends SharedInstanceCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
directory: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
'api-url': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
'instance-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
'org-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'input-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'output-file': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
static summary: string;
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Flags, ux } from '@oclif/core';
|
|
2
|
+
import { instantiate } from '@powersync-community/sync-config-rewriter';
|
|
3
|
+
import { SharedInstanceCommand, SYNC_FILENAME, YAML_SYNC_RULES_SCHEMA } from '@powersync/cli-core';
|
|
4
|
+
import { access, readFile, writeFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
export default class MigrateSyncRules extends SharedInstanceCommand {
|
|
8
|
+
static description = 'Migrates Sync Rules to Sync Streams';
|
|
9
|
+
static flags = {
|
|
10
|
+
'input-file': Flags.string({
|
|
11
|
+
description: 'Path to the input sync rules file. Defaults to the project sync-config.yaml file.',
|
|
12
|
+
required: false
|
|
13
|
+
}),
|
|
14
|
+
'output-file': Flags.string({
|
|
15
|
+
description: 'Path to the output sync streams file. Defaults to overwrite the input file.',
|
|
16
|
+
required: false
|
|
17
|
+
}),
|
|
18
|
+
...SharedInstanceCommand.flags
|
|
19
|
+
};
|
|
20
|
+
static summary = 'Migrates Sync Rules to Sync Streams';
|
|
21
|
+
async run() {
|
|
22
|
+
const { flags } = await this.parse(MigrateSyncRules);
|
|
23
|
+
const syncInputPath = flags['input-file'] ?? join(this.ensureProjectDirectory(flags), SYNC_FILENAME);
|
|
24
|
+
const syncOutputPath = flags['output-file'] ?? syncInputPath;
|
|
25
|
+
if (!(await access(syncInputPath)
|
|
26
|
+
.then(() => true)
|
|
27
|
+
.catch(() => false))) {
|
|
28
|
+
this.styledError({
|
|
29
|
+
message: `Sync input file ${syncInputPath} not found.`
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const syncInputContent = await readFile(syncInputPath, 'utf8');
|
|
33
|
+
const wasmBuffer = await readFile(fileURLToPath(import.meta.resolve('@powersync-community/sync-config-rewriter/compiled.wasm')));
|
|
34
|
+
const SyncStreamsRewriter = await instantiate(wasmBuffer);
|
|
35
|
+
const output = SyncStreamsRewriter.syncRulesToSyncStreams(syncInputContent);
|
|
36
|
+
switch (output.type) {
|
|
37
|
+
case 'error': {
|
|
38
|
+
this.styledError({
|
|
39
|
+
message: `Failed to migrate sync rules: ${output.diagnostics.map((d) => `${d.message} at line ${d.startOffset}, column ${d.length}`).join('\n')}`
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case 'success': {
|
|
44
|
+
const outputContent = output.result;
|
|
45
|
+
await writeFile(syncOutputPath, YAML_SYNC_RULES_SCHEMA + outputContent);
|
|
46
|
+
this.log(ux.colorize('green', `Wrote ${syncOutputPath} with migrated sync streams.`));
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
|
-
export default class
|
|
2
|
+
export default class Pull extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
+
static hidden: boolean;
|
|
6
|
+
static summary: string;
|
|
5
7
|
run(): Promise<void>;
|
|
6
8
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class Pull extends Command {
|
|
3
|
+
static description = '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).';
|
|
4
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
5
|
+
static hidden = true;
|
|
6
|
+
static summary = '[Cloud only] Download Cloud config into local service.yaml and sync-config.yaml.';
|
|
7
|
+
async run() {
|
|
8
|
+
await this.parse(Pull);
|
|
9
|
+
this.log('Use a subcommand: pull instance');
|
|
10
|
+
}
|
|
11
|
+
}
|