You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ocm-cli): add session move with local history export and TUI plugin (#304)
* loop: ocm-session-move completed after 7 iterations
* feat(ocm-cli): add session move with local history export and TUI plugin
* docs(ocm-cli): update plugin config to tui-only entry and clarify session history source
* fix(ocm-cli): replace raw postinstall output with TUI toast notification
Copy file name to clipboardExpand all lines: docs/ocm-cli.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,29 +29,25 @@ The CLI is published as `@opencode-manager/ocm-cli`. There are two install paths
29
29
30
30
### Option A — install via OpenCode's plugin loader (recommended)
31
31
32
-
Add the package to your OpenCode config and OpenCode will fetch it on next start. The package's plugin entry self-installs a `~/.local/bin/ocm` symlink, so the `ocm` binary becomes available on your PATH automatically.
32
+
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.
33
33
34
34
```jsonc
35
35
// ~/.config/opencode/opencode.json
36
36
{
37
37
"$schema":"https://opencode.ai/config.json",
38
-
"plugin": ["@opencode-manager/ocm-cli"]
38
+
"plugin": ["@opencode-manager/ocm-cli/tui"]
39
39
}
40
40
```
41
41
42
-
The next time OpenCode starts it will run `bun install` for the plugin and import it once. You'll see:
42
+
The next time OpenCode starts it will run `bun install` for the plugin. The installer stays quiet so it does not break the TUI layout; after the plugin loads, OpenCode shows a one-time toast confirming where `ocm` was linked.
43
43
44
-
```
45
-
ocm-cli: installed `ocm` at /Users/you/.local/bin/ocm
46
-
```
47
-
48
-
If `~/.local/bin` is not on your PATH, the message will tell you. Add this to your shell rc:
44
+
If `~/.local/bin` is not on your PATH, add this to your shell rc:
49
45
50
46
```bash
51
47
export PATH="$HOME/.local/bin:$PATH"
52
48
```
53
49
54
-
The plugin itself is a no-op — it does not register tools, commands, or hooks. Its only side effect is the bin symlink, so all real work happens through the `ocm` CLI.
50
+
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).
55
51
56
52
### Option B — global package manager install
57
53
@@ -129,6 +125,10 @@ The child takes over the terminal (`stdio: inherit`); closing the TUI exits `ocm
129
125
130
126
`ocm pull` uses a fast git bundle + working-tree patch by default to sync the matching Manager repo over `$PWD`. Pass `--full` to use the legacy tarball mirror. If the fast path fails, `ocm` prompts before reverting to the tarball mirror (and proceeds automatically when there is no TTY to prompt).
131
127
128
+
### TUI `/ocm-move`
129
+
130
+
When the TUI plugin entry is installed, `/ocm-move` is available in local OpenCode sessions. It checks that the matching Manager repo has not diverged, pushes the local git state with the fast bundle + working-tree patch path, reads the active session history from the local OpenCode SQLite event database, rewrites local repo directories to the Manager repo directory, and replays the session through `/api/opencode-proxy/sync/replay`. The local session is retained.
131
+
132
132
-`--force` skips the dirty-working-tree check on `pull` and the safety bail on `push`.
133
133
-`--create` (on `push`) creates a new Manager repo when no `origin` match is found.
134
134
-`--yes` skips the interactive create confirmation.
0 commit comments