home / dev-tools / svgo

SVGO

22k

SVG optimization CLI for removing editor metadata, simplifying markup, and applying configurable cleanup plugins.

$npm install -g svgo
Language
JavaScript
Stars
22,359
Category
Dev Tools
Agent
AI Analysis

SVGO is a CLI and library for optimizing SVG files by removing editor cruft, simplifying markup, and applying configurable transformation plugins. It fits asset pipelines and repository cleanup work where you need smaller or more normalized SVG output before shipping files.

What It Enables
  • Optimize a single SVG, a whole folder tree, stdin input, or an inline SVG string, then write the result to files, folders, or stdout.
  • Apply project-specific cleanup rules through svgo.config.*, including default-preset overrides and custom plugins.
  • Normalize exported SVG assets for web delivery, design-system repos, or build steps before committing, bundling, or publishing them.
Agent Fit
  • Non-interactive flags, stdin/stdout support, and recursive folder mode make it easy to slot into scripts, CI, or agent-driven asset cleanup loops.
  • There is no JSON or structured report mode; the machine-readable result is the optimized SVG itself, while status output stays human-oriented.
  • Best for explicit local transformations where the target files and desired plugin config are already known.
Caveats
  • If you omit -o, the CLI rewrites the input files in place.
  • Optimization behavior depends on plugin choices, so preserving IDs, viewBox, or editor-specific data may require config changes.