Skip to content

Commit 34cef60

Browse files
document oclif plugins
1 parent 4c5bbaf commit 34cef60

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ The workspace is split into the main CLI, shared **packages**, and optional **pl
3939

4040
Workspace roots are listed in [pnpm-workspace.yaml](./pnpm-workspace.yaml): `cli`, `packages/*`, `plugins/*`.
4141

42+
## OCLIF plugins
43+
44+
We rely on standard [OCLIF plugin loading](https://oclif.io/docs/plugins/) so plugins can register new commands or hook into command execution. The main CLI ships with a Docker plugin under [plugins/docker](./plugins/docker), and any other OCLIF-compatible plugin can be installed the same way.
45+
46+
For PowerSync-specific plugins, the optional [@powersync/cli-core](./packages/cli-core) package exposes base command helpers and shared types. The Docker plugin consumes these helpers and adds Docker-focused commands as a reference implementation.
47+
48+
Users can manage their own installed plugins dynamically at runtime. Run `powersync plugins --help` for install, uninstall, and inspection options.
49+
4250
## Getting started
4351

4452
```bash

cli/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,28 @@ Only some CLI commands work with self-hosted instances. Supported commands inclu
148148

149149
- **Plaintext fallback storage**: When secure storage is unavailable, login can store the token in plaintext config (`$XDG_CONFIG_HOME/powersync/config.yaml` or `~/.config/powersync/config.yaml`) only after explicit confirmation.
150150

151+
# OCLIF plugins
152+
153+
The CLI honors standard [OCLIF plugin behavior](https://oclif.io/docs/plugins/), so plugins can register commands or hook into command lifecycles. The bundled Docker plugin (`@powersync/cli-plugin-docker`) is built this way and serves as a reference.
154+
155+
For PowerSync-specific plugins, the optional `@powersync/cli-core` package exposes base command helpers and shared types; the Docker plugin consumes these helpers to add its Docker-focused commands.
156+
157+
You can manage plugins dynamically at runtime:
158+
159+
```sh
160+
# list installed plugins
161+
powersync plugins
162+
163+
# install a published plugin
164+
powersync plugins install @example/powersync-plugin-foo
165+
166+
# link a local plugin during development
167+
powersync plugins link ../my-plugin
168+
169+
# inspect a plugin
170+
powersync plugins:inspect @example/powersync-plugin-foo
171+
```
172+
151173
# Usage
152174

153175
<!-- usage -->

0 commit comments

Comments
 (0)