feat: /copy slash command — copy session transcript to clipboard #296

Closed
opened 2026-07-12 01:32:19 +02:00 by dries · 0 comments
Owner

Part of OpenCode command parity (transparent-layer goal). OpenCode's TUI has /copy (title "Copy session transcript") which formats the whole session and writes it to the clipboard, honouring the current thinking/tool-detail/metadata display toggles.

Scope

  • Add copy to BUILTIN_COMMANDS (frontend/src/lib/commands/builtinCommands.ts).
  • Serialize the session's messages/parts to Markdown (share the same serializer as #291 /export) and write to clipboard via the Clipboard API, with a success/error toast.
  • Respect the /thinking (#290) and /details (#288) display toggles when they land — copy what's shown.

Reference

Sibling of #291 (/export): same transcript formatter, different sink (clipboard vs download).

Notes

Browser Clipboard API needs a secure context (localhost is treated as secure). Fall back to a select-and-copy or toast-with-error if write() is unavailable.

Part of OpenCode command parity (transparent-layer goal). OpenCode's TUI has `/copy` (title "Copy session transcript") which formats the whole session and writes it to the clipboard, honouring the current thinking/tool-detail/metadata display toggles. ## Scope - Add `copy` to `BUILTIN_COMMANDS` (frontend/src/lib/commands/builtinCommands.ts). - Serialize the session's messages/parts to Markdown (share the same serializer as #291 /export) and write to clipboard via the Clipboard API, with a success/error toast. - Respect the /thinking (#290) and /details (#288) display toggles when they land — copy what's shown. ## Reference Sibling of #291 (/export): same transcript formatter, different sink (clipboard vs download). ## Notes Browser Clipboard API needs a secure context (localhost is treated as secure). Fall back to a select-and-copy or toast-with-error if write() is unavailable.
dries closed this issue 2026-07-12 10:10:43 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dries/ocman#296
No description provided.