feature: CLI session interaction #224

Closed
opened 2026-02-16 17:25:51 -05:00 by yindo · 1 comment
Owner

Originally created by @ArykLAnderson on GitHub (Jun 22, 2025).

Originally assigned to: @thdxr on GitHub.

I think a lot of the bones are there for this with some commands in alternate locations, but it would be great to be able to interact with sessions via cli args similar to tmux. Namely an ability to list, create, attach, share, retract and delete sessions with something like:

opencode session list
- uuid | session name | last session message
- uuid | session name | last session message
...
opencode session new <name> -p <path>
opencode session attach <name|uuid>
opencode session delete <name|uuid>
opencode session publish <name|uuid> #share command but from the CLI
opencode session retract <name|uuid> #unshare

Additionally, it would be great to be able to be able to pass new messages and retrieve messages from active sessions like

opencode session message send <name|uuid> '<message>'
# receives the last 5 messages from the session and includes the model planning output messages
opencode session message receive -p <name|uuid> -n 5 

I think that these kinds of CLI commands would help make the tool more flexible for developing CI and other headless interactions like spawning sub-agents, as well as supporting other custom workflows like external session pickers, coordinating persistent opencode sessions with tmux sessions, easy to use hooks for nvim plugins, etc

Originally created by @ArykLAnderson on GitHub (Jun 22, 2025). Originally assigned to: @thdxr on GitHub. I think a lot of the bones are there for this with some commands in alternate locations, but it would be great to be able to interact with sessions via cli args similar to tmux. Namely an ability to list, create, attach, share, retract and delete sessions with something like: ``` opencode session list - uuid | session name | last session message - uuid | session name | last session message ... ``` ``` opencode session new <name> -p <path> opencode session attach <name|uuid> opencode session delete <name|uuid> opencode session publish <name|uuid> #share command but from the CLI opencode session retract <name|uuid> #unshare ``` Additionally, it would be great to be able to be able to pass new messages and retrieve messages from active sessions like ``` opencode session message send <name|uuid> '<message>' # receives the last 5 messages from the session and includes the model planning output messages opencode session message receive -p <name|uuid> -n 5 ``` I think that these kinds of CLI commands would help make the tool more flexible for developing CI and other headless interactions like spawning sub-agents, as well as supporting other custom workflows like external session pickers, coordinating persistent opencode sessions with tmux sessions, easy to use hooks for nvim plugins, etc
yindo closed this issue 2026-02-16 17:25:51 -05:00
Author
Owner

@rekram1-node commented on GitHub (Dec 27, 2025):

[automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!

@rekram1-node commented on GitHub (Dec 27, 2025): [automated] Closing due to 90+ days of inactivity. Feel free to reopen if you still need this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#224