SVGO
$ svgo Community Low RiskSVGO (svgo) strips redundant XML metadata, comments, hidden elements, and path precision from SVG files using a configurable plugin pipeline (svgo.config.mjs). It supports single-file (-o), directory (-rf), string (-s), and stdout (-o -) modes with --quiet and --no-color.
brew install svgo Optimizing SVG icons locally with svgo and inspecting diffs via -o - requires zero MCP round-trips.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive CLI with -o - stdout preview, --quiet, --no-color, and --show-plugins introspection, though lacks JSON output and --dry-run.
- Supports
-o -,-q/--quiet,--no-color, and--show-plugins - No JSON summary or
--dry-run
Easy non-destructive -o - / -o <out> usage, though omitting -o mutates files in-place and aggressive plugins can alter SVG IDs used by CSS/JS.
- Overwrites input SVG in-place when
-ois omitted
Available via Homebrew, global npm, or zero-install npx svgo across all platforms.
- Available via
brew install svgo,npm, andnpx
De-facto standard SVG optimizer supporting recursive folders (-rf), --multipass, and --pretty formatting.
- Handles single files, stdin, strings, and recursive directories
Actively maintained MIT project (svg/svgo) used across major frontend toolchains.
- Official
svg/svgoGitHub repository under MIT
Clean svgo.dev documentation and svgo --help / --show-plugins introspection.
- Official documentation at svgo.dev
Security, Auth & Guardrails
None required; reads optional local svgo.config.mjs project config.
Free MIT open-source Node.js CLI.
# SVGO Agent Rules - Pass `-o <output>` (or `-o -` for stdout preview) because omitting `-o` overwrites the input SVG in place. - Check `viewBox` preservation (`removeViewBox` is disabled in modern `preset-default`, but verify custom `svgo.config.mjs` files).
Agent-Ready Command Recipes
Safe Read-Only Queries
svgo -q -i icon.svg -o -
Runs the optimization pipeline and prints minified SVG XML to stdout (-o -) without altering icon.svg.
svgo --show-plugins
Enumerates built-in SVGO plugin names for composing a deterministic svgo.config.mjs.
Controlled Writes & Previews
svgo -rf src/icons -o dist/icons --multipass
Recursively minifies SVGs from src/icons into dist/icons using multi-pass optimization.
Strengths for Agents
- +
svgo -q -i file.svg -o -previews exact minified SVG output on stdout without writing disk. - +
--show-pluginsmakes plugin capabilities directly discoverable by agents.
Caveats & Pitfalls
- ! Omitting
-ooverwrites input files in place. - ! Default ID minification (
cleanupIds) can break inline SVGs referenced by external CSS orusetags.