opencode
opencode copied to clipboard
[FEATURE]: Better support remote/server-client use-cases from the CLI
Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
To support more advanced remote/server-client use-cases, as well as integrating it into CI containers and/or adding a control surface on top, a couple of key features are missing:
- Allow specifying
--promptin all remaining commands (attach, acp, serve and web (where a new session/chat is automatically started and the link to that specific session is printed / opened)). This allows having a control plane or system integration (think GitLab bot) and starting a session with a relevant prompt for the user. - Allow attaching with
--attachto an existing OpenCode server from other commands (acp, serve and web (where a proxy is opened to the existing server)). This allows for having a distributed architecture, like running the actual server inside of a container, but then proxying it for the user in a control plane with the correct CORS, etc. options. (optionally combined with--promptto start a session). - Allow attaching to session URLs in most commands (attach, server and web) to continue with an existing session instead of just starting the server.
- Optionally allow attaching to an existing session in ACP (currently not easy). Would make it fully consistent and allow attaching to an existing remote session for ACP.