@maheidem/pi-auto-image-attach
v0.1.1
Published
Pi extension: auto-attaches pasted/dragged image file paths as ImageContent blocks so the model actually sees the image.
Downloads
262
Maintainers
Readme
@maheidem/pi-auto-image-attach
A Pi extension that auto-attaches pasted image file paths as real image content.
Why
Dragging an image into the Pi TUI inserts an escaped file-path string (upstream
gap: earendil-works/pi#6572). The model then only sees a path, not the image.
This extension intercepts input, detects image paths (png/jpg/jpeg/webp/gif/bmp,
absolute or relative, with backslash-escaped spaces), sniffs the magic bytes for
the MIME type, base64-encodes the file, attaches it as ImageContent, and strips
the raw path from the message text.
Only fires for interactive input with no already-attached images; silently
passes through otherwise.
Install
pi install npm:@maheidem/pi-auto-image-attachOr add the path to ~/.pi/agent/settings.json → packages, then /reload.
Caveats
- Relative paths resolve against pi's CWD.
- Vision still depends on the active model's
inputsupporting images (see model-discovery's vision override for local oMLX models).
