Skip to content

Conversation

@R44VC0RP
Copy link
Collaborator

@R44VC0RP R44VC0RP commented Jan 20, 2026

Summary

This essentially allows you to be able to have a default server set for the TUI so that you don't manually have to run opencode attach <server> every single time.

It also adds an additional option in the /status that allows you to see what server you are currently attached too.

This is what it looks like when it is connected to its own spawned server:
image

And this is what it looks like when it is connected to a server in the attach json:

image
  • Adds tui.attach config option to automatically connect TUI to an existing OpenCode server
  • Adds --attach <url> CLI flag for ad-hoc server attachment
  • Shows "Attached to {url}" in status dialog when connected to external server
  • Falls back to spawning a new worker if the configured server is unavailable

Usage

Via config (opencode.json):

{
  "tui": {
    "attach": "http://opencode.local"
  }
}

Via CLI flag:

opencode --attach http://localhost:4096

Testing

Tested locally by running a server on opencode.local and verifying the TUI attaches without spawning a new worker.

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on the search results, I found one potentially related PR:

Related PR:

No true duplicate PRs were found. PR #9683 appears to be the first implementation of the tui.attach config option and --attach CLI flag for connecting to existing servers.

@R44VC0RP R44VC0RP requested a review from thdxr January 20, 2026 20:17
@R44VC0RP R44VC0RP added tui and removed needs:issue labels Jan 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant