@joaovittordevv/pi-code-copy0.1.0
Visual code blocks with click-to-copy for Pi
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-code-copy
Visual fenced code blocks with click-to-copy for Pi.
Maintained by JoaoVittorDevv.
- Replaces completed assistant fenced blocks with a bordered code box.
- Shows
⧉ copyin the footer of each box. - In Pi fullscreen mode, clicking anywhere in a code box copies that entire block.
- Keeps
/copy-codeas a keyboard fallback that works independently of mouse support.
Install
# Personal install, pinned release
pi install npm:@joaovittordevv/pi-code-copy@0.1.0
# Project-local install
pi install --local npm:@joaovittordevv/pi-code-copy@0.1.0
For a local checkout before publishing:
pi install /absolute/path/to/code-copy
Pi packages execute code with your user permissions. Install only packages you trust.
Configure
The feature is enabled by default. Use:
/code-copy status
/code-copy off
/code-copy on
/code-copy click off
/code-copy click on
Global settings are stored in ~/.pi/agent/code-copy.json:
{
"enabled": true,
"clickToCopy": true
}
A project can override it in .pi/code-copy.json.
enabled: falserestores Pi's normal fenced-code rendering and disables click handling.clickToCopy: falsekeeps the visual boxes but leaves clicks untouched.
Compatibility
The visual behavior uses guarded runtime patches tested with Pi 1.5.x, following the same integration style used by advanced Pi UI packages. If a future Pi version changes the private UI structure, the /copy-code command remains available as a fallback.
Mouse clicks are a fullscreen enhancement. In regular mode, the terminal owns the mouse and scrollback; use /copy-code or select/copy normally.
Development
npm test
npm run pack:dry-run
npm run publish:dry-run
pi -e ./index.ts
Ask Pi for two fenced code blocks, click each box, and paste into an editor to verify the copied code has no Markdown fences.