codex-imagegen

Installation
SKILL.md

codex-imagegen

Generate and edit bitmap images from Claude Code by driving Codex's built-in image_gen tool through a one-shot codex exec run.

Why this works (the mechanism)

Codex ships a $imagegen skill with two modes:

  1. Built-in image_gen tool (this skill uses it) — runs against Codex's own backend using the user's ChatGPT/Codex login (~/.codex/auth.json). No OPENAI_API_KEY required, no per-image API billing. It's the default Codex mode.
  2. CLI fallback (scripts/image_gen.py) — hits the OpenAI Image API directly, needs OPENAI_API_KEY. This skill does not use it.

The built-in tool is internal to Codex's agent runtime — there is no codex image subcommand. But a headless codex exec "<prompt>" run can invoke it. The wrapper script builds a tightly-scoped prompt that forces Codex to use only the built-in tool, runs codex exec, then locates the PNG Codex just wrote under $CODEX_HOME/generated_images/ and copies it into the working directory with a clean filename.

Source it wraps: ~/.codex/skills/.system/imagegen/ (Codex's installed skill).

Prerequisites

  • codex CLI on PATH and logged in (codex login). Verify: codex login status or just run a generation — the wrapper reports a clear error if Codex isn't authed.
  • No API key needed. The wrapper explicitly tells Codex not to use the API/CLI fallback.
Installs
7
Repository
giulioco/skills
GitHub Stars
9
First Seen
May 30, 2026
codex-imagegen — giulioco/skills