Skip to content
WireVizDocsOpen editor
Library v0.4.1

WireViz command-line installation and exports

Run WireViz 0.4.1 locally, choose output formats, prepend reusable YAML, manage output paths, and understand native CLI limitations.

The native wireviz command reads YAML files and produces diagrams and bills of materials on your computer. It is useful for version-controlled harnesses and repeatable build scripts. These commands refer specifically to WireViz 0.4.1 and its pinned CLI implementation.

Install the pinned library

Use an isolated Python environment and install the exact release:

python -m venv .venv
source .venv/bin/activate
python -m pip install "wireviz==0.4.1"
wireviz --version

On Windows, activate the environment with the command appropriate to your shell, such as .venv\Scripts\Activate.ps1 in PowerShell. WireViz's Python dependencies include PyYAML, Click, Pillow, and the Python Graphviz package. Native rendering also requires the Graphviz executable, installed separately for your operating system and available on PATH.

dot -V
wireviz --help

The upstream 0.4.1 project documents Python 3.7 or later; that is the release's declared requirement, not a promise that every future Python/dependency combination is tested. The browser editor already supplies its own runtime, so native installation is unnecessary for browser use. Pinned installation documentation.

Render a file

Save a complete example as harness.yml, then run:

wireviz harness.yml

The default format selection is hpst: HTML, PNG, SVG, and TSV. Output files normally use the input file's directory and basename:

File Contents
harness.html Native HTML template with the diagram and BOM.
harness.png Raster diagram.
harness.svg Vector diagram with embedded image assets.
harness.bom.tsv Tab-separated BOM table.

Start from the simple harness or the complete YAML in the overview.

Complete CLI options

Option Meaning
FILE... One or more input file paths.
-f, --format Nonempty string of output-format letters; default hpst.
-p, --prepend YAML file to prepend; may be supplied repeatedly.
-o, --output-dir Output directory; defaults to the input file's directory.
-O, --output-name Output basename without extension; defaults to the input filename stem.
-V, --version Print the library version and exit.
-h, --help Show command help.

-p is prepend, while the letter p inside -f means PNG. The case difference between -o and -O is significant.

Output-format letters

Letter Format
g Graphviz source, .gv.
h HTML, .html.
p PNG, .png.
s SVG, .svg.
t BOM TSV, .bom.tsv.
wireviz -f st harness.yml
wireviz -f gst harness.yml

The second command also exports Graphviz source for inspection. CSV and PDF are not implemented outputs in 0.4.1: their CLI format letters are disabled. Some Python docstrings mention them, but the output implementation only prints that they are unsupported. A PDF created by printing HTML or an application-specific CSV export is a separate workflow. Native output implementation.

Output paths and batches

mkdir -p build
wireviz -f hst -o build -O sensor-rev-a harness.yml
wireviz -f st sensor.yml power.yml

Create the output directory explicitly, especially for exports that only write text files. Existing outputs with the same names can be replaced. When processing multiple inputs, a shared --output-name can make them target the same filenames; keep their default basenames or run separate commands.

Shell globbing can be convenient, for example wireviz *.yml, but expansion depends on your shell. The CLI accepts multiple file arguments; it does not implement a separate cross-platform glob engine.

Prepend reusable YAML text

wireviz -p shared.yml -p project.yml harness.yml

Prepend files are read in the supplied order, separated with newlines, then concatenated with each input file. This can place anchor definitions before their uses. It is text concatenation, not a deep merge or a general include directive. Repeating top-level connectors mappings can cause later data to replace earlier data under PyYAML's duplicate-key behavior. Structure the combined result as one valid YAML mapping and use anchors and merges deliberately.

The CLI includes the input directory and prepend-file directories when resolving component images. If files share the same relative asset name in different directories, use unique paths rather than relying on search order. Native custom HTML template lookup follows the output directory, as described in options and metadata.

Build integration

Pin the library version, preserve YAML and source images together, and make generated outputs a reproducible build step. A useful check is to run the same CLI command used for delivery and inspect warnings as well as failures. WireViz validation concerns its input and rendering model; it does not replace engineering review of the harness specification. For in-process integration, use the Python API.