AI Commands
The floimg ai command group provides AI-powered text generation, image analysis, and image editing using Gemini.
Prerequisites
Section titled “Prerequisites”Install the Google AI plugin:
npm install -g @teamflojo/floimg-googleSet your API key:
export GOOGLE_AI_API_KEY=your-api-keyGet your API key from Google AI Studio.
Text Generation
Section titled “Text Generation”Generate text using Gemini AI.
floimg ai text --prompt "Write 3 creative prompts for a fantasy landscape"Options
Section titled “Options”| Option | Required | Description |
|---|---|---|
--prompt <text> | Yes | Text prompt for generation |
--api-key <key> | No | API key (or use GOOGLE_AI_API_KEY env) |
--model <name> | No | Model name (default: gemini-2.0-flash) |
--output-format <fmt> | No | text or json (default: text) |
--context <text> | No | Additional context |
--out <path> | No | Save output to file |
Examples
Section titled “Examples”# Simple text generationfloimg ai text --prompt "Describe a cozy coffee shop in one paragraph"
# Generate structured JSONfloimg ai text \ --prompt "Generate 3 image prompts for product photos" \ --output-format json
# Save to filefloimg ai text --prompt "Write alt text for a product image" --out alt.txt
# Use specific modelfloimg ai text --prompt "Complex analysis task" --model gemini-2.0-flashVision Analysis
Section titled “Vision Analysis”Analyze images using Gemini Vision.
floimg ai vision --image photo.jpg --prompt "What objects are in this image?"Options
Section titled “Options”| Option | Required | Description |
|---|---|---|
--image <path> | Yes | Input image path |
--prompt <text> | Yes | Analysis prompt |
--api-key <key> | No | API key (or use GOOGLE_AI_API_KEY env) |
--model <name> | No | Model name (default: gemini-2.0-flash) |
--output-format <fmt> | No | text or json (default: text) |
--out <path> | No | Save output to file |
Examples
Section titled “Examples”# Describe an imagefloimg ai vision --image landscape.jpg --prompt "Describe this scene"
# Extract structured datafloimg ai vision \ --image product.png \ --prompt "List all products visible with prices" \ --output-format json
# Generate alt textfloimg ai vision \ --image hero.jpg \ --prompt "Write accessible alt text for this image" \ --out alt.txt
# Content analysisfloimg ai vision \ --image photo.jpg \ --prompt "Is this image appropriate for a family website?"Image Editing
Section titled “Image Editing”Edit images using Gemini’s native image generation (Nano Banana).
floimg ai edit --image input.jpg --prompt "Make the sky more vibrant" --out edited.jpgOptions
Section titled “Options”| Option | Required | Description |
|---|---|---|
--image <path> | Yes | Input image path |
--prompt <text> | Yes | Edit instructions |
--out <path> | Yes | Output image path |
--api-key <key> | No | API key (or use GOOGLE_AI_API_KEY env) |
--model <name> | No | Model (default: gemini-2.5-flash-image) |
--pre-prompt <text> | No | Instructions prepended to prompt |
--aspect-ratio <ratio> | No | Output aspect ratio (default: 1:1) |
--image-size <size> | No | Output resolution: 1K, 2K, or 4K (default: 1K) |
--grounding | No | Enable Google Search grounding |
Aspect Ratios
Section titled “Aspect Ratios”Supported: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
Examples
Section titled “Examples”# Simple editfloimg ai edit \ --image photo.jpg \ --prompt "Remove the background and replace with white" \ --out clean.jpg
# Style transfer with 4K outputfloimg ai edit \ --image portrait.jpg \ --prompt "Convert to watercolor painting style" \ --image-size 4K \ --out watercolor.jpg
# Widescreen outputfloimg ai edit \ --image room.jpg \ --prompt "Add a potted plant in the corner" \ --aspect-ratio 16:9 \ --out decorated.jpg
# Use grounding for real-time datafloimg ai edit \ --image infographic.jpg \ --prompt "Update the chart with current stock prices for AAPL" \ --grounding \ --out updated.jpgModels
Section titled “Models”| Model | Description |
|---|---|
gemini-2.5-flash-image | Fast, high-volume (default) |
gemini-3-pro-image-preview | Higher quality, better text rendering |
Image Generation
Section titled “Image Generation”Generate images from text prompts using Gemini.
floimg ai generate --prompt "A cozy coffee shop interior" --out coffee-shop.pngOptions
Section titled “Options”| Option | Required | Description |
|---|---|---|
--prompt <text> | Yes | Image description |
--out <path> | Yes | Output image path |
--api-key <key> | No | API key (or use GOOGLE_AI_API_KEY env) |
--model <name> | No | Model (default: gemini-2.5-flash-image) |
--aspect-ratio <ratio> | No | Output aspect ratio (default: 1:1) |
--image-size <size> | No | Output resolution: 1K, 2K, or 4K (default: 1K) |
--grounding | No | Enable Google Search grounding |
Examples
Section titled “Examples”# Generate an imagefloimg ai generate \ --prompt "A minimalist workspace with natural lighting" \ --out workspace.png
# Widescreen cinematic imagefloimg ai generate \ --prompt "A photorealistic mountain lake at sunrise, mist rising from the water" \ --aspect-ratio 21:9 \ --image-size 4K \ --out landscape.png
# Specific stylefloimg ai generate \ --prompt "Isometric 3D illustration of a tiny house, pastel colors, soft shadows" \ --out house.pngPipeline Examples
Section titled “Pipeline Examples”Combine AI commands with other floimg operations:
Analyze and Enhance
Section titled “Analyze and Enhance”# 1. Analyze the imagefloimg ai vision \ --image photo.jpg \ --prompt "Suggest one improvement for this photo" \ --out suggestion.txt
# 2. Apply the suggestionfloimg ai edit \ --image photo.jpg \ --prompt "$(cat suggestion.txt)" \ --out enhanced.jpgGenerate and Transform
Section titled “Generate and Transform”# 1. Generate an imagefloimg ai generate \ --prompt "Abstract geometric pattern" \ --out pattern.png
# 2. Resize for different usesfloimg resize pattern.png 1920x1080 --out pattern-desktop.pngfloimg resize pattern.png 1080x1920 --out pattern-mobile.pngVision to Edit Pipeline
Section titled “Vision to Edit Pipeline”# 1. Analyze the current statefloimg ai vision \ --image room.jpg \ --prompt "What furniture is missing to make this room complete?" \ --out analysis.txt
# 2. Use vision output to guide editfloimg ai edit \ --image room.jpg \ --prompt "Add the following: $(cat analysis.txt)" \ --out furnished.jpgEnvironment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
GOOGLE_AI_API_KEY | Google AI API key for Gemini |
See Also
Section titled “See Also”- Google AI Plugin - Gemini SDK documentation
- xAI Plugin - Grok text and vision
- Transform Command - Non-AI image transforms
- MCP Tools - AI tools for MCP agents