GetWebP CLI Commands Reference
Complete reference for all GetWebP CLI commands, flags, and output formats.
GetWebP CLI Commands Reference
Complete reference for all GetWebP CLI commands, flags, and output formats.
See also: README | Getting Started | Exit Codes | JSON Output
Quick Reference#
| Command | Description |
|---|---|
getwebp <path> | Convert images to WebP format |
getwebp auth <license-key> | Activate a license key |
getwebp status | Show license and version info |
getwebp logout | Unbind license from this device |
Global Flags#
These flags apply to all commands.
| Flag | Alias | Description | Default |
|---|---|---|---|
--version | -v | Print CLI version and exit | -- |
--help | -- | Show help text and exit | -- |
--json | -- | Structured JSON output on stdout (human messages go to stderr) | off |
--verbose | -- | Enable verbose output | off |
--debug | -- | Enable debug output (implies --verbose) | off |
# Print version
getwebp --version
# Output: getwebp/1.0.1
# Show help
getwebp --helpgetwebp <path>#
Convert one or more images to WebP or AVIF format. Original files are never modified or deleted.
Synopsis#
getwebp [path] [options]
getwebp -i <path> [options]
The positional [path] argument and the -i, --input flag are interchangeable. If both are provided, the positional argument takes precedence.
Flags#
| Flag | Alias | Description | Default | Tier |
|---|---|---|---|---|
<path> (positional) | -- | Input file or directory to convert | -- | All |
--input <path> | -i | Input file or directory (alternative to positional arg) | -- | All |
--output <path> | -o | Output directory for converted files | Same directory as source | All |
--quality <number> | -- | Output quality, 1--100 (applies to both WebP and AVIF) | auto (WebP) / 55 (AVIF) | All |
--format <format> | -- | Output format: webp or avif | webp | All |
--recursive | -r | Recursively process images in subdirectories | off | All |
--concurrency <number> | -- | Number of parallel workers, max 32 | CPU cores - 1 | Pro |
--dry-run | -- | Preview which files would be converted (no writes) | off | All |
--skip-existing | -- | Skip if the output file already exists at the output path | off | All |
--no-auto-quality | -- | Disable SSIM binary search; use fixed quality=80 | off | All |
--json | -- | NDJSON output for CI pipelines and AI agents | off | All |
Notes:
- On the Free plan,
--concurrencyis ignored. Processing is serial with a 3-second delay between files and a 20-file limit per run. - Quality is clamped to the range 1--100. Invalid values fall back to
80. - When
--outputis omitted, converted files are written next to the source files. - Auto-quality (SSIM binary search) is WebP-only.
--format avifalways uses fixed quality (default 55). --formatvalues are case-insensitive. Any other value exits with code2.
Supported Formats#
| Input | WebP output (--format webp) | AVIF output (--format avif) |
|---|---|---|
| JPG / JPEG | Yes | Yes |
| PNG | Yes | Yes |
| BMP | Yes | Yes |
| WebP | Yes (re-encoded) | Yes |
| HEIC / HEIF | Yes | Yes |
| AVIF | Yes | Yes (re-encoded) |
Examples#
Convert a single image:
getwebp photo.png✓ photo.png
Done: 1 succeeded, 0 failed
Avg saved: 34.2%
Convert a directory with custom output:
getwebp ./images -o ./dist/imagesHigh quality, skip already-converted files:
getwebp ./images -q 95 --skip-existingRecursive scan of subdirectories:
getwebp ./images -rParallel processing with 8 workers (Pro):
getwebp ./images --concurrency 8Preview what would be converted (no writes):
getwebp ./images --dry-runNDJSON output for CI/CD pipelines:
getwebp ./images --json{"@timestamp":"2026-04-12T10:00:00.000Z","@level":"info","@message":"GetWebP CLI 1.3.0","@module":"getwebp.cli","type":"version","data":{"getwebp":"1.3.0","ui":"1"}}
{"@timestamp":"2026-04-12T10:00:01.234Z","@level":"info","@message":"Converted 1/1 files","@module":"getwebp.convert","type":"convert.completed","data":{"processed":1,"total":1,"successCount":1,"failedCount":0,"results":[{"file":"photo.jpg","outputPath":"/abs/path/photo.webp","originalSize":204800,"newSize":133120,"savedRatio":0.35,"saved":"35.0%","quality":82,"qualityMode":"auto","status":"success"}]}}
See JSON Output for the full NDJSON schema.
Convert to AVIF:
getwebp ./images --format avif --quality 55Convert to AVIF with custom output directory:
getwebp ./images --format avif -o ./dist/avifUsing the -i flag instead of a positional argument:
getwebp -i ./src/images -o ./dist/imagesFree Plan Behavior#
When no license is activated:
- Maximum 20 files per run. Remaining files are reported as skipped.
- 3-second delay between each file.
--concurrencyis ignored (serial processing only).
NDJSON output on Free plan when the file limit is reached emits a convert.truncated event. See JSON Output for the full schema.
getwebp auth#
Activate a license key to unlock Pro features. Binds the license to the current device.
Synopsis#
getwebp auth <license-key>
Flags#
| Flag | Alias | Description | Default | Tier |
|---|---|---|---|---|
<license-key> (required) | -- | License key to activate | -- | -- |
--json | -- | JSON output | off | All |
Examples#
Activate a license:
getwebp auth XXXX-XXXX-XXXX-XXXXVerifying license...
✓ Activated! Pro plan unlocked.
Activate with JSON output:
getwebp auth XXXX-XXXX-XXXX-XXXX --json{
"success": true,
"data": {
"message": "Activated — Pro plan unlocked"
}
}Failed activation (JSON):
{
"success": false,
"status": "error",
"error": "unknown_error",
"message": "Invalid license key"
}Purchase a license at getwebp.com/pricing.
getwebp status#
Display current license info, plan tier, expiry date, and device usage.
Synopsis#
getwebp status
Flags#
| Flag | Alias | Description | Default | Tier |
|---|---|---|---|---|
--json | -- | JSON output | off | All |
Examples#
Free plan (no license activated):
getwebp statusVersion : 1.0.1
Mode : Free
Pro plan:
getwebp statusVersion : 1.0.1
Mode : Pro
License : xxxx-xxxx-xxxx-A1B2
Expires : 2027-04-01
Devices : 1 / 5 used
JSON output:
getwebp status --json{
"success": true,
"data": {
"version": "1.0.1",
"mode": "pro",
"licenseKeySuffix": "A1B2",
"expiresAt": "2027-04-01T00:00:00.000Z",
"devicesUsed": 1,
"devicesLimit": 5
}
}Free plan (JSON):
{
"success": true,
"data": {
"version": "1.0.1",
"mode": "free"
}
}Cached status (offline, network unreachable):
When the API is unreachable but a cached JWT exists, status is returned from local cache:
{
"success": true,
"data": {
"version": "1.0.1",
"mode": "pro",
"cached": true,
"expiresAt": "2027-04-01T00:00:00.000Z"
}
}getwebp logout#
Unbind the license from this device, freeing a device slot. Requires network access.
Synopsis#
getwebp logout [options]
Flags#
| Flag | Alias | Description | Default | Tier |
|---|---|---|---|---|
--force | -f | Skip the interactive confirmation prompt | off | All |
--json | -- | JSON output | off | All |
Note: In scripts and CI environments, use --force to skip the interactive confirmation prompt. When using --json, the confirmation prompt is also automatically skipped.
Examples#
Interactive logout:
getwebp logout? Confirm unbind license from this device? This cannot be undone. (y/N) y
✓ Successfully unbound. This device is now on the Free plan.
Skip confirmation (CI-safe):
getwebp logout --forceJSON output:
getwebp logout --force --json{
"success": true,
"data": {
"message": "Device unbound. Switched to Free plan."
}
}Failed logout (JSON):
{
"success": false,
"status": "error",
"error": "network_unreachable",
"message": "Cannot reach server. Retry later or unbind via dashboard."
}Exit Codes#
| Code | Meaning |
|---|---|
0 | All files processed successfully |
1 | General / partial failure |
2 | Usage error (bad flag, missing input) |
3 | License / auth error |
4 | Network error |
See Exit Codes for detailed descriptions and retry guidance.
JSON Error Codes#
When --json is enabled, errors include a machine-readable error field:
| Code | Meaning | Retryable |
|---|---|---|
missing_input | No input path specified | No |
usage_error | Bad flag value (e.g. unknown --format) | No |
network_unreachable | Cannot reach API server | Yes |
not_activated | No active license on device | No |
device_not_found | Device already unbound | No |
invalid_token | Token expired or revoked | No |
unknown_error | Unclassified error | Yes |
See JSON Output for the full output schema.
Tier Comparison#
| Feature | Free | Pro |
|---|---|---|
| Files per run | 20 | Unlimited |
| Processing speed | 3s delay per file | Instant |
| Parallel workers | 1 (serial) | Auto (CPU cores - 1) |
Custom --concurrency | -- | Up to 32 |
--recursive | Yes | Yes |
Custom --quality | Yes | Yes |
--format webp / avif | Yes | Yes |
--json NDJSON output | Yes | Yes |
--dry-run / --skip-existing | Yes | Yes |
Upgrade at getwebp.com/pricing.