@vforsh/ink
v0.1.0
Published
CLI for generating and editing images via OpenAI Image API (GPT Image models)
Maintainers
Readme
ink
CLI for OpenAI Image API (GPT Image models). Generate new images or edit existing ones from the command line.
Install
- Requires Bun (latest) and TypeScript (latest).
- Set
OPENAI_API_KEYin your environment.
Usage
ink generate -p "otter with orange scarf" --size 1024x1024echo "a neon diner" | ink generate --size 1536x1024ink edit -i base.png -p "make it winter"ink edit -i lounge.png --mask mask.png -p "add flamingo float" --model gpt-image-1
Commands
generate: Create new images from a text prompt by calling OpenAI’s Image API. You can control output size, quality, background transparency, format, and compression, and request multiple images with --n. The API returns base64 image data which the CLI decodes into files in your output directory. Use this when you want brand‑new images from scratch.
edit: Modify existing images using a text prompt, optionally with a mask to limit changes to specific areas. You can provide up to 16 input images to guide the edit, and control size, quality, background, format, and compression. The API returns base64 image data which the CLI decodes into files in your output directory. Use this to change or extend images you already have.
help: Print usage, flags, and examples for the CLI or a specific subcommand. It explains required inputs, validation rules, and common workflows without assuming prior knowledge. Use ink help edit to see edit‑specific options. Help is always human‑readable and not intended for scripts.
Config
Precedence (high → low): flags > env > project config > user config.
Project config:
./.config/ink.toml
User config:
~/.config/ink/config.toml~/.config/ink/config.json
Example ~/.config/ink/config.toml:
api_key = "sk-..."
model = "gpt-image-1.5"
size = "1024x1024"
quality = "auto"
background = "auto"
format = "png"
compression = 80
moderation = "auto"
out_dir = "./out"
name_template = "{slug}-{index}.{ext}"Dev
- Install deps:
bun install - Typecheck:
bun run typecheck - Run:
bun src/cli.ts --help
