@burneikis/pi-copy-code
Pi coding-agent extension that copies fenced code blocks from recent assistant (and tool result) messages into the system clipboard.
Package details
Install @burneikis/pi-copy-code from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@burneikis/pi-copy-code- Package
@burneikis/pi-copy-code- Version
1.0.0- Published
- May 14, 2026
- Downloads
- not available
- Author
- burneikis
- License
- MIT
- Types
- extension
- Size
- 11 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
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-code
Try it for a single run without installing:
pi -e https://github.com/burneikis/pi-copy-code
After installing, /reload inside pi (or restart it).
Remove with:
pi remove https://github.com/burneikis/pi-copy-code
Clipboard 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.