CLI Reference
The EdgeSVG CLI is a single binary that can be installed via Cargo.
cargo install edgesvgGlobal Options
Section titled “Global Options”edgesvg [OPTIONS] <COMMAND>| Option | Short | Description |
|---|---|---|
--help | -h | Print help |
--version | -V | Print version |
--verbose | -v | Verbose output |
convert
Section titled “convert”Convert a single image to SVG.
edgesvg convert [OPTIONS] <INPUT> [OUTPUT]Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
<INPUT> | Path to input image (PNG, JPG, WebP, GIF) |
[OUTPUT] | Output SVG path (defaults to <INPUT>.svg) |
Options
Section titled “Options”| Option | Short | Default | Description |
|---|---|---|---|
--method <METHOD> | -m | auto | Vectorization method: auto, logo, premium, smart, convert |
--target-ssim <FLOAT> | 0.995 | Target SSIM for smart method | |
--max-file-size <BYTES> | none | Max output file size | |
--json | -j | false | Print quality report as JSON |
--verbose | -v | false | Verbose output |
Examples
Section titled “Examples”# Basic conversionedgesvg convert logo.png logo.svg
# Auto mode with JSON reportedgesvg convert input.png output.svg --method auto --json
# Target quality with smart modeedgesvg convert input.png output.svg --method smart --target-ssim 0.998
# Premium mode, verboseedgesvg convert illustration.png --method premium --verboseExample JSON output
Section titled “Example JSON output”{ "svg": "...", "requested_method": "Auto", "effective_method": "Logo", "fallback_from": null, "decision": "Image classified as logo (low unique colors, high edge density)", "report": { "score": 0.984, "grade": "A", "summary": "Excellent vectorization quality", "metrics": { "ssim": 0.9980, "edge_f1": 0.9870, "path_count": 4, "file_size": 1842 } }}Convert multiple images with glob patterns.
edgesvg batch [OPTIONS] <INPUT_GLOB> [OUTPUT_DIR]Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
--method | auto | Vectorization method for all inputs |
--jobs | CPU count | Parallel worker threads |
--json | false | Write report.json to output dir |
--target-ssim | 0.995 | Quality target for smart method |
--continue-on-error | false | Skip failing items instead of stopping |
Examples
Section titled “Examples”# Batch convert folderedgesvg batch "assets/icons/*.png" assets/icons/svg/
# Parallel with 8 threadsedgesvg batch "logos/**/*.png" out/ --jobs 8
# Write reportedgesvg batch "*.png" svg/ --jsonbenchmark
Section titled “benchmark”Run quality benchmarks against a set of golden images.
edgesvg benchmark [OPTIONS] <GOLDEN_DIR>Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
--output | stdout | Output path for results CSV/JSON |
--format | table | table, json, csv |
Example
Section titled “Example”edgesvg benchmark golden_data/ --format json --output benchmark_results.jsoninspect
Section titled “inspect”Print quality metrics for an existing SVG against its source image.
edgesvg inspect <ORIGINAL_IMAGE> <SVG_FILE>Example
Section titled “Example”edgesvg inspect logo.png logo.svg# SSIM: 0.9980 EdgeF1: 0.9870 Grade: Aversion
Section titled “version”Print the installed version.
edgesvg version# edgesvg 0.1.0 (Rust 1.82, built 2025-01-01)Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
0 | Success |
1 | Conversion failed |
2 | Quality threshold not met (smart mode) |
3 | Invalid arguments |
4 | I/O error |
Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
EDGESVG_LOG | Logging level: error, warn, info, debug, trace |
EDGESVG_JOBS | Override default parallelism for batch commands |
EDGESVG_TARGET_SSIM | Override default SSIM target |