You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add --session flag to opencode attach command #5445
Add a --session / -s flag to opencode attach to navigate directly to a specific session when attaching to a running server.
Problem
The docs describe opencode serve as enabling "multiple clients" to interact with opencode programmatically. However, there's no clean way to attach a TUI to an existing server and open a specific session.
Currently:
opencode -s <session_id> starts a new server, defeating the purpose of opencode serve
opencode attach <url> connects to an existing server but has no way to specify which session to open
This means opencode serve can't really be used as intended - any TUI interaction requires starting a separate server.
Proposed Solution
// attach.ts.option("session",{alias: ["s"],type: "string",description: "session id to navigate to",})// ...awaittui({url: args.url,args: {sessionID: args.session,},})
Activity
github-actions commentedon Dec 12, 2025
This issue might be a duplicate of existing issues. Please check:
Additionally, this feature request relates to the broader server/attach functionality discussed in:
opencode serverapi #5256: Adding Authentication toopencode serverapi (discusses server API features)Feel free to ignore if none of these address your specific case.
fix: add --session flag to attach command