How to Create Thumbnails and Graphics with Codex

Codex CLI works inside your project, which makes it well-positioned for asset generation tasks that need to land in specific places. Thumbnails, social preview images, and UI graphics are tasks that fit naturally into a Codex session when image generation is available through the same tool connection.

Why This Matters

Thumbnails and graphics for developer projects have consistent requirements: legibility at small sizes, a coherent visual style, and placement in the right directory with the right filename. Codex understands your project’s file structure, so when image generation is available through AgentPatch, it can handle the full task — generate the image, name it correctly, and save it where it belongs.

Recraft, the image generation model available through AgentPatch, handles illustration and vector-style output well, which aligns with the clean graphic look common in developer and technical content.

Setup

Add AgentPatch to ~/.codex/config.toml:

[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"

Then set your API key:

export AGENTPATCH_API_KEY=your_api_key

Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.

Example

You’re maintaining a SaaS product and need a thumbnail for a new feature announcement. You ask Codex:

“Generate a thumbnail for an announcement about our new dark mode feature. Clean illustration style, a UI window graphic with dark theme applied, simple and professional. Save it to public/blog/dark-mode-announcement-thumb.png and add the path to the blog post frontmatter in content/posts/dark-mode.md.”

Codex calls Recraft through AgentPatch to generate the thumbnail, writes the file, and updates the frontmatter in one pass.

For a batch task:

“Look at all posts in content/posts/ from the past 30 days that are missing thumbnails. Check the title and generate a matching thumbnail for each using a consistent style: light background, blue and grey tones, abstract geometric shapes. Save to public/blog/thumbs/ and update the frontmatter.”

Codex iterates through the posts, calls Recraft once per post, saves each file, and updates each frontmatter block.

You can also combine with search for informed visual decisions:

“Search for what thumbnail styles are common for SaaS product announcements. Then generate a thumbnail for our upcoming API v2 launch that matches the better conventions you find.”

Codex calls Google Image Search through AgentPatch first, then calls Recraft with an informed prompt.

Wrapping Up

Codex with AgentPatch handles thumbnail and graphic generation as a natural part of project work — no external tools, no manual file management. The same AgentPatch connection also covers search, news, email, and more. Visit agentpatch.ai to get started.