# 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. **Source:** https://vectosolve.com/blog/vectosolve-cli-convert-images-to-svg-command-line **Author:** Robin Monteiro (Founder of VectoSolve) **Published:** 2026-03-16 **Category:** Tutorial **Reading time:** 6 min read **Tags:** cli, command-line, svg, convert, npm, developer-tools --- ## 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](https://vectosolve.com/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. ## 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 Logo 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: | Flag | Description | Example | |------|-------------|--------| | `-s, --style` | Logo style (vector_illustration, icon, line_art...) | `-s icon` | | `-m, --model` | AI model (recraftv3, recraftv2) | `-m recraftv3` | | `-c, --colors` | Brand colors as comma-separated hex values | `-c "#0090ff,#1cb721"` | | `-n, --num` | Number of variants (1, 2, or 4) | `-n 4` | | `-o, --output` | Output 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: | Command | Cost 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](https://vectosolve.com/pricing). ## What's Next The VectoSolve CLI is one piece of a growing developer ecosystem: - **[@vectosolve/sdk](https://www.npmjs.com/package/@vectosolve/sdk)** — JavaScript/TypeScript SDK for programmatic access to all VectoSolve APIs. Ideal for building custom integrations. - **[@vectosolve/mcp](https://www.npmjs.com/package/@vectosolve/mcp)** — MCP server that lets AI assistants like Claude use VectoSolve tools directly through natural language. - **[Developer Hub](https://vectosolve.com/developers)** — Full API documentation, authentication guides, and code examples. - **[Pricing & Plans](https://vectosolve.com/pricing)** — Compare the monthly and annual tiers. Install the CLI today and start converting images from your terminal: ```bash npm install -g vectosolve ``` --- *Maintained by VectoSolve. When citing, link to https://vectosolve.com/blog/vectosolve-cli-convert-images-to-svg-command-line.* *VectoSolve — AI-powered SVG platform: image-to-vector conversion, AI animation, brand identity generation, and more. https://vectosolve.com*