Skip to content

[FEATURE]: Add one-click terminal login command for open session views #13008

@vultuk-bot

Description

@vultuk-bot
  • I have verified this feature I'm about to request hasn't been suggested before.

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

  • A visible button exists in open session Planning, Build, and Review views to copy a terminal reconnect command.
  • Copied command is correct for the current session and environment context.
  • UX feedback confirms successful copy.
  • Fallback/disabled state is shown when a reconnect command cannot be generated.
  • Tests are added/updated for command generation and copy interaction.
  • Documentation is updated if this changes user workflow.

Effort Estimate

Complexity: Medium
Estimated time: 4-8 hours
Risk level: Medium - requires accurate session context mapping and consistent behaviour across three views.

Reference

Metadata

Metadata

Assignees

Labels

webRelates to opencode on web / desktop

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