OpenAI Codex CLI + Inliner.ai Integration - AI Image Generation | Inliner.ai

OpenAI Codex CLI + Inliner.ai

Give OpenAI's Codex CLI the power to generate AI images. With the Inliner MCP server, Codex can create, edit, and manage images directly from your terminal.

OpenAI Codex terminal with dark theme and green accents in developer workspace

Prerequisites

Quick Setup

Step 1: Get Your API Key

  1. Log into your Inliner.ai dashboard
  2. Go to Account > API Keys
  3. Click Create API Key and copy the key

Step 2: Configure MCP Server

Add the Inliner MCP server to your Codex CLI config:

~/.codex/config.toml

[mcp.inliner]
command = "npx"
args = ["@inliner/mcp-server"]

[mcp.inliner.env]
INLINER_API_KEY = "inl_your-api-key-here"

Step 3: Restart Codex CLI

Close and reopen Codex CLI to load the MCP server. The Inliner tools will now be available.

Tip: You can also set your API key as an environment variable: export INLINER_API_KEY=inl_xxx

What Codex Can Do

With the Inliner MCP server, Codex CLI gains these capabilities:

Example Interactions

"Create a product showcase image for an e-commerce site, 800x800"

I'll generate that product showcase image for you...

https://img.inliner.ai/myproject/product-showcase-ecommerce-professional_800x800.png

"Edit ./photo.png to remove the background and make it transparent"

I'll upload the image, remove the background, and save the result...

Done! Saved to ./photo-edited.png

Using with @inliner/cli

You can also use the standalone Inliner CLI alongside Codex for batch operations:

Terminal

# Generate images directly from terminal
npx @inliner/cli "hero-banner_1200x600.png" -p myproject

# Pipe through other tools
npx @inliner/cli gen "logo" -p brand --size 512x512 | convert - -resize 64x64 favicon.png

See the CLI documentation for more examples.

Resources

Ready to Add Image Generation to Codex CLI?

Get your API key and start generating images in minutes