[FEATURE]: Better support remote/server-client use-cases from the CLI #6479

Open
opened 2026-02-16 18:04:20 -05:00 by yindo · 2 comments
Owner

Originally created by @Killusions on GitHub (Jan 16, 2026).

Originally assigned to: @thdxr on GitHub.

Feature hasn't been suggested before.

  • 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 --prompt in 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 --attach to 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 --prompt to start a session).
  • Allow attaching to session URLs in all commands (attach, acp, server and web) to continue with an existing session instead of just starting the server.
  • Free win: add --session to the acp command since the logic was already there for --attach

Working and tested PR at #7340 , willing to do any adjustments if needed.

Originally created by @Killusions on GitHub (Jan 16, 2026). Originally assigned to: @thdxr on GitHub. ### 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 `--prompt` in 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 `--attach` to 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 `--prompt` to start a session). - Allow attaching to session URLs in all commands (attach, acp, server and web) to continue with an existing session instead of just starting the server. - Free win: add `--session` to the acp command since the logic was already there for `--attach` Working and tested PR at #7340 , willing to do any adjustments if needed.
yindo added the discussion label 2026-02-16 18:04:20 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 16, 2026):

This issue might be a duplicate of or closely related to existing issues. Please check:

  • #7376: add --dir flag to opencode run --attach - related to --attach functionality
  • #6461: [FEATURE]: Named Remote Connections with Session Origin Tracking - overlaps with remote connection tracking
  • #5256: [FEATURE]: Adding Authentication to opencode server api - server authentication feature
  • #7790: [FEATURE]: SSH-based remote server connections to OpenCode Desktop - remote server connections
  • #5608: [FEATURE]: OpenCode-Desktop Remote Workspace - remote workspace support
  • #7629: [Enhancement] Desktop app and terminal should connect to existing server instead of starting a new one - connecting to existing servers
  • #3607: [FEATURE]: opentui: Replace subcommands attach, spawn, thread with flags - related to attach command redesign
  • #8094: Unable to use --agent option when using run with --attach - attach command issues

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

@github-actions[bot] commented on GitHub (Jan 16, 2026): This issue might be a duplicate of or closely related to existing issues. Please check: - #7376: add --dir flag to `opencode run --attach` - related to --attach functionality - #6461: [FEATURE]: Named Remote Connections with Session Origin Tracking - overlaps with remote connection tracking - #5256: [FEATURE]: Adding Authentication to `opencode server` api - server authentication feature - #7790: [FEATURE]: SSH-based remote server connections to OpenCode Desktop - remote server connections - #5608: [FEATURE]: OpenCode-Desktop Remote Workspace - remote workspace support - #7629: [Enhancement] Desktop app and terminal should connect to existing server instead of starting a new one - connecting to existing servers - #3607: [FEATURE]: opentui: Replace subcommands attach, spawn, thread with flags - related to attach command redesign - #8094: Unable to use `--agent` option when using `run` with `--attach` - attach command issues Feel free to ignore if none of these address your specific case.
Author
Owner

@Killusions commented on GitHub (Jan 16, 2026):

I filed a working and tested PR at #7340 , willing to do any adjustments if needed

@Killusions commented on GitHub (Jan 16, 2026): I filed a working and tested PR at #7340 , willing to do any adjustments if needed
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6479