How to Generate AI Images from the Command Line in 2026

Every marketing image you create follows the same loop: open Canva or Midjourney, write a prompt, wait, download, reformat, upload somewhere else. If you produce more than a few images per week, those browser tabs and context switches add up to hours of lost time.
There is a faster way. If you already work in a terminal, you can generate AI images from the command line, download them, and pipe them directly into your publishing workflow. One command per image. No browser. No drag-and-drop.
This guide covers the practical workflow: which models to use, how to write effective prompts, and how to go from text prompt to published social media image in under 60 seconds using Wonda CLI.
Key Takeaways
- Wonda CLI gives you access to multiple image generation models from a single
generate imagecommand- The right model choice depends on your use case: photorealistic product shots, illustrations, text-heavy graphics, or fast iterations
- CLI-generated images pipe directly into editing and publishing workflows, eliminating the download-upload-reformat cycle
- Batch generation with shell scripts lets you produce dozens of variations in minutes
Why Generate Images from the Terminal?
The case for CLI-based image generation is not aesthetic preference. It is operational efficiency.
A typical marketing workflow involves five to six tools: a design tool for creation, a cloud storage service for assets, a scheduling tool for distribution, and separate browser tabs for each platform. Every tool switch costs 30 to 60 seconds of context switching, and research consistently shows that context switching reduces productivity by 20 to 40 percent.
CLI-based generation compresses the pipeline:
- Generate — one command produces the image
- Edit (optional) — add text overlays, resize, or adjust
- Publish — push directly to Instagram, TikTok, or download locally
That is three steps instead of twelve. And because every step is a command, you can script the entire pipeline for batch production.

