Summary
Add a one-click button in the open session UI (Planning, Build, and Review views) that generates the correct terminal command to reconnect to the same OpenCode session.
Details
Today, users can view an active session in the web UI, but there is no direct action to jump back into that exact session from a terminal. This slows handoff between browser and CLI workflows.
The button should provide copy-ready command text tailored to the current session context (server URL/session ID, and login/attach flow as required), so users can paste once and continue instantly.
Affected Components
| Component |
Path |
Confidence |
| Share message/tool renderer |
packages/web/src/components/share/part.tsx |
High |
| Terminal command renderer for Bash blocks |
packages/web/src/components/share/content-bash.tsx |
High |
| Reusable clipboard action |
packages/web/src/components/share/copy-button.tsx |
High |
| Shared session page data wiring |
packages/web/src/components/Share.tsx |
Medium |
| Session page route |
packages/web/src/pages/s/[id].astro |
Medium |
Likely Implementation Area
Based on codebase analysis:
- Primary location:
packages/web/src/components/share/part.tsx:617 currently renders Bash tool output via ContentBash, which is a natural place to expose a dedicated “copy login command” action.
- Command presentation:
packages/web/src/components/share/content-bash.tsx:15 and packages/web/src/components/share/content-bash.tsx:51 already separate command and output rendering.
- Copy interaction pattern:
packages/web/src/components/share/copy-button.tsx:10 provides a reusable clipboard UX pattern.
- Session context source:
packages/web/src/components/Share.tsx:109 and packages/web/src/components/Share.tsx:510 show where session/share identifiers and message metadata are wired.
Suggested Approach
- Add a context-aware action button in Planning/Build/Review session views that computes the exact reconnect command.
- Reuse existing copy-button behaviour for consistency.
- Prefer explicit, paste-ready terminal commands (for example
opencode attach ... and/or opencode --session ...) based on what data is available in the active view.
- If required fields are missing, show a clear disabled state with tooltip guidance.
Acceptance Criteria
Effort Estimate
Complexity: Medium
Estimated time: 4-8 hours
Risk level: Medium - requires accurate session context mapping and consistent behaviour across three views.
Reference
Summary
Add a one-click button in the open session UI (Planning, Build, and Review views) that generates the correct terminal command to reconnect to the same OpenCode session.
Details
Today, users can view an active session in the web UI, but there is no direct action to jump back into that exact session from a terminal. This slows handoff between browser and CLI workflows.
The button should provide copy-ready command text tailored to the current session context (server URL/session ID, and login/attach flow as required), so users can paste once and continue instantly.
Affected Components
packages/web/src/components/share/part.tsxpackages/web/src/components/share/content-bash.tsxpackages/web/src/components/share/copy-button.tsxpackages/web/src/components/Share.tsxpackages/web/src/pages/s/[id].astroLikely Implementation Area
Based on codebase analysis:
packages/web/src/components/share/part.tsx:617currently renders Bash tool output viaContentBash, which is a natural place to expose a dedicated “copy login command” action.packages/web/src/components/share/content-bash.tsx:15andpackages/web/src/components/share/content-bash.tsx:51already separate command and output rendering.packages/web/src/components/share/copy-button.tsx:10provides a reusable clipboard UX pattern.packages/web/src/components/Share.tsx:109andpackages/web/src/components/Share.tsx:510show where session/share identifiers and message metadata are wired.Suggested Approach
opencode attach ...and/oropencode --session ...) based on what data is available in the active view.Acceptance Criteria
Effort Estimate
Complexity: Medium
Estimated time: 4-8 hours
Risk level: Medium - requires accurate session context mapping and consistent behaviour across three views.
Reference