@kuzat/pi-extension-gpt-image-2

Pi extension that adds a gpt_image_2_generate tool

Package details

extension

Install @kuzat/pi-extension-gpt-image-2 from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@kuzat/pi-extension-gpt-image-2
Package
@kuzat/pi-extension-gpt-image-2
Version
0.1.0
Published
Apr 24, 2026
Downloads
61/mo · 61/wk
Author
kuzat
License
MIT
Types
extension
Size
10.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions"
  ]
}

Security note

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

README

pi-extension-gpt-image-2

Pi extension that adds a gpt_image_2_generate tool for generating images with OpenAI GPT Image 2.

What it does

  • Registers a Pi tool: gpt_image_2_generate
  • Calls OpenAI Images API (gpt-image-2)
  • Saves generated files locally
  • Optionally opens the first generated image after creation (open on macOS, xdg-open on Linux, start on Windows)
  • Instructs the agent to ask a follow-up question about opening the image if the user did not explicitly request it

Files

  • extensions/gpt-image-2.ts — extension source

Requirements

  • Pi
  • OPENAI_API_KEY available in the environment of the pi process

Install from npm (recommended)

pi install npm:@kuzat/pi-extension-gpt-image-2

Then reload Pi:

/reload

Install (local dev)

Option A: Copy into your Pi extensions directory:

cp extensions/gpt-image-2.ts ~/.pi/agent/extensions/gpt-image-2.ts

Option B: Symlink for easier updates:

ln -sf "$(pwd)/extensions/gpt-image-2.ts" ~/.pi/agent/extensions/gpt-image-2.ts

Usage

Ask Pi to generate an image, e.g.:

Generate a cinematic image of a moody Norwegian fjord at dawn.

If you explicitly ask to open/view the image, Pi should call the tool with openAfterGenerate=true.

Security

Do not paste API keys in chat or commit them to git. Prefer exporting keys in your shell environment or using a local env manager.

Publish

npm login
npm publish

After publishing, users can install with:

pi install npm:@kuzat/pi-extension-gpt-image-2

License

MIT