A command-line interface for Orshot - AI powered visual content generation platform. Generate images from your templates directly from your terminal
npm install -g orshot-cli
-
Login with your API key:
orshot auth login <your-api-key>
-
List available templates:
orshot templates library orshot templates studio
-
Generate an image:
orshot generate library <template-id> orshot generate studio <template-id>
Log in with your Orshot API key. If no key is provided, you'll be prompted to enter it securely.
Options:
-d, --domain <domain>
- API domain (default: https://api.orshot.com)
Examples:
orshot auth login your-api-key-here
orshot auth login # Will prompt for API key
Log out and clear stored credentials.
Show current user information and authentication status.
List your library templates.
Options:
-l, --limit <number>
- Limit number of results (default: 20)-j, --json
- Output as JSON
List your studio templates.
Options:
-l, --limit <number>
- Limit number of results (default: 20)-j, --json
- Output as JSON
Show available modifications for a template.
Options:
-t, --type <type>
- Template type: library or studio (default: library)-j, --json
- Output as JSON
Examples:
orshot templates modifications abc123
orshot templates modifications def456 --type studio
Generate an image from a library template.
Options:
-m, --modification <key=value>
- Template modifications (can be used multiple times)-f, --format <format>
- Output format: png, jpg, jpeg, webp, pdf (default: png)-t, --type <type>
- Response type: base64, binary, url (default: base64)-o, --output <filename>
- Output filename-i, --interactive
- Interactive mode to set modifications-j, --json
- Output response as JSON
Examples:
# Basic generation
orshot generate library abc123
# With modifications
orshot generate library abc123 -m title="Hello World" -m color="blue"
# Interactive mode
orshot generate library abc123 --interactive
# Custom output
orshot generate library abc123 -o my-image.png -f png
# Get URL instead of downloading
orshot generate library abc123 -t url
Generate an image from a studio template.
Options:
-m, --modification <key=value>
- Template modifications (can be used multiple times)-f, --format <format>
- Output format: png, jpg, jpeg, webp, pdf (default: png)-t, --type <type>
- Response type: base64, binary, url (default: base64)-o, --output <filename>
- Output filename-i, --interactive
- Interactive mode to set modifications-j, --json
- Output response as JSON
Examples:
# Basic generation
orshot generate studio def456
# With modifications
orshot generate studio def456 -m name="John Doe" -m title="CEO"
# Interactive mode
orshot generate studio def456 --interactive
# Custom output
orshot generate studio def456 -o my-studio-image.png -f png
The CLI stores your configuration in your system's config directory:
- macOS:
~/Library/Preferences/orshot-cli/config.json
- Linux:
~/.config/orshot-cli/config.json
- Windows:
%APPDATA%/orshot-cli/config.json
Get your API key from Orshot Workspace > Settings > API Key here.
- PNG - Best for images with transparency
- JPG/JPEG - Best for photos and images without transparency
- WebP - Modern format with good compression
- PDF - For documents and print-ready files
- base64 - Image data as base64 string (default)
- binary - Raw binary data
- url - Returns a URL to the generated image
# Login
orshot auth login your-api-key
# Check authentication
orshot auth whoami
# List library templates
orshot templates library
# Check available modifications for a template
orshot templates modifications template-123
# Generate image with modifications
orshot generate library template-123 \\
-m title="My Custom Title" \\
-m background_color="#ff0000" \\
-o custom-image.png
# Generate from studio template interactively
orshot generate studio studio-456 --interactive
# Generate multiple variations
orshot generate library template-123 -m title="Version 1" -o v1.png
orshot generate library template-123 -m title="Version 2" -o v2.png
orshot generate library template-123 -m title="Version 3" -o v3.png
The CLI provides detailed error messages and suggestions:
❌ Login failed: Invalid API key. Please check your credentials.
❌ Failed to generate image: Template not found.
💡 Make sure the template ID is correct and you have access to it
❌ Not authenticated. Please run:
orshot auth login <your-api-key>
- Documentation: https://orshot.com/docs
- API Reference: https://orshot.com/docs/api-reference
- Support: [email protected]
MIT License - see LICENSE file for details.