Image Agent CLI
CLI commands for image generation and analysis in PraisonAI TypeScript
The praisonai-ts CLI provides the image command for image generation and analysis.
Quick Start
- Simple Usage
bash praisonai-ts image generate "A sunset over mountains" - With Configuration
bash praisonai-ts image analyze https://example.com/image.jpg --json
Image Agent CLI Commands
The praisonai-ts CLI provides the image command for image generation and analysis.
Generate Images
# Generate an image from text
praisonai-ts image generate "A sunset over mountains"
# Generate with options
praisonai-ts image generate "A cat" --size 1024x1024 --quality hd
# Get JSON output
praisonai-ts image generate "A futuristic city" --jsonExample Output:
{
"success": true,
"data": {
"images": ["https://...generated-image-url..."],
"prompt": "A sunset over mountains"
}
}Analyze Images
# Analyze an image from URL
praisonai-ts image analyze https://example.com/image.jpg
# Analyze with custom prompt
praisonai-ts image analyze https://example.com/image.jpg "What objects are in this image?"
# Get JSON output
praisonai-ts image analyze https://example.com/image.jpg --jsonGeneration Options
| Option | Description |
|---|---|
--size | Image size (256×256, 512×512, 1024×1024, 1792×1024, 1024×1792) |
--quality | Quality level (standard, hd) |
--style | Style (vivid, natural) |
SDK Usage
For programmatic usage:
import { ImageAgent } from 'praisonai';
const agent = new ImageAgent();
// Generate image
const images = await agent.generate({
prompt: 'A sunset over mountains',
size: '1024x1024',
quality: 'hd'
});
// Analyze image
const analysis = await agent.analyze({
imageUrl: 'https://example.com/image.jpg',
prompt: 'Describe this image'
});For more details, see the Image Agent SDK documentation.