CLI tool for image generation/editing with OpenAI API.
Find a file
2026-06-24 20:50:57 +08:00
climgpt.py Initial commit: CLI tool for image generation/editing with OpenAI API 2026-06-24 20:50:57 +08:00
README.md Initial commit: CLI tool for image generation/editing with OpenAI API 2026-06-24 20:50:57 +08:00
requirements.txt Initial commit: CLI tool for image generation/editing with OpenAI API 2026-06-24 20:50:57 +08:00

Climgpt

A command-line tool for generating and editing images via an OpenAIcompatible API.

Quick Start

# 1. Clone and install
git clone https://code.chipmunk.land/Plovie/climgpt.git && cd climgpt
pip install -r requirements.txt

# 2. Set your API key (Linux/macOS)
export OPENAI_API_KEY="sk-..."

# 3. Run
python climgpt.py "A cat wearing a hat"

Examples

# Generate multiple highquality images
python climgpt.py "A cat" --size 1024x1024 --n 2 --quality high

# Specify an output file
python climgpt.py "Sunset" --download sunset.png

# Edit a picture using reference images
python climgpt.py "Add a beret" --image original.png --image style.png

# Connect to a custom API
python climgpt.py "Forest" --base-url https://api.example.com/v1

Options

These are not guaranteed to be up-to-date:

Option Description Default
prompt Image description or editing instruction Required
--size Output dimensions (e.g. 1024x1024, auto) auto
--n Number of images (110) 1
--quality low, medium, high, auto auto
--model Model ID openai/gpt-image-2
--api-key API key (or set env OPENAI_API_KEY)
--base-url API endpoint URL https://api.openai.com/v1
--download Output path (autonamed if omitted) autogenerated
--image, -i Reference image (repeatable); triggers editing mode

Requirements

  • Python 3.8+
  • click
  • openai

Notes

  • Compatibility with all API endpoints is not guaranteed.
  • As always, keep your API key secret.

License

MIT