diff --git a/docs/ocm-cli.md b/docs/ocm-cli.md index 8e576cfe..e254ca01 100644 --- a/docs/ocm-cli.md +++ b/docs/ocm-cli.md @@ -29,13 +29,13 @@ The CLI is published as `@opencode-manager/ocm-cli`. There are two install paths ### Option A — install via OpenCode's plugin loader (recommended) -Add the TUI plugin entry to your OpenCode config and OpenCode will fetch the package on next start. The package `postinstall` script self-installs a `~/.local/bin/ocm` symlink for local plugin installs, so the `ocm` binary becomes available on your PATH automatically. +Add the package to your OpenCode TUI config and OpenCode will fetch it on next start. The package exposes a `./tui` entrypoint, and OpenCode resolves that entrypoint automatically from the package name. The package `postinstall` script self-installs a `~/.local/bin/ocm` symlink for local plugin installs, so the `ocm` binary becomes available on your PATH automatically. ```jsonc -// ~/.config/opencode/opencode.json +// ~/.config/opencode/tui.json { - "$schema": "https://opencode.ai/config.json", - "plugin": ["@opencode-manager/ocm-cli/tui"] + "$schema": "https://opencode.ai/tui.json", + "plugin": ["@opencode-manager/ocm-cli"] } ``` @@ -47,7 +47,7 @@ If `~/.local/bin` is not on your PATH, add this to your shell rc: export PATH="$HOME/.local/bin:$PATH" ``` -The `./tui` entry registers `/ocm-move`, a TUI command that keeps the local session and copies the active session to the Manager after pushing the current repo state. Run it from inside a local OpenCode session after `ocm login` and after the repo exists on the Manager (`ocm push --create` if needed). +The `@opencode-manager/ocm-cli` package entry registers `/ocm-move`, a TUI command that keeps the local session and copies the active session to the Manager after pushing the current repo state. Run it from inside a local OpenCode session after `ocm login` and after the repo exists on the Manager (`ocm push --create` if needed). ### Option B — global package manager install diff --git a/ocm-cli/README.md b/ocm-cli/README.md index 6f0e7fa0..c654f0d0 100644 --- a/ocm-cli/README.md +++ b/ocm-cli/README.md @@ -63,18 +63,19 @@ refuses to overwrite uncommitted local changes unless `--force` is passed. ## OpenCode TUI plugin -The package exposes an OpenCode TUI plugin at -`@opencode-manager/ocm-cli/tui`. It registers `/ocm-move`, which keeps the -local session and copies the active session to the Manager after pushing the -current repo state. Use it from inside an OpenCode session after `ocm login` -and after the repo already exists on the Manager (`ocm push --create` if -needed). +The package exposes an OpenCode TUI plugin through its `./tui` package export. +Configure the package name and OpenCode resolves that TUI entrypoint +automatically. It registers `/ocm-move`, which keeps the local session and +copies the active session to the Manager after pushing the current repo state. +Use it from inside an OpenCode session after `ocm login` and after the repo +already exists on the Manager (`ocm push --create` if needed). Enable it in `tui.json`: ```jsonc { - "plugin": ["@opencode-manager/ocm-cli/tui"] + "$schema": "https://opencode.ai/tui.json", + "plugin": ["@opencode-manager/ocm-cli"] } ``` diff --git a/ocm-cli/package.json b/ocm-cli/package.json index bbd4d5bf..fb0803ae 100644 --- a/ocm-cli/package.json +++ b/ocm-cli/package.json @@ -22,7 +22,8 @@ }, "files": [ "dist", - "README.md" + "README.md", + "scripts/postinstall.mjs" ], "scripts": { "build": "bun scripts/build.ts",