CLI tool for image generation/editing with OpenAI API.
- Python 100%
| climgpt.py | ||
| README.md | ||
| requirements.txt | ||
Climgpt
A command-line tool for generating and editing images via an OpenAI‑compatible 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 high‑quality 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 (1‑10) | 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 (auto‑named if omitted) | auto‑generated |
--image, -i |
Reference image (repeatable); triggers editing mode | – |
Requirements
- Python 3.8+
clickopenai
Notes
- Compatibility with all API endpoints is not guaranteed.
- As always, keep your API key secret.
License
MIT