@fionoble/image-gen-cli
v1.0.5
Published
CLI tool for OpenAI image generation and editing, with a Claude Code skill
Maintainers
Readme
@fionoble/image-gen-cli
A CLI tool for generating and editing images using OpenAI's gpt-image-1 model. Comes with a Claude Code skill for seamless AI-assisted image generation.
Install
npm install -g @fionoble/image-gen-cliOr use without installing:
npx @fionoble/image-gen-cli -p "A cat in a spacesuit" -o cat.pngPrerequisites
- Node.js 18+
- An OpenAI API key set as
OPENAI_API_KEY
export OPENAI_API_KEY="sk-..."Environment Variables
| Variable | Description |
|----------|-------------|
| OPENAI_API_KEY | Required. Your OpenAI API key. |
| OPENAI_BASE_URL | Custom API base URL (for proxies). |
CLI Usage
image-gen [options]Options
| Flag | Description | Default |
|------|-------------|---------|
| -p, --prompt <text> | Image prompt (required) | - |
| -i, --image <path> | Input image for editing | - |
| -o, --output <path> | Output file path | generated-<timestamp>.png |
| -s, --size <size> | 1024x1024, 1024x1536, 1536x1024, auto | auto |
| -q, --quality <quality> | low, medium, high, auto | auto |
| -n, --count <n> | Number of images to generate | 1 |
| -m, --model <model> | OpenAI model | gpt-image-1 |
| --install-skill | Install the Claude Code skill | - |
| --uninstall-skill | Remove the Claude Code skill | - |
Examples
Generate an image:
image-gen -p "A watercolor painting of a Japanese garden" -q high -o garden.pngEdit an existing image:
image-gen -p "Make the sky a dramatic sunset" -i photo.png -o photo-sunset.pngGenerate a logo:
image-gen -p "Minimalist coffee shop logo" -q high -s 1024x1024 -o logo.pngClaude Code Skill
Install the skill so Claude Code can generate images for you:
image-gen --install-skill
# or
npx @fionoble/image-gen-cli --install-skillOnce installed, the /image-gen skill is available in Claude Code. You can either:
- Invoke it directly:
/image-gen create a logo for my app - Or just ask naturally: "generate an image of a cat in space"
Claude will craft a detailed prompt, pick appropriate settings, generate the image, and display the result.
To remove the skill:
image-gen --uninstall-skillLicense
ISC
