pop-img
v1.1.0
Published
Simple CLI to generate images with OpenAI
Downloads
16
Readme
pop-img
Generate an image from a prompt using the OpenAI Images API.
Install (global)
npm install -g pop-imgUsage
export OPENAI_API_KEY="..."
pop-img -o ./out.png "A cute robot barista, watercolor, soft lighting"Print-only (no API call):
pop-img -o ./out.webp --dry-run "A futuristic dashboard UI"Overwrite existing file:
pop-img -o ./assets/hero.png --overwrite "Cyberpunk city skyline at night"Run in background and return immediately:
pop-img -q -o ./assets/hero.png "Cyberpunk city skyline at night"Options
-o, --output <path>(required) Output file path: .png, .jpg/.jpeg, .webp-m, --model <name>Image model (default: gpt-image-1 or$OPENAI_IMAGE_MODEL)-s, --size <size>256x256 | 512x512 | 1024x1024 (default: 1024x1024)-Q, --quality <quality>low | medium | high | auto (default: auto)-q, --quietstart generation in background and return immediately--background <bg>opaque | transparent (default: opaque)--overwriteoverwrite output file if it exists--dry-runprint resolved settings, do not call the API-v, --versionoutput the version
Notes
- This tool writes the returned base64 image or downloads a returned URL to the output file.
How to run locally (dev)
From the project root:
npm install
OPENAI_API_KEY="..." node bin/pop-img.js -o ./test.png "A cat wearing sunglasses"Publish-ready checklist
npm loginnpm publish
Or install directly from a git repo:
npm install -g .