SVGER-CLI logo SVGER-CLI Commands and live evidence for v4.0.9

Runtime checked against source v4.0.9

Node v24.18.0

npm 11.16.0

Complete commands, system capabilities, and live runtime proof.

This page documents the actual CLI surface, supported frameworks, integrations, safety controls, configuration features, package behavior, and live validation evidence for SVGER-CLI v4.0.9. It is intentionally more factual than marketing: performance and accuracy statements are tied to commands, tests, and measured outputs.

Installation and executable names

Install

npm install --save-dev svger-cli

Executables

The package exposes these binaries:

svger svger-cli test-svger

npx svger --version
npx svger --help
npx svger build --help
npx svger generate --help
npx svger optimize --help

Complete command reference

Commands below are taken from the current CLI help and source. Deprecated aliases are listed so migrations remain explicit, but new docs should teach positional arguments and current command names.

CommandUse it forSyntax and options
build Build every discovered SVG in a source directory into generated components. svger build <src> <out>
Options: --framework, --typescript, --no-typescript, --composition, --standalone, --signals, --optimize, --validate, --plugin, --list-plugins, --unsafe-input-policy, --max-input-size, --recursive, --include, --exclude, --hidden, --symlinks, --max-file-count, --collision, --concurrency, --batch-size, --dry-run, --check, --diff, --format. Deprecated aliases: --src, --out, --naming.
generate Generate one component from one SVG file. svger generate <svgFile> <out>
Options: --framework, --typescript, --no-typescript, --composition, --standalone, --optimize, --unsafe-input-policy, --max-input-size.
watch Watch a source directory and rebuild after SVG changes. svger watch <src> <out>
Options: --unsafe-input-policy, --max-input-size. Deprecated compatibility options: --src, --out, --watch.
optimize Optimize SVG files without generating components. svger optimize <inputDir> [outputDir]
Options: --level, --validate, --in-place, --unsafe-input-policy, --max-input-size. Current runtime behavior is directory-oriented; see the known limitation section.
config Create, show, update, and explain resolved configuration. svger config [action] [path]
Options: --init, --set key=value, --show, --explain, --format pretty|json.
plugins List plugin registrations and load plugin names or paths. svger plugins --load optimize,minify
lock Lock one or more SVG files before workflows that must not overwrite them. svger lock ./icons/logo.svg ./icons/menu.svg
unlock Unlock one or more previously locked SVG files. svger unlock ./icons/logo.svg ./icons/menu.svg
clean Remove generated component output from the target directory. svger clean <out>. Deprecated alias: --out.
recover Inspect and roll back incomplete output transactions. svger recover <directory> --format pretty|json
migrate Migrate v4 config, imports, or plugin declarations. svger migrate <target> [path]
Options: --dry-run, --no-backup, --format json.

Common instructions and recipes

React TypeScript icon folder

npx svger build ./src/icons ./src/components/icons \
  --framework react \
  --typescript \
  --recursive \
  --optimize balanced

Vue Composition API component

npx svger generate ./src/icons/logo.svg ./src/components/icons \
  --framework vue \
  --typescript \
  --composition

Angular standalone output

npx svger build ./icons ./angular-icons \
  --framework angular \
  --standalone \
  --signals

Safe optimizer directory run

npx svger optimize ./icons ./optimized-icons --level maximum

Reject unsafe SVG by default

npx svger generate ./unsafe.svg ./components --framework react

Explicit strip mode

npx svger generate ./unsafe.svg ./components \
  --framework react \
  --unsafe-input-policy strip

Dry-run/check mode

npx svger build ./icons ./components --dry-run --format json
npx svger build ./icons ./components --check --diff

Configuration explanation

npx svger config --init
npx svger config --set framework=react
npx svger config --explain --format json

System capabilities

Framework targets

React, React Native, Vue, Angular, Svelte, Solid, Preact, Lit, and vanilla output. Runtime framework validation generated 11 representative component variants.

Build integrations

Webpack, Vite, Rollup, Babel, Next.js, and Jest exports are available and verified by integration construction tests.

Optimization

Optimization levels: none, basic, balanced, aggressive, and maximum. The standalone optimizer command currently operates on directories.

Safety

Reject-by-default unsafe SVG containment, explicit strip mode, input-size limits, and artifact-path sandboxing across CLI and integration entry points.

Reproducibility

Phase 1 evidence covers deterministic planning, build reports, atomic writes, recovery, cache contracts, migration contracts, and traceability.

