omp packages

pi-img-visualizer0.1.0

Hover an image path or [Image#N] chip in the pi transcript to see an inline popup preview

omnhh Published 6 days ago MIT ~0 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-img-visualizer

Hover an image path or an [Image#N] chip in the pi transcript and a popup shows the image, inline, next to the pointer.

  • Paths are resolved against the session's working directory (~, file://, path:line and a//b/ diff prefixes are understood). Only existing png, jpg, jpeg, gif and webp files up to 8 MB are previewed.
  • The hovered path or chip is underlined; the popup follows the pointer, flips near screen edges, and closes on click, scroll, key press or when the pointer leaves.
  • [Image#N] chips (pasted images) are rebuilt from the session itself, so they also work in resumed chats.

Popup preview of a pasted image

Install

pi install npm:pi-img-visualizer

Try it for one run without installing: pi -e npm:pi-img-visualizer.

Requirements

  • Fullscreen TUI mode ("tuiMode": "fullscreen" in pi settings): pi only reports pointer motion there.
  • A terminal with an inline image protocol (kitty or iTerm2 compatible). Elsewhere the popup shows pi's text fallback.

Usage

Just hover. /image-preview toggles the feature on and off for the current run.

Pasted images ([Image#N])

Chips resolve from images stored in the session. If you run Gentle Shell, the extension also reads its opt-in disk cache (GENTLE_PI_IMAGES_DISK_CACHE=session). An [Image#N] chip underlined on hover

Images rebuilt from the session are written to $XDG_CACHE_HOME/pi-img-visualizer/restored/<session> (default ~/.cache) with private permissions and removed on shutdown.

Development

npm install
npm test           # node:test, Node >= 22.18
npm run typecheck
pi -e ./extensions/index.ts

License

MIT