@maheidem/pi-auto-image-attach

extension

Pi extension: auto-attaches pasted/dragged image file paths as ImageContent blocks so the model actually sees the image.

by — · v0.1.1 · published 2w ago

$ pi install npm:@maheidem/pi-auto-image-attach
downloads/mo
0
stars
—
last push
—
open issues
—

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

No downloads in the last 12 weeks.

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-attach

Or 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 input supporting images (see model-discovery's vision override for local oMLX models).