pi-bash-image

Inject images into bash tool results

Package details

extension

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

$ pi install npm:pi-bash-image
Package
pi-bash-image
Version
0.1.2
Published
Apr 29, 2026
Downloads
24/mo · 8/wk
Author
hewliyang
License
MIT
Types
extension
Size
7 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-bash-image

pi extension that lets bash return images inline.

Normally, seeing an image takes 2 calls:

  1. bash
  2. read

This adds a __PI_IMAGE__ helper so bash can return the image in the same result.

It reuses pi’s public read tool for image handling, so image processing matches pi’s read behavior.

Install

pi install npm:pi-bash-image

Usage

# image in same result
agent-browser screenshot page.png && __PI_IMAGE__ page.png

# text + image together
agent-browser snapshot -i | __PI_IMAGE__ page.png

# multiple images
__PI_IMAGE__ before.png after.png

How it works

  • injects a __PI_IMAGE__ shell helper into bash
  • helper prints markers for image paths
  • extension replaces those markers with the same content blocks pi read would return for that image
  • all other bash behavior stays the same

License

MIT