opencode icon indicating copy to clipboard operation
opencode copied to clipboard

opencode run --attach <server>

Open slhad opened this issue 1 month ago • 4 comments

With the creation of opencode serve and opencode attach for connecting with TUI

It would be awesome to have opencode run attachable to a headless opencode server.

That would be great to reduce a lot the mcp servers cold boot time that happen at every opencode run to only the first query

Thanks to every people working on opencode, seeing a new release always light up my day

slhad avatar Oct 14 '25 23:10 slhad

This issue might be a duplicate of existing issues. Please check:

  • #3166: Add --session flag to attach command - This was already implemented and closed, adding session support to the attach command which is similar to your request for attachable run command
  • #3165: Add --session flag to attach command to continue session via already running headless server - Another duplicate of the same functionality that was implemented

While these issues focused on the attach command with session support, your request for opencode run --attach <server> to reduce MCP server cold boot time appears to be a related but distinct feature request for making the run command work with existing servers rather than starting fresh each time.

Feel free to ignore if none of these address your specific case.

github-actions[bot] avatar Oct 14 '25 23:10 github-actions[bot]

hey thanks!

Adding headless support should be easy here, we have an example for how to do it in another cmd/*.ts file (since opencode can attach)

rekram1-node avatar Oct 15 '25 01:10 rekram1-node

@rekram1-node check #3889

monke-yo avatar Nov 04 '25 14:11 monke-yo

already did :)

rekram1-node avatar Nov 04 '25 15:11 rekram1-node