Command-Line
The Circuit Diagram command-line is an open source application for performing operations on circuits and components. It can be used standalone, or with the Visual Studio Code extension for buliding custom components.
See the usage section below for the commands that can be run using the CLI.
Setup
Download the command-line application for your platform from the downloads page. Once you have done this, follow the additional instructions for your platform below.
Windows
Extract the contents of the .zip
file.
MacOS
Extract the contents of the .zip
file.
Ubuntu
- Extract the contents of the
.tar.xz
file - Ensure you have
libfontconfig1
installed:
apt-get install libfontconfig1
Usage
For full usage information, run circuit-diagram-cli --help
.
Render a Circuit
Rendering a CDDX circuit requires a copy of the components used in that circuit to be available. Download any components that you need (or all of the components) and place them in a local directory.
The following command renders a CDDX circuit as a PNG image.
circuit-diagram-cli circuit --components path/to/components/directory -o render.png circuit.cddx
The dimensions of the rendered image are determined by the dimensions of the input circuit.
Render a Component
The following command renders an XML component as a PNG image.
circuit-diagram-cli component my_component.xml -o my_component.png
Replace -o my_component.png
with -o my_component.svg
to render an SVG file instead.
The component
command has many other options available. Run circuit-diagram-cli component --help
to see them.