Skip to content

[FEATURE]: Config option to auto-attach to a remote server #17322

@kldzj

Description

@kldzj

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

Problem

Users running a persistent opencode serve instance must manually use opencode attach <url> instead of opencode. This is easy to forget and disrupts workflow.

Proposed Solution

Add a config option to specify a default attach URL:

{
  "server": {
    "attach": "http://10.0.0.1:4096"
  }
}

Or environment variable:

OPENCODE_ATTACH_URL=http://10.0.0.1:4096

Behavior

If configured and the server is reachable:

  • opencode attaches automatically (equivalent to opencode attach <url>)

If unreachable:

  • Falls back to starting a new embedded server

Current Workaround

Shell wrapper, but this doesn't work in IDE extensions or scripts.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions