Use the nano-banana-cli tool to generate and edit images via the OpenRouter API. Trigger this skill whenever the user asks to generate images, create pictures, edit/modify existing images, list available image models, or do anything related to AI image generation. Also trigger when the user mentions "nano-banana", "OpenRouter image", or wants to produce visual content from text prompts. Even if the user just says "make me an image" or "draw something", this skill should be consulted.
This skill teaches you how to use nano-banana-cli, a Go CLI for generating and editing images through the OpenRouter API.
go build -o nano-banana-cli . (from the project root)main.go and go.modnano-banana-cli generate \
--model <model-id> \
--prompt "your description" \
--out output.png
Required flags:
--model: The model ID (e.g., google/gemini-2.5-flash-image-preview)--prompt: Text description of the image to generateOptional flags:
--out <path>: Save to a specific file path (for single image output)--out-dir <dir>: Directory for multiple output images (default: current dir)--aspect-ratio <ratio>: e.g., 1:1, 16:9, 9:16--image-size <size>: e.g., 1K--modalities <types>: Output types, comma-separated: image or image,text (default: image,text)--stream: Use streaming mode (SSE delta aggregation)--raw-json: Print raw OpenRouter API response--timeout <duration>: Request timeout (default: 2m)--referer <url>: HTTP Referer header--title <string>: X-Title headerPass one or more input images along with a prompt describing the edit:
nano-banana-cli generate \
--model google/gemini-2.5-flash-image-preview \
--input-image ./source.png \
--prompt "Make the background a sunset" \
--out edited.png
You can pass multiple --input-image flags for multi-image editing. Input images can be:
./photo.jpg)nano-banana-cli models
nano-banana-cli models --format json
Returns models that support image output. Use --format json for structured output.
When the user asks you to generate an image, follow this process:
OPENROUTER_API_KEY is set. If not, ask the user.go build -o nano-banana-cli .google/gemini-2.5-flash-image-preview as a good default. You can also run nano-banana-cli models to see all available options.--out for a specific filename, or --out-dir for batch output.nano-banana-cli generate \
--model google/gemini-2.5-flash-image-preview \
--prompt "A panoramic mountain landscape" \
--aspect-ratio 16:9 \
--out landscape.png
Some models (like flux) only support image output:
nano-banana-cli generate \
--model black-forest-labs/flux.2-pro \
--modalities image \
--prompt "Abstract art" \
--out art.png
nano-banana-cli generate \
--model google/gemini-2.5-flash-image-preview \
--stream \
--prompt "A detailed fantasy castle" \
--out castle.png
OPENROUTER_API_KEY is missing, the CLI will exit with an error. Prompt the user to set it.--model is missing, the CLI will error. Always include a model flag.--timeout 5m.--out and --out-dir are both specified, the CLI will error (they're mutually exclusive).image,text which works with most models. Some models (like Flux) only support image.--out doesn't affect the actual format — it depends on the model's output.