The CLI commands are designed to work well in shell scripts and automation workflows. The output types of the aitiny:image:generate and aitiny:image:edit commands produce machine-readable output (no decorative formatting), making them easy to capture in variables or pipe to other commands.
# Capture the media URI of a generated image in a shell variableMEDIA_URI=$(php cli/joomla.php aitiny:image:generate "A sunrise over mountains" -o mediauri)# Generate an image and get its public URLIMAGE_URL=$(php cli/joomla.php aitiny:image:generate "Company banner" -o url -a 16:9)# Batch-generate images from a file of promptswhile IFS= read -r prompt; do php cli/joomla.php aitiny:image:generate "$prompt" -s cinematic -m webpdone < prompts.txt# Edit all PNG images in a directoryfor img in /path/to/images/*.png; do php cli/joomla.php aitiny:image:edit "$img" "Enhance colours and contrast" -idone# Generate and pipe raw image data to another toolphp cli/joomla.php aitiny:image:generate "Abstract pattern" -o image | convert - output.pdf
When using the -o image output type, the raw binary image data is written to standard output. Make sure to redirect or pipe it, as displaying binary data directly in a terminal will produce garbled output.
You can use the -o imagebase64 output type when you need to embed the image in JSON payloads, data URIs, or other contexts where binary data cannot be used directly.