pi-anycopy
v0.2.0
Published
Pi's /tree with a live syntax-highlighted preview and ability to copy any node(s) to the clipboard
Maintainers
Readme
anycopy for Pi (pi-anycopy)
This extension mirrors all the behaviors of Pi's native /tree while adding a live, syntax-highlighting preview of each node's content and the ability to copy any node(s) to the clipboard.
Install
From npm:
pi install npm:pi-anycopyFrom the dot314 git bundle (filtered install):
Add to ~/.pi/agent/settings.json (or replace an existing unfiltered git:github.com/w-winter/dot314 entry):
{
"packages": [
{
"source": "git:github.com/w-winter/dot314",
"extensions": ["extensions/anycopy/index.ts"],
"skills": [],
"themes": [],
"prompts": []
}
]
}Restart Pi after installation.
Usage
/anycopyKeys
Defaults (customizable in config.json):
| Key | Action |
|-----|--------|
| Enter | Navigate to the focused node (same semantics as /tree) |
| Space | Select/unselect focused node for copy |
| Shift+C | Copy selected nodes, or the focused node if nothing is selected |
| Shift+X | Clear selection |
| Shift+L | Label node (native tree behavior) |
| Shift+Up / Shift+Down | Scroll node preview by line |
| Shift+Left / Shift+Right | Page through node preview |
| Esc | Close |
Notes:
Enteralways navigates the focused node, not the marked set- After
Enter,/anycopyoffers the same summary choices as/tree:No summary,Summarize, andSummarize with custom prompt - If
branchSummary.skipPromptistruein Pi settings,/anycopymatches native/treeand skips the summary chooser, defaulting to no summary - Escaping the summary chooser reopens
/anycopywith focus restored to the node you tried to select - Cancelling the custom summarization editor returns to the summary chooser
- If no nodes are selected,
Shift+Ccopies the focused node - Single-node copies use just that node's content; role prefixes like
user:orassistant:are only added when copying 2 or more nodes - When copying multiple selected nodes, they are auto-sorted chronologically by position in the session tree, not by selection order
- Space/
Shift+Cmulti-select copy behavior is unchanged by navigation support - Label edits are persisted via
pi.setLabel(...)
Configuration
Edit ~/.pi/agent/extensions/anycopy/config.json:
treeFilterMode: initial tree filter mode when opening/anycopy; defaults todefaultto match/tree- one of:
default|no-tools|user-only|labeled-only|all
- one of:
keys: keybindings used inside the/anycopyoverlay for copy/preview actions
{
"treeFilterMode": "default",
"keys": {
"toggleSelect": "space",
"copy": "shift+c",
"clear": "shift+x",
"scrollUp": "shift+up",
"scrollDown": "shift+down",
"pageUp": "shift+left",
"pageDown": "shift+right"
}
}