CLI usage

The wire command is a thin wrapper around the Wire Lang parser, compiler, and SVG renderer. It exists for developer and AI-agent feedback loops: validate a .wire file, render it to SVG, or re-render on change. It ships with the wire-lang npm package and needs Node.js 20+.

Run it through npx without installing, or install wire-lang and call wire directly. There is no preview server — you view results by opening the generated SVG file.

wire check — validate

wire check reports parse, reference, validation, and render-blocking diagnostics without producing any SVG output. Use it in CI or before committing a schematic.

wire check examples/led.wire
npx wire check examples/led.wire

wire render — produce SVG

wire render writes a standalone SVG file when rendering can complete, and reports structured diagnostics when it cannot. Pass the output path with --out.

wire render examples/led.wire --out led.svg
npx wire render examples/led.wire --out led.svg

wire watch — re-render on change

wire watch reruns checking and rendering whenever the input file changes — useful while iterating on a diagram.

wire watch examples/led.wire --out led.svg

JSON output for agents and scripts

Add --json to check or render for machine-readable diagnostics. JSON output includes stable diagnostic codes, severity, message, source range, and suggested fixes when available — everything an AI agent needs to self-correct.

wire check examples/led.wire --json
wire render examples/led.wire --out led.svg --json

Exit codes

The CLI uses predictable exit codes so it composes well in scripts and pipelines:

CodeMeaning
0Completed successfully; warnings may be present.
1Source has fatal diagnostics, or rendering could not complete.
2CLI usage, file I/O, or configuration problem.