feat: /move slash command — move session to another project directory #298

Closed
opened 2026-07-12 01:32:34 +02:00 by dries · 0 comments
Owner

Part of OpenCode command parity (transparent-layer goal). OpenCode's TUI has /move (title "Move session", desc "Move to another project dir", DialogMoveSession) which relocates a session to a different project directory.

Approach: proxy the OpenCode SDK — do NOT reimplement

DialogMoveSession drives it via the SDK (project.directories + project-copy refresh + a move/update call). Proxy through the OpenCode adapter and route via sessionsvc.

Scope

  • Adapter + sessionsvc mutation for moving a session's working/project directory.
  • Add move to BUILTIN_COMMANDS (frontend/src/lib/commands/builtinCommands.ts).
  • UI: a directory picker (existing project dirs) + option to target a new dir, mirroring DialogMoveSession.
  • Requires a live OpenCode instance; gate/message when not running.

Caveats to resolve in the ticket

  • Interaction with ocman's projects index (internal/server projects refresh) and per-session working directory (the /wt single-instance model). Moving a session changes which project row it belongs to — confirm the projects view + session list update correctly after a move.
  • Multi-remote (spec/multi-remote-support): moving across hosts is out of scope; restrict to same-host dirs unless explicitly designed otherwise.
Part of OpenCode command parity (transparent-layer goal). OpenCode's TUI has `/move` (title "Move session", desc "Move to another project dir", DialogMoveSession) which relocates a session to a different project directory. ## Approach: proxy the OpenCode SDK — do NOT reimplement DialogMoveSession drives it via the SDK (project.directories + project-copy refresh + a move/update call). Proxy through the OpenCode adapter and route via sessionsvc. ## Scope - Adapter + sessionsvc mutation for moving a session's working/project directory. - Add `move` to `BUILTIN_COMMANDS` (frontend/src/lib/commands/builtinCommands.ts). - UI: a directory picker (existing project dirs) + option to target a new dir, mirroring DialogMoveSession. - Requires a **live** OpenCode instance; gate/message when not running. ## Caveats to resolve in the ticket - Interaction with ocman's projects index (internal/server projects refresh) and per-session working directory (the /wt single-instance model). Moving a session changes which project row it belongs to — confirm the projects view + session list update correctly after a move. - Multi-remote (spec/multi-remote-support): moving across hosts is out of scope; restrict to same-host dirs unless explicitly designed otherwise.
dries closed this issue 2026-07-13 13:05:41 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dries/ocman#298
No description provided.