Repository navigation
feat: add /copy shortcut to copy the current conversation to clipboard - #565
Merged
Merged
Conversation
Implements a built-in /copy chat shortcut that copies the current conversation to the system clipboard, pairing with /compact so a session can be moved to another terminal and continued there (closes #562). - New CGO-free internal/clipboard/text package shells out to the native clipboard utility (pbcopy / wl-copy / xclip / xsel / clip / clip.exe), trying each in priority order and falling through if one is missing. - New CopyShortcut reuses ConversationRepository.Export; default format is plain text, with /copy markdown and /copy json overrides. The clipboard writer is injected via a package-local interface so tests never touch the real clipboard or shell out, and no new domain mock is required. - Registered in the service container; /help and tab-completion pick it up automatically via the shortcut registry. - Documented in the shortcuts guide and README; added utility names to the cspell word list.
edenreich
force-pushed
the
feat/copy-shortcut-562
branch
from
June 1, 2026 09:55
5dca9e5 to
5679174
Compare
edenreich
commented
Jun 1, 2026
edenreich
commented
Jun 1, 2026
Co-authored-by: Eden Reich <[email protected]>
inference-gateway-releaser Bot
pushed a commit
that referenced
this pull request
Jun 1, 2026
## [0.116.0](v0.115.2...v0.116.0) (2026-06-01) ### 🚀 Features * add /copy shortcut to copy the current conversation to clipboard ([#565](#565)) ([bdfe618](bdfe618)) * **stt:** add Whisper speech-to-text for chat /voice and Telegram voice ([2f3828a](2f3828a)), closes [#559](#559) * regenerate config ([ae43e7f](ae43e7f)) ### 👷 CI/CD * centralize claude.yml via reusable workflow ([#557](#557)) ([3d48856](3d48856)) * centralize claude.yml via reusable workflow ([#558](#558)) ([affc7a1](affc7a1)) * centralize claude.yml via reusable workflow ([#563](#563)) ([feaeeb0](feaeeb0)) * centralize infer.yml via reusable workflow ([#564](#564)) ([2b80aed](2b80aed)) * **claude:** standardize workflow + task-based branch prefix ([2d256d0](2d256d0)) ### 🧹 Maintenance * **deps:** add whisper-cpp and ffmpeg to flox env ([2652e99](2652e99))
Contributor
|
🎉 This PR is included in version 0.116.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements a built-in
/copychat shortcut that copies the current conversation to the system clipboard, cross-platform. This pairs with/compactso a session can be moved to another terminal/machine and continued there.Closes #562.
What it does
/copycopies the current conversation to the clipboard (default plain text)./copy markdownand/copy jsonoverride the format (reuses the same export formats as/export).• Copied conversation to clipboard (text, 1234 bytes, 56 lines).How it works
internal/clipboard/textpackage shells out viaos/execto the platform's native clipboard utility, trying each in priority order and falling through if one is missing:pbcopywl-copy(Wayland) →xclip→xsel(X11) →clip.exe(WSL)clipinternal/clipboardpackage is macOS/CGO-only and image-focused, so it is intentionally left untouched.CopyShortcutreusesConversationRepository.Export(format)and is wired into the service container'sregisterDefaultCommands()./helpand tab-completion pick it up automatically via the shortcut registry — no extra wiring.ClipboardWriterinterface, so unit tests never touch the real clipboard or shell out, and no new domain mock (counterfeiter) is needed.Testing
internal/shortcuts/copy_test.go— table-driven: empty conversation, successful default copy (asserts exact bytes + format + byte/line count), format routing (text/txt/markdown/md/json/uppercase), unknown format, export error, clipboard error, metadata/CanExecutearity.internal/clipboard/text/text_test.go— candidate ordering per OS and the "no utility found" path (via aPATH-stub soexec.LookPathfails) — CI/headless safe.pbcopy/pbpasteround-trip locally on macOS (throwaway test, not committed).task build,task test,task lint(golangci-lint0 issues+ markdownlint), andgo vetall pass;go mod tidyis a no-op.Docs
docs/shortcuts-guide.md— added/copyto Core Shortcuts plus a "Copy Shortcut" subsection describing the/compact→/copyworkflow and per-platform utility requirements.README.md— added/copyto the Core built-in shortcuts list.cspell.yaml— addedpbcopy,xclip,xsel.