pi-copy-message

Pi extension with a searchable TUI picker for copying raw session messages

Packages

Package details

extension

Install pi-copy-message from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-copy-message
Package
pi-copy-message
Version
4.0.12
Published
Nov 4, 2026
Downloads
2,221/mo · 1,796/wk
Author
fitchmultz
License
MIT
Types
extension
Size
66.4 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-copy-message

Copy message text from a Pi session with a searchable picker. The copied text keeps the original code, spaces, and line breaks.

Flow from the /copy-message command through message search and selection to the clipboard.

Install and start

This extension requires Pi and Node.js. See the development guide for version requirements.

Run this command:

pi install npm:pi-copy-message

Start Pi. Run /reload if Pi is already open.

Enter this command in Pi:

/copy-message

Type words to search roles and message text. Use ↑ or ↓ to select a message. Press Enter to copy the message.

Use the picker

Messages appear from oldest to newest. The picker selects the newest visible message first.

User, assistant, and visible custom messages appear by default. Tool and bash messages stay hidden.

Key Action
Ctrl+T Show or hide tool and bash messages
Ctrl+U / Ctrl+A / Alt+C Show or hide user, assistant, or custom messages
Tab Preview the selected message
Alt+M Switch between raw text and text with role/time metadata
Esc / Ctrl+C Cancel

The picker uses your Pi selection bindings. Its key hints show those bindings.

Direct copies

Command What it copies
/copy-user Your most recent message with text
/copy-message latest The latest default-visible message in Pi's active context
/copy-message 3 The third default-visible message, counted oldest to newest
/copy-message latest --with-meta The latest message with its role and local time, when available

latest follows Pi's active context, including context edits, omissions, and compaction. The picker, numbered copies, and /copy-user use stored messages on the current branch, including history before compaction.

Limits and clipboard

The picker requires interactive TUI mode. Direct commands also work outside TUI mode, where Pi may hide notifications.

The extension uses Pi's clipboard support and OSC 52 fallback. It reports “Copied” only after local clipboard readback matches the copied text.

On Termux, unavailable readback produces "Sent … to terminal clipboard; paste to verify." Termux Fold can receive clipboard writes without the optional Termux:API app needed for readback. Keep Termux visible and use its Paste action to check delivery.

Empty or mismatched readback still produces a warning. Unavailable readback on other platforms also warns. A failed write produces an error.

The extension cannot verify remote terminal delivery. Paste into a local editor to check delivery.

Restart Pi after you change dependencies or the Pi runtime.

Docs and support

The reference lists all controls, command aliases, and clipboard details. The development guide covers tests and releases.

Changelog · Report an issue

License

MIT · Mitch Fultz