pi-codex-image
Pi extension that exposes Codex CLI image generation as a codex_image tool.
Package details
Install pi-codex-image from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-codex-image- Package
pi-codex-image- Version
0.1.0- Published
- Apr 21, 2026
- Downloads
- 145/mo · 12/wk
- Author
- tmustier
- License
- MIT
- Types
- extension
- Size
- 17.1 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-codex-image
Pi extension that exposes the local Codex CLI's built-in image generation capability as a Pi tool named codex_image.
What it does
When Pi calls codex_image, the extension:
- checks for
~/.codex/auth.json - creates a temporary
CODEX_HOME - copies your Codex auth into that temp home
- runs
codex execnon-interactively withimage_generationenabled - collects the generated image file(s)
- returns the image(s) back to Pi
- optionally copies the single output image to a requested path
This extension does not call an image API directly. It is a thin bridge from Pi to the local codex CLI.
Requirements
- Pi
- local
codexCLI installed and onPATH - Codex logged in with ChatGPT (
~/.codex/auth.jsonpresent)
Install
From npm
pi install npm:pi-codex-image
From git
pi install git:github.com/tmustier/pi-codex-image
For a one-off test
pi -e npm:pi-codex-image
# or
pi -e git:github.com/tmustier/pi-codex-image
Tool
codex_image
Parameters:
prompt— required text promptinputImages— optional array of local image pathsoutputPath— optional exact file path for the final imageoverwrite— optional boolean for replacingoutputPathmodel— optional Codex model overridetimeoutSec— optional timeout, default180
Example prompts
- "Use
codex_imageto generate a flat illustration of a magenta raccoon logo." - "Use
codex_imagewithinputImagesto restyle this icon as a sticker." - "Generate a hero image and save it with
outputPathto./art/hero.png."
Notes
outputPathonly works when Codex produces exactly one image.- Exact pixel dimensions are best-effort and depend on Codex output.
- The extension runs Codex with a temporary
CODEX_HOMEand removes it afterward.
License
MIT