@8monkey/pi-media

Pi extension that attaches local media files mentioned with @ to the request.

Packages

Package details

extension

Install @8monkey/pi-media from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@8monkey/pi-media
Package
@8monkey/pi-media
Version
0.1.0
Published
Aug 3, 2026
Downloads
135/mo · 13/wk
Author
heiwen
License
MIT
Types
extension
Size
9.3 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

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

README

pi-media

Attach local images, audio, video and PDFs to your messages with pi's @ mention. @report.pdf reaches the model as a real attachment, instead of a path it has to open with the read tool.

Install

pi install npm:@8monkey/pi-media

Usage

what's wrong with this recording? @debug-session.mp3
compare @"Q3 report.pdf" with @q4-report.pdf

Paths resolve against the session's working directory. Quote paths that contain spaces, which is what pi's @ autocomplete does for you.

The attachment is re-sent on every turn, so you can keep asking about the same file later in the conversation.

Supported files

Kind Extensions
Image png jpg jpeg webp gif heic heif
Audio wav mp3 aac flac ogg aiff aif
Video mp4 mov webm mpeg mpg avi wmv flv 3gp
Document pdf

Providers

Attachments are sent today for models served through the Hebo gateway. On other providers, such as Anthropic direct, Bedrock or the Gemini API, the mention is passed along as text and nothing breaks.

Planned, in rough order: Gemini API and Vertex, Anthropic and Bedrock (images and PDFs only), OpenAI, OpenRouter.

Limits

  • A mention that doesn't point at an existing, non-empty file stays as you typed it.
  • Files over 20 MB are left as plain @path text. Host large media and reference it another way.
  • Errors from the provider, for instance an unsupported media kind or an oversized request, appear in the UI unchanged.

No runtime dependencies, no build step. Runs under Node and Bun.

Development

node --test
npm run typecheck

License

MIT