Agent skill
nano-banana-image-gen
Generate images using the `imagen` CLI (Gemini and OpenAI models). Use when the user says "nano banana", "generate an image", "create an image", "make me a picture", "image gen", "draw", "illustrate", or wants to create images from text prompts.
Install this agent skill to your Project
npx add-skill https://github.com/ozten/skills/tree/main/nano-banana-image-gen
SKILL.md
Image Generation with imagen CLI
Generate images using the imagen CLI — a unified interface for Google Gemini and OpenAI image models. Supports text prompts, multiple aspect ratios, output formats, batch generation, and more.
Prerequisites
- imagen CLI: Install via
curl -fsSL https://raw.githubusercontent.com/ozten/imagen/main/scripts/install.sh | bash - API Keys: Configure via environment variables or config file (see below)
Quick Start
# Basic generation (uses default nano-banana / gemini-3-pro-image-preview)
imagen "A cat wearing a top hat" -o cat.jpg
# With aspect ratio
imagen "Mountain panorama" --aspect-ratio 16:9 -o mountains.jpg
# Using OpenAI model
imagen "Cyberpunk cityscape" -m gpt-1.5 -o city.png
# Multiple images
imagen "Abstract art" -n 3 -o art.jpg
# Higher resolution
imagen "Detailed landscape" --size 2K -o landscape.jpg
# Read prompt from file
imagen --prompt-file prompt.txt -o result.jpg
Models
| Alias | Model ID | Provider |
|---|---|---|
nano-banana (default) |
gemini-3-pro-image-preview |
Gemini |
gpt-1.5 |
gpt-image-1.5 |
OpenAI |
gpt-1 |
gpt-image-1 |
OpenAI |
gpt-1-mini |
gpt-image-1-mini |
OpenAI |
Options
| Option | Values | Default | Description |
|---|---|---|---|
-m, --model |
see Models table | nano-banana |
Image generation model |
-a, --aspect-ratio |
1:1, 16:9, 9:16, 4:3, 3:4, etc. | 1:1 | Output aspect ratio |
-s, --size |
1K, 2K, 4K | 1K | Image resolution |
-q, --quality |
auto, low, medium, high | auto | Quality (OpenAI models only) |
-f, --format |
jpeg, png, webp | jpeg | Output format |
-o, --output |
path | auto-generated | Output file path |
-n, --count |
integer | 1 | Number of images to generate |
-p, --prompt-file |
path | none | Read prompt from file |
-v, --verbose |
flag | off | Verbose output |
Workflow
If the user provides $ARGUMENTS, treat them as the image prompt. Otherwise ask what they'd like to generate.
Step 0: Check imagen is installed
Before generating, verify imagen is available:
which imagen
If imagen is NOT found:
- Tell the user that the
imagenCLI is required but not installed - Ask them: "Would you like me to install the
imagenCLI? It's a lightweight Rust binary from https://github.com/ozten/imagen" - If they agree, run:
bash
curl -fsSL https://raw.githubusercontent.com/ozten/imagen/main/scripts/install.sh | bash - After installation, verify it worked:
imagen --version
If API keys are NOT configured:
Check for API keys:
# Check env vars
echo "${GEMINI_API_KEY:+gemini_ok}" "${OPENAI_API_KEY:+openai_ok}"
# Check config file
cat ~/.config/imagen/config.toml 2>/dev/null
If no keys are found for the provider needed by the chosen model:
- Tell the user which API key is needed (Gemini for nano-banana, OpenAI for gpt-* models)
- Ask them to set up keys via environment variable or config file:
- Environment variable:
export GEMINI_API_KEY="your-key"orexport OPENAI_API_KEY="your-key" - Config file (
~/.config/imagen/config.toml):toml[keys] gemini = "your-gemini-api-key" openai = "your-openai-api-key"
- Environment variable:
- Do NOT proceed with generation until at least one relevant key is configured
Step 1: Generate the image
Determine the prompt, output path, model, aspect ratio, and other options, then run:
imagen "PROMPT" \
--model MODEL \
--aspect-ratio ASPECT_RATIO \
--size SIZE \
--format FORMAT \
--output OUTPUT_PATH
Only include flags that differ from defaults.
Step 2: Report results
Report the output file path and parameters used. If generation fails, check:
- API key is configured for the chosen provider
- Prompt doesn't violate content policies
- Model alias is valid
Batch Generation
For multiple images, either use -n for the same prompt or run imagen multiple times with different prompts:
# Same prompt, multiple variations
imagen "Abstract art" -n 3 -o abstract.jpg
# Different prompts in sequence
imagen "Panel 1: A sunny beach" -o panel_1.jpg
imagen "Panel 2: Same beach at sunset" -o panel_2.jpg
Integration
Other skills and pipelines can delegate image generation to this skill by invoking the imagen CLI directly.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
five-whys
Root cause analysis technique for self-improvement. Use after any failure, mistake, or suboptimal outcome to find systemic causes and actionable changes. Triggers: analyzing why something went wrong, debugging repeated failures, post-mortem analysis, retrospectives, understanding root causes, reflecting on what could be improved.
webdev-combobox-autocomplete
Foundational patterns for building accessible autocomplete/combobox components with state management, ARIA patterns, keyboard navigation, async suggestions, and framework-agnostic implementation. Use when building autocomplete inputs, command palettes, search inputs, select replacements, or any dropdown with keyboard navigation and suggestions.
ui-design-iteration
Iterates on data-intensive UI designs to improve scannability, hierarchy, accessibility, and systematization. Use when improving an existing UI, reviewing a design for UX issues, or transforming a functional-but-flat interface into a polished product.
tpm-spec-verify
Enrich a Phase Sepc/PRD with Quality Requirements (Q-nnn) and Acceptance Criteria (AC-nnnn). Use when user wants to add QA perspective, define test criteria, identify non-functional requirements, add verification steps, or prepare a Phase PRD for test planning.
find-bugs
Adversarial three-agent bug review pipeline. Runs search → adversary → judge to find high-confidence bugs with reduced false positives. Use: /find-bugs src/
webdev-filter-query-builder
Domain-specific filter query building with AST representation, operator handling, query serialization, and field-type-specific inputs. Use when building advanced filter UIs for observability tools, data analytics, search interfaces, or any system requiring structured query construction with boolean logic, comparison operators, and URL/string serialization.
Didn't find tool you were looking for?