Skip to content

CLI Overview

The floimg CLI lets you generate, transform, and save images directly from your terminal - no code required.

Use npx to run floimg instantly:

Terminal window
# Generate a QR code
npx @teamflojo/floimg qr "https://floimg.com" -o qr.png
# Create a bar chart
npx @teamflojo/floimg chart bar --labels "Q1,Q2,Q3,Q4" --values "10,20,30,40" -o chart.png
# Resize an image
npx @teamflojo/floimg resize photo.jpg 800x600 -o thumbnail.jpg
# Convert format
npx @teamflojo/floimg convert image.png -o image.webp
# Interactive mode - see all options
npx @teamflojo/floimg

For frequent use, install globally:

Terminal window
npm install -g @teamflojo/floimg

Then run commands without npx:

Terminal window
floimg qr "https://example.com" -o qr.png

These commands are designed for quick, common operations:

CommandDescriptionExample
qrGenerate QR codesfloimg qr "text" -o qr.png
chartCreate charts (bar, line, pie)floimg chart bar --labels "A,B" --values "10,20"
resizeResize imagesfloimg resize input.jpg 800x600
convertConvert formatsfloimg convert input.png -o output.webp
Terminal window
floimg qr <text> [options]
Options:
-o, --out <path> Output file (default: qr.png)
-s, --size <pixels> Size in pixels (default: 300)
-f, --format <format> png or svg (default: png)
-e, --error-correction L, M, Q, or H (default: M)
--dark <color> Dark color hex
--light <color> Light color hex
Examples:
floimg qr "https://floimg.com" -o qr.png
floimg qr "Hello" --size 400 --format svg -o hello.svg
Terminal window
floimg chart <type> [options]
Types: bar, line, pie, doughnut, radar, polarArea, scatter
Options:
-o, --out <path> Output file (default: chart.png)
-l, --labels <items> Comma-separated labels
-v, --values <items> Comma-separated values
-d, --data <file> JSON file with Chart.js config
--title <text> Chart title
-w, --width <pixels> Width (default: 500)
-h, --height <pixels> Height (default: 300)
Examples:
floimg chart bar --labels "A,B,C" --values "10,20,30" -o chart.png
floimg chart line --data sales.json -o sales-chart.png
Terminal window
floimg resize <input> <size> [options]
Options:
-o, --out <path> Output file
--fit <mode> cover, contain, fill, inside, outside
--background <color> Background color for contain mode
Examples:
floimg resize photo.jpg 800x600 -o thumbnail.jpg
floimg resize hero.png 1200 -o hero-resized.png
Terminal window
floimg convert <input> [options]
Options:
-o, --out <path> Output file (format inferred)
-t, --to <format> Target format: png, jpg, webp, avif
-q, --quality <number> Quality for lossy formats (1-100)
Examples:
floimg convert photo.png -o photo.webp
floimg convert image.jpg --to avif -q 85

Shorthand commands like qr and chart require plugins. On first run, floimg will prompt to install them:

🔍 The 'qr' command requires @teamflojo/floimg-qr
QR Code Generator
Install it now? (y/n): y
📦 Installing @teamflojo/floimg-qr...
✅ Installed!

After installation, the plugin is cached for future use.

For advanced use cases, the full API provides complete flexibility:

CommandDescription
generateCreate an image from any generator
transformApply any transformation to an image
saveSave to filesystem or cloud storage
runExecute a YAML workflow file
configManage configuration
pluginsList and install plugins
mcpMCP server for AI agents
doctorCheck environment and configuration
Terminal window
floimg generate --generator qr --params '{"text":"hello"}' --out qr.png
floimg generate --generator quickchart --params '{"type":"bar",...}' --out chart.png
Terminal window
floimg transform --in image.png --op resize --params '{"width":800}' --out resized.png
floimg transform --in photo.jpg --op convert --to webp --out photo.webp
VariableDescription
AWS_ACCESS_KEY_IDFor S3 storage output
AWS_SECRET_ACCESS_KEYFor S3 storage output
AWS_REGIONAWS region for S3
OPENAI_API_KEYFor AI-powered generators