Programmatic API

Root exports include processors, compiler factories, commands, reports, diagnostics, services, cache helpers, and integration factories with TypeScript declarations.

Framework output evidence

Framework test pathGenerated fileStatus
ReactTestIcon-react.tsxPass
React NativeTestIcon-react-native.tsxPass
Vue Composition APITestIcon-vue-composition.vuePass
Vue Options APITestIcon-vue-options.vuePass
SvelteTestIcon-svelte.sveltePass
Angular standaloneTestIcon-angular-standalone.component.tsPass
Angular moduleTestIcon-angular-module.component.tsPass
SolidTestIcon-solid.tsxPass
PreactTestIcon-preact.tsxPass
LitTestIcon-lit.tsPass
VanillaTestIcon-vanilla.tsPass

Integration export evidence

IntegrationExport pathVerified capability
Webpacksvger-cli/webpackPlugin instance and loader function available.
Vitesvger-cli/vitePlugin created with name svger-vite-plugin.
Rollupsvger-cli/rollupPlugin created with name svger-rollup-plugin.
Babelsvger-cli/babelPlugin and factory function available.
Next.jssvger-cli/nextjswithSvger wrapper and standalone plugin available.
Jestsvger-cli/jestTransformer and preset config available.
Main exportssvger-cliIntegration factories are exposed from the root package.

Live runtime evidence

These checks were executed locally after rebuilding the CLI from source. They prove the documented commands operate in a real runtime environment.

Smoke

15/15 runtime assertions passed.

Frameworks

11/11 framework component outputs generated.

Integrations

7/7 integration export checks passed.

Evidence itemRuntime command or suiteResult
Version identitynpx svger --versionReturned 4.0.9.
Help discoverynpx svger --help and command help screensAll command groups and help screens available.
Safe single generatenpx svger generate ./icons/safe.svg ./components --framework react --typescriptGenerated Safe.tsx.
Safe directory buildnpx svger build ./icons ./build-components --framework vue --typescript --optimize balancedGenerated Safe.vue.
Unsafe rejection<script>, on*, and javascript: SVG inputsRejected with nonzero exits.
Explicit strip policy--unsafe-input-policy stripGenerated output and emitted a security warning.
Input-size limit--max-input-size 256Oversized input rejected.
Optimizernpx svger optimize ./icons ./optimized --level maximumOptimized directory output and reduced smoke sample size by 12.72%.
Optimizer unsafe exitnpx svger optimize ./unsafe-icons ./optimized-unsafeExited nonzero for unsafe input.
Programmatic APIESM import of SVGProcessor and createSVGCompilerImport succeeded.

Accuracy and quality proof

Accuracy is documented as test-backed behavior: generated components are syntactically valid for the target frameworks, configuration and E2E workflows pass, unsafe input is rejected, and API/integration contracts remain importable.

Validation commandResultCapability proven
npm run typecheckPassTypeScript source type integrity.
npm run lint:budgetPass0 errors; warning count remains at approved 14/14 baseline.
npm run testPassFrameworks, configuration, E2E flows, integrations.
npm run test:securityPass27 containment assertions.
npm run test:safety-matrixPassReject, strip, and sandbox behavior across entry points.
npm run test:phase1:smokePassReport, application service, and transaction recovery contracts.

Efficiency and benchmark evidence

Efficiency claims on this site are limited to measured data. The local optimizer benchmark was run with node scripts/benchmark-comprehensive.js after the production build.

Optimization levelAverage size reductionAverage processing timeAverage memory
BASIC6.26%0.51ms47.69KB
BALANCED7.76%1.46ms158.67KB
AGGRESSIVE6.86%5.07ms110.52KB
MAXIMUM11.75%3.22ms346.21KB

The benchmark script's visual column is not treated as authoritative proof because the script falls back to zero if optional visual comparison fails. Use the visual validation test commands in the repository when optional visual dependencies are installed.

Known limitations and governance status

AreaStatusDocumentation position
npm release Pending Source is v4.0.9; npm publication and independent registry verification still need to close the official gate.
Single-file optimize Known current behavior Runtime evidence shows svger optimize ./file.svg ./out exits with ENOTDIR. Use directory input/output until this is fixed or officially reclassified.
Phase 2 parser implementation Blocked P2-201 ADR work is permitted; production parser adapter work remains blocked by governance gates.
Compatibility ledger rows Approval-gated Rows must be approved before dependent behavior changes are merged or declared canonical.