@smoose/pi-codex-image-gen
Pi image generation tool backed by the local Codex CLI.
Package details
Install @smoose/pi-codex-image-gen from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@smoose/pi-codex-image-gen- Package
@smoose/pi-codex-image-gen- Version
0.1.2- Published
- Jun 11, 2026
- Downloads
- not available
- Author
- smoose
- License
- MIT
- Types
- extension
- Size
- 21.5 KB
- Dependencies
- 0 dependencies · 2 peers
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-codex-image-gen
Pi extension that registers codex_generate_image and delegates image generation to the local Codex CLI.
It runs codex exec with a JSON output schema, asks Codex to generate one image with its built-in $imagegen flow, reads the returned image path, validates the file, and returns the image inline to Pi.
Installation
pi install npm:@smoose/pi-codex-image-gen
In Pi:
Generate a pixel-art sword icon with a blue blade and gold hilt
Requirements
codexmust be onPATH.codex loginmust already be completed.- Codex must have access to its built-in image generation capability.
Timeout
codex exec is capped at 15 minutes by default so Pi does not stay in working forever. Override it with PI_CODEX_IMAGE_GEN_TIMEOUT_MS if needed; values below 5000 are clamped to 5 seconds.
Failure behavior
When Codex image generation fails, the tool returns the failure reason and terminates the turn. It does not ask Pi to try Python, SVG, Image API scripts, or other fallback generators.
Tool parameters
prompt: image prompt.images: optional local image paths passed tocodex exec --image.