@hewliyang/codex-image-cli
v0.1.1
Published
Standalone Node.js CLI/SDK for generating/editing images via the ChatGPT Codex image_generation backend.
Readme
@hewliyang/codex-image-cli
Standalone Node.js CLI/SDK for generating or editing images through the ChatGPT Codex subscription via the Responses API
tool_choice: { type: "image_generation" }Install
npm install -g @hewliyang/codex-image-cli
img-gen --helpUsage
img-gen -o out.png -s 1024x1024 "draw a tiny red dragon sticker"
img-gen -i out.png -o edited.png "edit this into a blue dragon"
img-gen checkFor local development:
npm install
npm run build
node dist/index.js -o out.png -s 1024x1024 "draw a tiny red dragon sticker"Auth
Login to Codex with Pi or Codex, the CLI consumes their access tokens. Token refresh is not supported by calls via the CLI.
SDK
import { generateImage } from "@hewliyang/codex-image-cli";
const result = await generateImage({
prompt: "draw a tiny red dragon sticker",
outputPath: "out.png",
size: "1024x1024",
});