← Catalog

@felixoid/py-yank

Pi agent copy command: enhanced /y (yank/copy) for indexed and rendered assistant message clipboard copy

Extension

Install

Install with PiG

pig install npm:@felixoid/py-yank

Install with Pi

pi install npm:@felixoid/py-yank
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": [
    "./extensions/yank.ts"
  ]
}

README

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

@felixoid/py-yank

Enhanced /y yank (copy) command for pi coding agent.

Why /y

/copy is a built-in interactive command in pi, and command-name overlap with extensions is currently awkward. See the current state and discussion in earendil-works/pi#3601.

This package uses a vim-style /y to avoid that collision while still adding copy-oriented features: indexed message copy, optional markdown rendering (--plain), code-block picker for multi-block responses, and per-session picker reset.

Features

  • /y — same as /y 1 (raw markdown by default)
  • /y 2 — copy 2nd-to-last assistant message as raw markdown
  • /y ? — pick the message from a searchable list (type to filter by prompt or reply text)
  • /y --plain — copy last assistant message as rendered plain text
  • /y 2 --plain — indexed rendered plain-text copy
  • /y --reset — reset the session option that always copies full response

For default/indexed forms, raw markdown is copied unless --plain is passed. If the selected response contains multiple fenced code blocks, /y and /y N show an interactive picker so you can copy either the full response or one code block.

--plain uses pi TUI Markdown renderer (@earendil-works/pi-tui) and strips ANSI, so copied text keeps structure (tables, lists, code blocks) in plain text. The interactive picker is skipped in --plain mode.

Install

pi install npm:@felixoid/py-yank

Or test without installing:

pi -e npm:@felixoid/py-yank

Usage

Inside pi:

/y
/y 2
/y ?
/y --plain
/y 2 --plain

Notes

  • This extension registers its own /y command.
  • Clipboard backend uses pi's built-in copyToClipboard utility.

Development

npm install
npm run typecheck
npm test

Load locally (project mode):

pi install .
# or add this path to .pi/settings.json packages