@burneikis/pi-copy-code
v1.0.0
Published
Pi coding-agent extension that copies fenced code blocks from recent assistant (and tool result) messages into the system clipboard.
Downloads
65
Readme
copy-code
Pi coding-agent extension that copies fenced code blocks from recent assistant (and tool result) messages into the system clipboard.
Triggers
- Shortcut:
ctrl+shift+y-> picker over recent code blocks - Command:
/cc-> picker - Command:
/cc last-> copy the most recent block - Command:
/cc 2-> copy the 2nd-most-recent block (1-based) - Command:
/cc all-> concatenate all blocks from the latest assistant message
The command is named /cc because /copy conflicts with a pi built-in
interactive command.
Install
# global (writes ~/.pi/agent/settings.json)
pi install https://github.com/burneikis/pi-copy-code
# or project-local (writes .pi/settings.json)
pi install -l https://github.com/burneikis/pi-copy-codeTry it for a single run without installing:
pi -e https://github.com/burneikis/pi-copy-codeAfter installing, /reload inside pi (or restart it).
Remove with:
pi remove https://github.com/burneikis/pi-copy-codeClipboard backends
Auto-detected at session start. First match wins:
- macOS:
pbcopy - Linux Wayland:
wl-copy(preferred whenWAYLAND_DISPLAYis set) - Linux X11:
xclip, thenxsel - Windows / WSL:
clip.exe
If none are found you'll see a one-time error notification when you trigger a copy.
Notes
- Scans both assistant text content and tool-result text content (newest first).
- Thinking content is ignored.
- Picker shows up to 30 most recent blocks with
lang, line count, and a one-line preview.
