Openclaw Codex Image Gen banner
jkf87 jkf87

Openclaw Codex Image Gen

Development community

Description

OpenClaw plugin for Codex CLI image generation ($imagegen)

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

openclaw-codex-image-gen

Reference book link:

OpenClaw plugin for generating images via `codex responses` and the `image_generation` tool under the current Codex login session.

![Example promotional hero image generated with the plugin](./assets/chatgpt-images2-book-hero-rr.png)

Inspired by [hermes-gpt-image-gen](https://github.com/Jinbro98/hermes-gpt-image-gen) and the reference skill [codex-image-generation-skill](https://github.com/Gyu-bot/codex-image-generation-skill), then adapted for the OpenClaw plugin lifecycle and tool interface.

Examples

Prompt Result
A cute robot cat sitting on a cloud, digital art, vibrant colors
Korean e-commerce poster
Korean tech-book promotional hero banner

English first

What this plugin does

It registers a tool named `codex_image_generate` inside OpenClaw. When the tool is called, the plugin:

  1. checks candidate Codex CLI binaries,
  2. prefers one machine-specific user-installed Codex path first,
  3. sends a raw Responses API payload to codex responses,
  4. requests the image_generation tool explicitly,
  5. extracts a base64 image when Codex emits the expected streamed JSONL event shape,
  6. writes the decoded image to disk,
  7. returns the saved file path back to OpenClaw.

In short, this plugin uses Codex's `image_generation` tool directly, instead of falling back to a code-generated image workaround.

Why this changed

The original version of this repo assumed a `$imagegen` flow through `codex exec`. That turned out to be unreliable in this environment for two separate reasons:

  • an older Codex binary on PATH was being selected first,
  • the practical Codex image-generation path that worked consistently was codex responses with the image_generation tool.

S