← Catalog

@joaovittordevv/pi-code-copy

Visual code blocks with click-to-copy for Pi

Extension

Install

Install with PiG

pig install npm:@joaovittordevv/pi-code-copy

Install with Pi

pi install npm:@joaovittordevv/pi-code-copy
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.0 (README.md). PiG does not review it.

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 ⧉ copy in the footer of each box.
  • In Pi fullscreen mode, clicking anywhere in a code box copies that entire block.
  • Keeps /copy-code as 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: false restores Pi's normal fenced-code rendering and disables click handling.
  • clickToCopy: false keeps 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.