codex-imagegenlisted
Install: claude install-skill luminary19/atelier
# /codex-imagegen — image generation via the local Codex CLI (no API key)
Generate or edit raster images by driving the **already-installed, already-logged-in**
OpenAI Codex CLI and triggering its **built-in `image_gen` tool**. This piggybacks on the
user's **ChatGPT Plus/Pro session tokens** that Codex stores in `auth.json` — there is
**no `OPENAI_API_KEY`** and **no manual HTTP / internal-route work**. The image model under
the hood is OpenAI's `gpt-image` (gpt-image-2).
## How this actually works (read once)
- Codex ships two image paths. **(1) the built-in `image_gen` tool** — server-side, runs on
whatever auth Codex has (ChatGPT login *or* key), **needs no key**. **(2) a Python fallback
CLI** (`image_gen.py`) — needs `OPENAI_API_KEY`. **This skill uses path (1) only** and must
steer the agent away from path (2).
- We invoke it through `codex exec "<prompt>"` (non-interactive). The prompt instructs the
Codex agent to call the built-in `image_gen` tool and generate N images.
- **Where files land:** the built-in tool has **no path argument** — it writes to
`$CODEX_HOME\generated_images\<session-id>\ig_*.png`. The agent's own "now copy it to your
folder" step is **unreliable and frequently hallucinated** (it prints `DONE` + a fake path
while the real PNG sits in `generated_images`). So **the helper script does the copy itself**:
it snapshots `generated_images` before the run, finds the new file after, and copies it into
`-OutDir` with a friendly name. Ne