brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
codex-imageGenerate images using OpenAI's Codex backend API with gpt-image-2 tool. Use when the user asks to generate images via Codex, ChatGPT image generation, or gpt-image-2. Triggers on "codex image", "codex generate", "gpt-image", "chatgpt generate image". Token is auto-fetched from chatgpt.com session — no manual token setup needed.
Independent GitHub snapshot · Automated classification · Original documentation governs
Generate images via chatgpt.com/backend-api/codex/responses using the image_generation tool (gpt-image-2).
--token argument (CLI only)CODEX_IMAGE_TOKEN environment variable--token-file argument (CLI only)~/.chatgpt_auth.json cache (valid for 8 hours)https://chatgpt.com/api/auth/session via minis-browser-use:
chatgpt.com/auth/login in the browser, then polls every 10s in a new tab for up to 5 minutes~/.chatgpt_auth.json (chmod 600, token + timestamp only)python3 scripts/codex_image.py "a cute rabbit on a light background" \
--output rabbit.png \
--model gpt-5.4 \
--effort low
python3 scripts/codex_image_edit.py "turn this person into a cinematic iOS AI assistant portrait" \
--image reference.jpg \
--output portrait.png \
--model gpt-5.4 \
--effort low
codex_image_edit.py encodes the local reference image as a base64 data URL and sends it as multimodal input (input_text + input_image) to the same Codex responses endpoint, then asks the image_generation tool to create a new image from the reference.
| Parameter | Default | Description |
|---|---|---|
prompt | (required) | Image description or edit instruction |
--image | (edit only, required) | Local reference image path for image-to-image generation |
--output | codex_image.png / codex_image_edit.png | Output file path |
--model | gpt-5.4 | Codex model |
--effort | low | Reasoning effort: low/medium/high |
--token | - | Access token directly (skips auto auth; text-to-image script only) |
--token-file | - | File containing token (skips auto auth; text-to-image script only) |
JSON with success, path, size, revised_prompt on success.
python3 scripts/get_auth.py
Returns JSON {"success": true, "source": "cache|session|login"} — the token itself is never printed to stdout. It is written only to ~/.chatgpt_auth.json (chmod 600, token + timestamp only, no PII). This prevents the token from appearing in shell logs, conversation context, or screenshots.
get_auth.py:
minis-open pops the ChatGPT login page to the user in foreground, then polls every 10s (up to 5 min) until login is detectedscripts/codex_image.py with appropriate arguments.~/.chatgpt_auth.json for 8 hours (chmod 600, token + timestamp only — no PII stored).stream: true; the script handles SSE parsing internally.gpt-image-2 under the hood with auto quality/size.usage tracks text tokens, tool_usage.image_gen tracks image tokens separately.