Skip to content
Tutorial

VectoSolve CLI: Convert Images to SVG From the Command Line

Install the VectoSolve CLI to convert images to SVG, remove backgrounds, upscale, and generate logos directly from your terminal. Perfect for batch processing, CI/CD pipelines, and shell scripting.

Robin MonteiroMarch 16, 20266 min read
Use this article with an AI assistant:
.md
VectoSolve CLI: Convert Images to SVG From the Command Line
R
Robin Monteiro

Founder of VectoSolve

Self-taught developer, founder and sole developer of VectoSolve since 2024. He builds the conversion engine and the cutting, embroidery and 3D printing exports.

How this article was made: drafted with AI assistance, then edited and fact-checked before publication. About the author

Image vectorizationCutting machine filesEmbroidery filesSVG
Free previewNo signupFull-quality output

Try it on your own file

Free preview, no signup. Drop an image and see the vector before deciding anything.

Why Use a CLI for Image Conversion?

If you've ever needed to convert a batch of PNGs to SVG, strip backgrounds from product photos, or generate logos as part of an automated pipeline, clicking through a web UI isn't going to cut it. That's exactly why we built the VectoSolve CLI — a command-line tool that brings the full power of VectoSolve's AI conversion engine to your terminal.

The CLI is built for developers, designers, and anyone who prefers keyboard over mouse. It's ideal for:

  • Batch processing — convert entire folders of images in a single command
  • CI/CD pipelines — automate asset conversion as part of your build process
  • Shell scripting — chain VectoSolve with other tools using pipes and loops
  • Quick one-off conversions — skip the browser entirely

Installation

The VectoSolve CLI is distributed as an npm package. Install it globally to make the vectosolve command available everywhere:

bash
npm install -g vectosolve

If you prefer not to install globally, you can run it on-demand with npx:

bash
npx vectosolve convert photo.png

Verify the installation by checking the version:

bash
vectosolve --version

Setup & Authentication

Before you can use the CLI, you need to authenticate with your VectoSolve API key. You can generate one from your dashboard under the API Keys section.

Option 1: Auth Command

Run the auth command with your key:

bash
vectosolve auth --key vs_live_xxxxxxxxxxxxxxxx

This stores your key locally in ~/.vectosolve/config.json so you don't need to enter it again.

Option 2: Environment Variable

Set the VECTOSOLVE_API_KEY environment variable. This is the recommended approach for CI/CD environments:

bash
# Linux / macOS
export VECTOSOLVE_API_KEY=vs_live_xxxxxxxxxxxxxxxx

# Windows (PowerShell)
$env:VECTOSOLVE_API_KEY = "vs_live_xxxxxxxxxxxxxxxx"

The environment variable takes precedence over the stored config, making it easy to switch between keys for different projects.

A Full Year of Conversions for $49

Starter Annual: 25 conversions every month, $49 for the whole year. That is about $4.08 a month · Cancel anytime

Get the Annual Deal

Commands

Convert Image to SVG

The convert command transforms raster images (PNG, JPG, WebP) into clean, scalable SVG files using VectoSolve's AI vectorization engine.

bash
# Convert a local file
vectosolve convert logo.png

# Specify output path
vectosolve convert photo.jpg -o output/photo.svg

# Convert from a URL
vectosolve convert --url https://example.com/image.png

By default, the output SVG is saved in the current directory with the same filename. The AI handles color detection, edge tracing, and shape optimization automatically.

Remove Background

Strip the background from any image with a single command. Perfect for product photos, headshots, and assets that need transparency.

bash
# Remove background, print result URL
vectosolve remove-bg product-photo.jpg

# Save to file
vectosolve remove-bg headshot.png -o headshot-nobg.png

Upscale Image

Upscale low-resolution images using AI super-resolution. The result is a crisp, artifact-free image — not a blurry resize.

bash
# Upscale with output path
vectosolve upscale thumbnail.jpg -o thumbnail-hires.png

Generate AI-powered SVG logos directly from the command line.

bash
# Basic logo generation
vectosolve logo "Mountain hiking brand"

# Full control with all flags
vectosolve logo "Minimalist coffee shop" \
  -s icon \
  -c "#2D1B0E,#F5E6D3" \
  -n 4 \
  -o ./logos/

Available flags:

FlagDescriptionExample
-s, --styleLogo style (vector_illustration, icon, line_art...)-s icon
-m, --modelAI model (recraftv3, recraftv2)-m recraftv3
-c, --colorsBrand colors as comma-separated hex values-c "#0090ff,#1cb721"
-n, --numNumber of variants (1, 2, or 4)-n 4
-o, --outputOutput directory for SVG files-o ./logos/

Real-World Use Cases

Batch Convert a Folder of PNGs

Use a simple shell loop to convert every PNG in a directory to SVG:

bash
# Convert all PNGs in the current folder
for file in *.png; do
  vectosolve convert "$file" -o "svg/${file%.png}.svg"
done

For larger batches, you can parallelize with xargs:

bash
ls *.png | xargs -P 4 -I {} vectosolve convert {} -o svg/{}.svg

This runs up to 4 conversions in parallel, significantly reducing total processing time.

CI/CD Pipeline Integration

Add VectoSolve to your build pipeline to automatically vectorize assets on every deploy. Here's a GitHub Actions example:

yaml
# .github/workflows/build.yml
- name: Convert assets to SVG
  env:
    VECTOSOLVE_API_KEY: ${{ secrets.VECTOSOLVE_API_KEY }}
  run: |
    npx vectosolve convert assets/logo.png -o public/logo.svg
    npx vectosolve convert assets/icon.png -o public/icon.svg

This ensures your production SVGs are always generated from the latest source images.

Design Workflow Automation

Combine the CLI with file watchers to create a live conversion pipeline:

bash
# Using fswatch (macOS) or inotifywait (Linux)
fswatch -0 ~/design-assets/*.png | while read -d "" file; do
  vectosolve convert "$file" -o "${file%.png}.svg"
  echo "Converted: $file"
done

Designers work in their preferred format, developers get production-ready SVGs without asking.

Pricing

The CLI uses the same credit-based pricing as the VectoSolve web app and API:

CommandCost per Use
vectosolve convert$0.20
vectosolve remove-bg$0.07
vectosolve upscale$0.15
vectosolve logo$0.25+

Credits are shared across all VectoSolve products — web app, API, CLI, browser extensions, and the embeddable widget. Subscribe on the pricing page.

Free SVG Tools for Crafters

Design Checker · Color Separator · Mat Preview · Offset Generator · Text to SVG

Check Your SVG Free

What's Next

The VectoSolve CLI is one piece of a growing developer ecosystem:

  • @vectosolve/sdk — JavaScript/TypeScript SDK for programmatic access to all VectoSolve APIs. Ideal for building custom integrations.
  • @vectosolve/mcp — MCP server that lets AI assistants like Claude use VectoSolve tools directly through natural language.
  • Developer Hub — Full API documentation, authentication guides, and code examples.
  • Pricing & Plans — Compare the monthly and annual tiers.

Install the CLI today and start converting images from your terminal:

bash
npm install -g vectosolve
Tags:
cli
command-line
svg
convert
npm
developer-tools
Share:

Try Vectosolve Now

Convert your images to high-quality SVG vectors with AI

AI-Powered Vectorization

Ready to vectorize your images?

Convert your PNG, JPG, and other images to high-quality, scalable SVG vectors in seconds.