img-cli

Introduction

img-cli is a command line for generating images, video, speech, and music through any AI vendor. The commands are designed once; each vendor plugs in as a provider file that adapts them to its API.

What is img-cli?

img-cli is a single Go binary. It gives every vendor the same four commands, image, video, speech, and music, the same flags, and the same output. A provider plugin, one TOML file, tells it how to call one vendor. Official plugins cover VibeToken, RouterBase, Grsai, and LaoZhang API, and you can write one for any other API without compiling anything.

It is built to be:

  • Universal: one set of flags for every vendor. Switching vendors means changing -m.
  • Pluggable: vendors are data files you install, share, or write yourself.
  • Safe to automate: flags are checked against the model before anything is sent, keys are read from environment variables or a config file only you can read, and a submit is never blindly retried.
  • Agent-friendly: JSON output, stable exit codes, and a --dry-run that costs nothing.

Why use img-cli?

For people using AI assistants

  • Ask Claude Code, Codex, or Cursor for an image, a video, or a voiceover in plain words; the assistant runs img-cli for you.
  • Results are saved on your computer, and long videos keep rendering if you close the window.

For scripts and CI

  • One output format and one set of exit codes for every vendor.
  • Keys from environment variables, isolated config with IMG_CLI_CONFIG_DIR, and safe retries.

For plugin authors

  • Connect a new vendor by copying the request from its docs into a template.
  • Standard APIs need almost nothing: OpenAI Images, Videos, Speech, and Gemini are built in.

Common workflows

Generate an image from a prompt and a reference photo:

img-cli image -m grsai:nano-banana-2.1 "make it watercolor" --ref photo.jpg -o out/

Turn a first frame into a video, without waiting:

img-cli video -m vibetoken:bytedance/seedance-2-i2v "the camera pulls back" --first-frame a.png --no-wait
img-cli task wait <task> -o out/

Generate a voiceover:

img-cli speech -m vibetoken:minimax/speech-2.8-hd "Welcome back." --voice English_Graceful_Lady -o hello.mp3

Find a model and see what it accepts:

img-cli models list --kind video
img-cli models show laozhang:MiniMax-H3

Next