
通过codex CLI桥接OpenAI的gpt-image-2,给Claude Code生成图像。使用你的ChatGPT子,没有API密钥。
概览
通过通过代码库CLI桥接,使用OpenAI的gpt-image-2从CLI编码代理生成图像。使用您的ChatGPT订阅—— 桥接是一个独立的bash脚本——Claude Code、Cursor、Gemini CLI、aider或其他能运行shell命令的代理都能调用它。Claude Code的人体工学设计最优,因为内置安装程序将其注册为技能,Claude会主动调用。 它适用于任何设计技能(比如Leonxlnx/品味技能的形象-品味-前端技能),或者在你的代理需要制作图片时单独使用。 编码代理不附带图像生成工具。这会增加一个薄的bash封装,输出到codex exec,它利用你现有的ChatGPT认证调用gpt-image-2,并将你要求的PNG复制到你要求的位置。然后你的代理会将PNG读回上下文。 Codex 以沙箱形式运行,只能在自己的工作目录内写入,因此包装器会指向私有的临时 dir,并自行完成最终副本。
概述(AI 翻译)
通过通过 codex CLI 桥接,使用 OpenAI 的 GPT 图片 2.5 生成图像。使用您的 ChatGPT 订阅 — 无需 API 密钥,无需按图片计费。
桥接是一个独立的bash脚本——Claude Code、Cursor、Gemini CLI、aider或其他能运行shell命令的代理都能调用它。Claude Code的人体工学设计最优,因为内置安装程序将其注册为技能,Claude会主动调用。
它可以搭配任何设计技能(比如Leonxlnx/taste-skill的image-taste-frontend]技能),或者在你的代理人需要制作图片时单独使用。
这是什么
这通过一个薄的bash封装为编码代理添加图像生成,覆盖到codex exec,利用你现有的ChatGPT认证调用其image_generation工具,并将你请求的PNG复制到你请求的位置。然后你的代理会将PNG读回上下文。
OpenAI 的 Images 2.5 公告中包含了 Codex 中的可用性。桥接器使用 Codex 提供的图像模型;它不会选择或验证特定的后端模型。该可执行文件仍命名为 gpt-image-2,以确保与现有安装和脚本的兼容性。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
gpt-image-bridge
Generate images with OpenAI’s GPT Image 2.5 from a CLI coding agent by bridging through the codex CLI. Uses your ChatGPT subscription — no API key required, no per-image billing.
The bridge is a standalone bash script — Claude Code, Cursor, Gemini CLI, aider, or any other agent that can run a shell command can call it. Claude Code just gets the nicest ergonomics, because the included installer registers it as a skill so Claude reaches for it unprompted.
Works with any design skill (like the image-taste-frontend skill from Leonxlnx/taste-skill) or on its own whenever your agent needs to produce a picture.
What it is
This adds image generation to coding agents through a thin bash wrapper that shells out to codex exec, calls its image_generation tool using your existing ChatGPT authentication, and copies the PNG where you asked. Your agent then reads the PNG back into context.
OpenAI’s Images 2.5 announcement includes availability in Codex. The bridge uses the image model provided by Codex; it does not select or verify a particular backend model. The executable is still named gpt-image-2 for compatibility with existing installs and scripts. That filename does not pin generation to GPT Image 2.
your agent ──shell──▶ gpt-image-2 wrapper ──codex exec──▶ image_generation
│ │
read PNG ◀── copies to your ◀──── out.png in a ◀────┘
output path private temp dir
Codex runs sandboxed and can only write inside its own working directory, so the wrapper points it at a private temp dir and performs the final copy itself. That keeps arbitrary output paths (and Windows paths) working reliably.
Prerequisites
- Any coding agent that can run shell commands — Claude Code, Cursor, Gemini CLI, aider, or your own script
codexCLI installed (brew install codexon macOS,npm install -g @openai/codexanywhere)- A ChatGPT subscription (Plus / Pro / Team) logged in via
codex login - macOS, Linux, or Windows — the wrapper is bash, which on Windows runs under Git Bash (the shell Claude Code already uses there) or WSL
Verify:
codex login status # should say: Logged in using ChatGPT
codex features list | grep image_generation # should be: stable true
Install
Claude Code
git clone https://github.com/oakplank/gpt-image-bridge.git
cd gpt-image-bridge
./install.sh
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add oakplank/gpt-image-bridge