The command line is fixed
There are four generation commands, image, video, speech, and music, with one set of flags: --aspect, --size, --resolution, --duration, --ref, --first-frame, --voice, and so on. Every flag has one format. An aspect ratio is always 16:9, a resolution is always 720p, a duration is always whole seconds.
What you get back is fixed too: a task with a status, result files, a cost, and an error message. Exit codes are the same for every vendor.
So a script, or an AI agent, learns the CLI once. Moving a job from one vendor to another means changing -m, nothing else:
img-cli image -m vibetoken:bytedance/seedream-5.0-flash "a fox" --aspect 16:9
img-cli image -m grsai:nano-banana-2.1 "a fox" --aspect 16:9
img-cli image -m laozhang:gemini-nano-banana-2.1 "a fox" --aspect 16:9
Providers are plugins
A provider is one TOML file. It says:
- where the API is and how to authenticate;
- how to turn img-cli's fixed input into the vendor's request body, as a template;
- where the task id, status, result files, error, and cost are in the vendor's response;
- which models exist, and which flags and values each model accepts.
Plugins are data, not code. There is nothing to compile, and installing one is copying a file:
img-cli provider add vibetoken # an official plugin
img-cli provider add ./my-vendor.toml # your own
img-cli provider add https://example.com/x.toml # someone else's
The img-cli binary contains no vendor logic. VibeToken, RouterBase, Grsai, and LaoZhang are ordinary plugin files in the providers/ folder of the repository, written in the same format anyone can use.
Built-in protocols for common APIs
Many vendors copy the same few public APIs. img-cli has those built in, so a plugin can point a model at one by name instead of writing a template:
| Protocol | API |
|---|---|
openai-images |
OpenAI Images: generations and edits |
openai-videos |
OpenAI Videos |
openai-speech |
OpenAI text-to-speech |
gemini |
Gemini generateContent with image output |
A plugin can mix them freely. The LaoZhang plugin sends Gemini models to gemini, GPT Image to openai-images, and MiniMax H3 to its own template.
Checked before it is sent
Each model declares the flags it supports and their allowed values. img-cli checks your command against that before making any request, so a wrong value fails at once instead of after a paid round trip:
$ img-cli video -m laozhang:MiniMax-H3 "a cat" --resolution 1080p
error: laozhang:MiniMax-H3: --resolution 1080p is not supported; use one of: 768p, 2k
A plugin can list these by hand, or read them from the vendor's API. The VibeToken plugin reads each model's parameter schema the first time the model is used.
What runs where
you / your agent
│ img-cli image -m grsai:nano-banana-2.1 "a fox" --aspect 16:9
▼
img-cli ── parses flags, checks them against the model's supports
│
├─ grsai.toml ── renders the request body, says where the answer is
│
▼
vendor API ── submit, then poll until done
│
▼
img-cli ── records the task, downloads results, prints the same output for every vendor
Keys, task records, waiting, downloads, retries, and output formats belong to img-cli, so every plugin gets them for free.