Core CLI/CLI Core Commands & Flags
Docs/Core CLI/CLI Core Commands & Flags

CLI Core Commands & Flags

Comprehensive list of command-line flags, options, aspect ratios, and formatting controls.

The imagerry CLI formats, styles, and compresses images locally from your terminal.

Basic Syntax

|bash
# Single image
imagerry -i <input-file> -o <output-file> [options]

# Unix Streaming (stdin / stdout)
cat input.png | imagerry -i - -o - [options] > output.webp

# Batch directory or glob
imagerry -i <input-dir> -o <output-dir> [options]
imagerry --batch "<glob>" -o <output-dir> [options]

Core Options

OptionTypeDefaultDescription
-i, --input <path>stringPath to input file, directory, or - for standard input (stdin)
-o, --output <path>stringPath to output file, directory, or - for standard output (stdout)
-f, --format <format>stringautoTarget format: png, jpeg, or webp
-q, --quality <num>number90Quality (1-100) for WebP and JPEG
-p, --preset <name>string"default"Preset name (mesh, gradient, cyberpunk, etc.)
-b, --batch <glob>stringBatch process multiple files matching a glob pattern
-c, --concurrency <n>number4Parallel workers for batch processing
--padding <num>numberDirect canvas padding override
--radius <num>numberDirect inner border radius override
--shadow <num>numberDirect drop shadow size override
--bg-color <hex>stringSolid background hex color
--ratio <ratio>stringAspect ratio (16:9, 1:1, 4:3, auto)
--watermark <text>stringWatermark overlay text
--title <text>stringHeader title text overlay
--subtitle <text>stringSubtitle text overlay
--license-key <key>stringenvImagerry Pro license key override
--no-update-checkbooleanfalseDisable automatic update check (recommended for CI/CD)
-v, --versionbooleanPrint CLI engine version (currently v0.2.1-beta)
-h, --helpbooleanShow all commands and options
👉

Unix Pipelines (Stdin / Stdout)

Imagerry CLI functions as a first-class Unix filter tool. Stream images directly into shell pipelines without writing intermediate files to disk:

|bash
# Read from standard input (stdin)
cat raw-screenshot.png | imagerry -i - -o styled.png --preset mesh

# Stream raw binary output to standard output (stdout)
imagerry -i photo.png -o - --format webp --preset gradient > result.webp

# Full bidirectional pipeline (stdin → stdout)
curl -sL https://example.com/badge.png | imagerry -i - -o - --format webp > optimized.webp
Pro Tip

Clean Stream Guarantee: When streaming binary image data to stdout (-o -), all progress spinners and logs are automatically redirected to stderr or silenced. Your redirected stdout contains 100% clean binary image data.

Standardized POSIX Exit Codes

For reliable shell automation and CI/CD pipelines, Imagerry CLI adheres to standardized exit codes:

CodeStatusDescription
0SUCCESSCommand completed successfully.
1GENERAL_ERRORRuntime rendering error, filesystem permission error, or server crash.
2INVALID_ARGUMENTMissing required flags, missing input file, or invalid preset/format syntax.
3LICENSE_ERRORLicense key invalid, expired, burst loop detected, or free tier daily quota exceeded.
4CRITICAL_UPDATE_REQUIREDObsolete CLI version below the minimum supported version.

Quick Examples

1. Convert & Style to WebP

|bash
imagerry -i hero.png -o hero.webp -q 85 --preset mesh

2. Direct Style Overrides

|bash
imagerry -i app.png -o app.png --preset gradient --padding 48 --radius 20

3. Batch Process a Folder

|bash
imagerry -i ./screenshots -o ./dist --preset cyberpunk --format webp

4. Stream via Pipe

|bash
cat photo.png | imagerry -i - -o - --format webp > styled.webp

5. Initialize Project Config

|bash
imagerry init --preset mesh
Found an issue or typo? Report on GitHub
Imagerry CLI Docs • v0.2.1-beta