If you have already read You Don't Need to Learn the CLI: Let Claude Code Run Wonda for You, you know that Claude Code can translate plain-English requests into Wonda commands. This guide goes one layer deeper: the actual commands, flags, and model selection logic.
Which AI Image Models Should You Use?
Wonda exposes multiple image models through a single generate image command. The right model depends on what you need.
Start with the default
NanoBanana 2 (nano-banana-2) is the default starting point and covers most everyday marketing use cases well: product shots, lifestyle imagery, social media visuals, and quick iterations.
wonda generate image \
--model nano-banana-2 \
--prompt "flat lay of skincare products on white marble, soft diffused lighting, editorial product photography" \
--aspect-ratio 1:1 \
--wait -o product-shot.pngStep up to higher-quality stills
NanoBanana Pro (nano-banana-pro) is the upgrade path when you want more polish for a hero image, landing page visual, or higher-stakes campaign asset.
wonda generate image \
--model nano-banana-pro \
--prompt "coffee shop interior, morning light streaming through windows, warm tones, shallow depth of field, editorial photography" \
--aspect-ratio 16:9 \
--wait -o hero-image.pngFor images with text
GPT Image 1.5 (gpt-image-1-5) is the right choice when the image needs readable text, such as quote cards, promo graphics, or text-heavy social assets.
wonda generate image \
--model gpt-image-1-5 \
--prompt "minimalist social media graphic with text 'Ship Faster' in bold sans-serif, dark background, neon green accent" \
--aspect-ratio 9:16 \
--wait -o text-graphic.pngFor a different look or a fallback
If you want a different visual style, or NanoBanana misses the brief, switch models instead of forcing the same prompt forever. grok-imagine is a useful alternative for more stylized or more obviously art-directed imagery.
wonda generate image \
--model grok-imagine \
--prompt "abstract geometric pattern, brand colors blue and white, clean background" \
--aspect-ratio 1:1 \
--wait -o test-variation.pngHow to Write Effective Image Prompts
The difference between a mediocre AI image and a usable one is almost always the prompt. Here are the rules that consistently produce better results.
Be specific about composition
Bad: "a photo of coffee"
Good: "overhead flat lay of a ceramic pour-over setup on a wooden table, single coffee cup, scattered beans, soft morning light from the left, minimal negative space"
The specific prompt tells the model about camera angle (overhead), composition (flat lay), materials (ceramic, wooden), lighting direction (from the left), and space usage (minimal negative space).
Describe the style, not just the subject
Always include visual style cues: "editorial product photography," "cinematic color grading," "minimalist graphic design," "documentary-style." These phrases shift the output from generic to intentional.
Use aspect ratio intentionally
- 1:1 — Instagram feed, product catalog
- 9:16 — Instagram Stories, TikTok, vertical ads
- 16:9 — Blog hero images, YouTube thumbnails, landscape ads
- 4:5 — Instagram portrait posts (most engagement-optimized ratio)
# Instagram Story
wonda generate image --model nano-banana-2 \
--prompt "your prompt" --aspect-ratio 9:16 --wait -o story.png
# Blog hero
wonda generate image --model nano-banana-pro \
--prompt "your prompt" --aspect-ratio 16:9 --wait -o hero.pngBatch Generation: Produce Dozens of Variations in Minutes
This is where CLI-based generation pulls decisively ahead of browser-based tools. A simple bash loop can produce 10 or 50 variations while you do something else.
#!/bin/bash
# generate-variations.sh — Batch generate ad creative variations
PROMPTS=(
"ceramic coffee mug, morning light, minimal background, product photography"
"ceramic coffee mug, overhead angle, scattered beans, warm tones"
"ceramic coffee mug held in two hands, bokeh background, cozy"
"ceramic coffee mug on wooden desk, laptop in background, workspace"
"ceramic coffee mug with latte art, close-up macro, shallow DOF"
)
for i in "${!PROMPTS[@]}"; do
echo "Generating variation $((i+1))..."
wonda generate image \
--model nano-banana-2 \
--prompt "${PROMPTS[$i]}" \
--aspect-ratio 1:1 \
--wait -o "variation-$((i+1)).png"
done
echo "Done — $((${#PROMPTS[@]})) variations generated."This approach maps directly to the volume-based marketing strategy that outperforms hero-creative approaches. Instead of spending an hour perfecting one image, generate ten variations in five minutes and let engagement data pick the winner.
From Image to Published Post: The Full Pipeline
The real power is chaining generation into the rest of the Wonda workflow. Here is a complete pipeline from prompt to published Instagram post:
# 1. Generate the image
JOB_ID=$(wonda generate image \
--model nano-banana-2 \
--prompt "flat lay of new product launch, clean white background, editorial" \
--aspect-ratio 4:5 \
--wait --quiet)
# 2. Get the media reference
MEDIA_ID=$(wonda jobs get inference "$JOB_ID" --jq '.outputs[0].media.mediaId')
# 3. Publish to Instagram
ACCOUNT_ID=$(wonda accounts instagram --jq '.[0].id')
wonda publish instagram \
--media "$MEDIA_ID" \
--account "$ACCOUNT_ID" \
--caption "New drop. Available now. Link in bio. #productlaunch #newrelease" \
--product IMAGE \
--share-to-feedThree commands. Prompt to published post. No browser tab involved.
For the full Instagram automation workflow with more detail on captions and scheduling, see How to Automate Instagram Posting from the Terminal.
Image-to-Video: Chain Into Video Generation
AI images are not just final outputs. They are inputs for video workflows. Generate a product image, then animate it into a video ad:
# Generate the reference image
IMG_JOB=$(wonda generate image \
--model nano-banana-pro \
--prompt "sleek wireless headphones on a reflective surface, studio lighting, product hero shot" \
--aspect-ratio 9:16 --wait --quiet)
IMG_MEDIA=$(wonda jobs get inference "$IMG_JOB" --jq '.outputs[0].media.mediaId')
# Animate it into a 5-second video
VID_JOB=$(wonda generate video \
--model kling_3_pro \
--attach "$IMG_MEDIA" \
--prompt "slow camera push-in, subtle reflections shifting on the surface, ambient lighting pulse" \
--duration 5 --aspect-ratio 9:16 --wait --quiet)This image-to-video pipeline is covered in depth in The Developer's Guide to AI Video Generation in 2026. The key point: CLI images flow directly into video generation without any manual file handling.
Common Mistakes to Avoid
Prompts that are too short. "A product photo" gives the model nothing to work with. Specify composition, lighting, angle, style, and mood.
Ignoring aspect ratio. Generating a 1:1 image when you need 9:16 means you lose resolution cropping it. Set the aspect ratio at generation time.
Using one model for everything. GPT Image 1.5 handles text best. NanoBanana covers the default path. NanoBanana Pro and Grok Imagine are better when you want a different look or more polish. Match the model to the task.
Not batch-generating. If you are generating images one at a time in a browser, you are leaving the biggest advantage of CLI-based generation on the table. Script it.
Skipping the review step. AI images are not always perfect on the first try. Generate 3 to 5 variations and pick the best one. The cost difference is negligible; the quality difference is significant.
Frequently Asked Questions
How much does AI image generation cost with Wonda?
Costs vary by model and resolution. Run wonda pricing list to see current rates, or wonda pricing estimate if you want to check cost before you generate.
Can I use these images commercially?
Yes. Images generated through Wonda are yours to use commercially. Each model has its own license terms, but the standard use case — marketing content, social media posts, product photography — is covered across all available models.
Do I need to install anything besides the CLI?
No. Wonda is a standalone binary with no runtime dependencies. Install it with one command and it works immediately. No Docker, no Python, no Node.js required.
Can Claude Code do all of this for me?
Yes. If you describe what you want in plain English, Claude Code reads Wonda's skill file and executes the right commands. See Let Claude Code Run Wonda for You for the full walkthrough.
What about image editing — can I add text overlays or resize?
Wonda's edit pipeline supports video operations. For image post-processing like adding text overlays, you can chain the image into a video workflow or use standard CLI tools like ImageMagick alongside Wonda. The generate-then-edit pattern is the same regardless of whether the final output is a still image or video.
What's Next
Once you have image generation running from the terminal, the natural next steps are:
- Video generation — animate your images or generate from text with The Developer's Guide to AI Video Generation
- Social media publishing — push images directly to Instagram and TikTok with Automate Instagram Posting from the Terminal
- UGC-style content — generate authentic-looking user content for ad creative testing with AI UGC on Autopilot
- Volume testing — batch-generate ad variations to find winners with Volume-Based Marketing
The terminal is the fastest surface for AI image generation in 2026. Not because command lines are trendy, but because they compose, they script, and they let agents operate them. That is the workflow advantage that browser-based tools cannot match.