0% found this document useful (0 votes)
15 views

cli

The document provides an overview of the KiCad Command-Line Interface, detailing various commands related to footprints, jobsets, PCBs, and schematics. It includes information on exporting files in multiple formats, such as Gerber, DXF, and PDF. The content is organized into sections that cover specific functionalities and commands available within the interface.

Uploaded by

sdrfgfgttdfg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

cli

The document provides an overview of the KiCad Command-Line Interface, detailing various commands related to footprints, jobsets, PCBs, and schematics. It includes information on exporting files in multiple formats, such as Gerber, DXF, and PDF. The content is organized into sections that cover specific functionalities and commands available within the interface.

Uploaded by

sdrfgfgttdfg
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

KiCad Command-Line Interface

The KiCad Team


Table of Contents
. . . . . . . . . . . . . . .to
Introduction . . .the
. . . .KiCad
. . . . . . . Command-Line
. . . . . . . . . . . . . . . . . .Interface
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.
. . . . . . . . . . . commands
Footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.
. . . . . . . . . . . export
Footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.
. . . . . . . . . . . upgrade
Footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.
. . . . . . . .commands
Jobset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.
. . . . . commands
PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.
. . . . . DRC
PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.
. . . . . BREP
PCB . . . . . . .(OCCT)
. . . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.
. . . . . drill
PCB . . . . . .file
. . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.
. . . . . DXF
PCB . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.
. . . . . GenCAD
PCB . . . . . . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
...
. . . . . Gerber
PCB . . . . . . . . .export:
. . . . . . . . one
. . . . . layer
. . . . . . per
. . . . .file
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
...
. . . . . Gerber
PCB . . . . . . . . .export:
. . . . . . . . multiple
. . . . . . . . . . layers
. . . . . . . .per
. . . . file
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
...
. . . . . GLB
PCB . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
...
. . . . . IPC-2581
PCB . . . . . . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
...
. . . . . IPC-D-356
PCB . . . . . . . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
...
. . . . . ODB++
PCB . . . . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
...
. . . . . PDF
PCB . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
...
. . . . . PLY
PCB . . . . .file
. . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
...
. . . . . position
PCB . . . . . . . . . .file
. . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
...
. . . . . STEP
PCB . . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
...
. . . . . STL
PCB . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
...
. . . . . SVG
PCB . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
...
. . . . . VRML
PCB . . . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
...
. . . . . XAO
PCB . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
...
. . . . . render
PCB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
...
. . . . . . . . . . . . .commands
Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
...
. . . . . . . . . . . . .ERC
Schematic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
...
. . . . . . . . . . . . .bill
Schematic . . . .of
. . .materials
. . . . . . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
...
. . . . . . . . . . . . .DXF
Schematic . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
...
. . . . . . . . . . . . .HPGL
Schematic . . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
...
. . . . . . . . . . . . .netlist
Schematic . . . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
...
. . . . . . . . . . . . .PDF
Schematic . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
...
. . . . . . . . . . . . .PostScript
Schematic . . . . . . . . . . . export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
...
. . . . . . . . . . . . .bill
Schematic . . . .of
. . .materials
. . . . . . . . . . .export
. . . . . . . .(legacy
. . . . . . . .BOM
. . . . . .scripts)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
...
. . . . . . . . . . . . .SVG
Schematic . . . . .export
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
...
. . . . . . . . . commands
Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
...
. . . . . . . . . export
Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
...
. . . . . . . . . upgrade
Symbol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
...
. . . . . . . . . commands
Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
...
Reference manual

Copyright

This document is Copyright © 2023-2024 by its contributors as listed below. You may distribute it and/or
modify it under the terms of either the GNU General Public License (http://www.gnu.org/licenses/gpl.html),
version 3 or later, or the Creative Commons Attribution License
(http://creativecommons.org/licenses/by/3.0/), version 3.0 or later.

All trademarks within this guide belong to their legitimate owners.

Contributors

Graham Keeth

Feedback

The KiCad project welcomes feedback, bug reports, and suggestions related to the software or its
documentation. For more information on how to submit feedback or report an issue, please see the
instructions at https://www.kicad.org/help/report-an-issue/

1
Introduction to the KiCad Command-Line
Interface
KiCad provides a command-line interface, which is available by running the kicad-cli binary. With the
command-line interface, you can perform a number of actions on schematics, PCBs, symbols, and footprints
in an automated fashion, such as plotting Gerber files from a PCB design or upgrading a symbol library from
a legacy file format to a modern format.

On macOS, the kicad-cli executable is located at


NOTE
/Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli .

The kicad-cli command has 6 subcommands: fp , jobset , pcb , sch , sym , and version . Each
subcommand may have its own subcommands and arguments. For example, to export Gerber files from a
PCB you could run kicad-cli pcb export gerbers example.kicad_pcb .

You can add the --help or -h flag to see information about each subcommand. For example, running
kicad-cli pcb -h prints usage information about the pcb subcommand, and kicad-cli pcb export
gerbers -h prints usage information specifically for the pcb export gerbers subcommand.

2
Footprint commands
The fp subcommand exports footprints to another format or upgrades the footprint libraries to the
current version of the KiCad footprint file format.

Footprint export
The fp export svg command exports one or more footprints from the specified library into SVG files.

Usage: kicad-cli fp export svg [--help] [--output OUTPUT_DIR] [--layers LAYER_LIST] [--define-var
KEY=VALUE] [--theme VAR] [--footprint FOOTPRINT_NAME] [--sketch-pads-on-fab-layers] [--hide-DNP-
footprints-on-fab-layers] [--sketch-DNP-footprints-on-fab-layers] [--crossout-DNP-footprints-
on-fab-layers] [--black-and-white] INPUT_DIR

Positional arguments:

INPUT_DIR Footprint library directory to export ( .pretty).

Optional arguments:

-h , --help Show help for the footprint SVG export command.

-o <output dir> , --output The output directory for the exported files. When this argument is not
<output dir> used, the files are exported to the current directory.

-l <layer list> , --layers A comma-separated list of layer names to export from the footprint,
<layer list> such as F.Cu,B.Cu. If no layers are given, all layers are exported.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the
<theme name> footprint editor’s currently selected theme is used.

--fp <footprint> , -- The name of the specific footprint to export from the library. When this
footprint <footprint> argument is not used, all footprints in the library are exported.

--sp , --sketch-pads-on- Draw pad outlines and their numbers on front and back fab layers.
fab-layers

--hdnp , --hide-DNP- Don’t plot text and graphics of DNP footprints on fab layers.
footprints-on-fab-layers

--sdnp , --sketch-DNP- Plot graphics of DNP footprints in sketch mode on fab layers.
footprints-on-fab-layers

--cdnp , --crossout-DNP- Plot an 'X' over the courtyard of DNP footprints on fab layers, and
footprints-on-fab-layers strikeout their reference designators.

--black-and-white Export footprints in black and white.

3
Footprint upgrade
The fp upgrade command converts the the specified footprint library from a legacy KiCad footprint format
or a non-KiCad footprint format to the native format for the current version of KiCad. If the input library is
already in the current file format, no action is taken.

Supported input footprint formats are:

KiCad footprint library ( .pretty folder with .kicad_mod files)

KiCad (pre-5.0) footprint library ( .mod , .emp )

Altium footprint library ( .PcbLib )

Altium integrated library ( .IntLib )

CADSTAR PCB archive ( .cpa )

EAGLE XML library ( .lbr )

EasyEDA (JLCEDA) Std file ( .json )

EasyEDA (JLCEDA) Pro file ( .elibz , .epro , .zip )

GEDA/PCB library (folder with .fp files)

Usage: kicad-cli fp upgrade [--help] [--output OUTPUT_DIR] [--force] INPUT_DIR

Positional arguments:

INPUT_DIR Footprint library directory to upgrade. For KiCad format footprint


libraries, this is the .pretty directory, not a .kicad_mod file.

Optional arguments:

-h , --help Show help for the footprint upgrade command.

-o <output dir> , --output The output directory for the upgraded footprints. When this argument is
<output dir> not used, the upgraded footprints are saved over the original footprints.

--force Re-save the input library even if it is already in the current file format.

4
Jobset commands
The jobset run command runs a predefined jobset.

Usage: kicad-cli jobset run [--help] [--stop-on-error] [--file JOB_FILE] [--output OUTPUT]
INPUT_FILE

Positional arguments:

INPUT_FILE Project file to use with the jobset.

Optional arguments:

-h , --help Show help for the jobset command.

--stop-on-error As jobs are executed in sequence, stop running after a job fails. If not
given, jobs will continue executing after any job fails.

-f <jobset file> , --file The jobset file ( .kicad_jobset) to run.


<jobset file>

--output <output ID> The jobset output to generate. If no output is specified, all outputs will
be generated. The output is specified as a unique ID. The ID for each
output is printed by the jobset run command when --output is not
used. It can also be found in the .kicad_jobset file under the output’s
id key.

5
PCB commands
The pcb command runs a design rule check or exports a board to various other file formats, including
fabrication and 3D files.

PCB DRC
The pcb drc command runs a design rule check on a board and generates a report.

Usage: kicad-cli pcb drc [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--format
FORMAT] [--all-track-errors] [--schematic-parity] [--units UNITS] [--severity-all] [--severity-
error] [--severity-warning] [--severity-exclusions] [--exit-code-violations] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to run DRC on.

-h , --help Show help for the DRC command.

-o <output filename>, `-- Output filename for the generated DRC report. When this argument is
output <output filename> not used, the output filename will be the same as the input file, with the
.rpt or .json file extension, depending on the selected format.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--format <format> Report file format. Options are report (default) or json .

--all-track-errors Report all errors for each track.

--schematic-parity Test for parity between PCB and schematic.

--units <unit> Units to use in the report. Options are mm (default), in , or mils .

--severity-all Report all DRC violations. This is equivalent to using all of the other DRC
severity options.

--severity-error Report all error-level DRC violations. This can be combined with the
other DRC severity options.

--severity-warning Report all warning-level DRC violations. This can be combined with the
other DRC severity options.

--severity-exclusions Report all excluded DRC violations. This can be combined with the other
DRC severity options.

--exit-code-violations Return an exit code depending on whether or not DRC violations exist.
The exit code is 0 if no violations are found, and 5 if any violations are
found.

6
PCB BREP (OCCT) export
The pcb export brep command exports a board design to a BREP (OCCT-native boundary representation)
3D model file.

Usage: kicad-cli pcb export brep [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--grid-origin] [--drill-origin] [--subst-models] [--board-
only] [--cut-vias-in-body] [--no-board-body] [--no-components] [--component-filter VAR] [--
include-tracks] [--include-pads] [--include-zones] [--include-inner-copper] [--include-
silkscreen] [--include-soldermask] [--fuse-shapes] [--fill-all-vias] [--min-distance MIN_DIST]
[--net-filter VAR] [--user-origin VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the BREP export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .brep file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--grid-origin Use grid origin as origin of output file.

--drill-origin Use drill origin as origin of output file.

--subst-models Replace VRML models in footprints with STEP or IGS models of the same
name, if they exist.

--board-only Only include the board itself in the generated model; exclude all
component models.

--cut-vias-in-body Cut via holes in board body even if conductor layers are not exported.

--no-board-body Exclude board body.

--no-components Exclude 3D models for components.

--component-filter Only include component 3D models matching this list of reference


<reference designator designators (comma-separated, wildcards supported)
list>

7
--include-tracks Include tracks and vias on outer conductor layers in export (time
consuming).

--include-pads Include pads in export (time consuming).

--include-zones Include zones in export (time consuming).

--include-inner-copper Include elements on inner conductor layers in export.

--include-silkscreen Include silkscreen graphics in export as a set of flat faces.

--include-soldermask Include solder mask layers in export as a set of flat faces.

--fuse-shapes Fuse overlapping geometry together in export (time consuming).

--fill-all-vias Don’t cut via holes in conductor layers.

--min-distance <min Tolerance for considering two points to be in the same location. Default:
distance> 0.01mm.

--net-filter <net filter> Only include copper items belonging to nets matching this wildcard.

--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters.

PCB drill file export


The pcb export drill command exports a drill file from a board.

Usage: kicad-cli pcb export drill [--help] [--output OUTPUT_DIR] [--format FORMAT] [--drill-
origin DRILL_ORIGIN] [--excellon-zeros-format ZEROS_FORMAT] [--excellon-oval-format OVAL_FORMAT]
[--excellon-units UNITS] [--excellon-mirror-y] [--excellon-min-header] [--excellon-separate-th]
[--generate-map] [--map-format MAP_FORMAT] [--gerber-precision VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

8
-h , --help Show help for the drill file export command.

-o <output dir> , --output The output directory for the drill file. When this argument is not used,
<output dir> the drill file is saved in the current directory.

--format <format> The drill file format. Options are excellon (default) or gerber .

--drill-origin <origin> The coordinate origin for the drill file. Options are absolute (default) to
use the board’s absolute origin or plot to use the board’s
drill/placement origin.

--excellon-zeros-format The zeros format for the drill file. Options are decimal (default),
<format> suppressleading , suppresstrailing , or keep . Only applies to Excellon
format drill files.

--excellon-oval-format Control the oval holes drill mode. Options are route and alternate
<format> (default). Only applies to Excellon format drill files.

-u <units> , --excellon- The units for the drill file. Options are mm (default) or in . Only applies
units <units> to Excellon format drill files.

--excellon-mirror-y Mirror the drill file in the Y direction. Only applies to Excellon format
drill files.

--excellon-min-header Use a minimal header in the drill file. Only applies to Excellon format
drill files.

--excellon-separate-th Generate separate drill files for plated and non-plated through holes.
Only applies to Excellon format drill files.

--generate-map Generate a map file in addition to the drill file.

--map-format <format> The map file format. Options are pdf (default), gerberx2 , ps , dxf , or
svg .

--gerber-precision The precision (number of digits) for the drill file. Valid options are 5 or
<precision> 6 (default). Only applies to Gerber format drill files.

PCB DXF export


The pcb export dxf command exports a board design to a DXF file.

Usage: kicad-cli pcb export dxf [--help] [--output OUTPUT_FILE] [--layers LAYER_LIST] [--drawing-
sheet SHEET_PATH] [--define-var KEY=VALUE] [--exclude-refdes] [--exclude-value] [--use-contours]
[--use-drill-origin] [--include-border-title] [--output-units UNITS] [--drill-shape-opt VAR] [--
common-layers COMMON_LAYER_LIST] [--mode-single] [--mode-multi] [--plot-invisible-text]
INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

9
Optional arguments:

-h , --help Show help for the DXF export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .dxf file extension.

-l <layer list> , --layers A comma-separated list of layer names to export from the footprint,
<layer list> such as F.Cu,B.Cu. At least one layer must be given.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--erd , --exclude-refdes Exclude footprint reference designators from plot.

--ev , --exclude-value Exclude footprint values from plot.

--uc , --use-contours Plot graphic items using their contours.

--udo , --use-drill-origin Plot using the drill/place file origin.

-ibt , --include-border- Include sheet border and title block in plot.


title

--ou <unit> , --output- Output units. Options are mm or in (default).


units <unit>

--drill-shape-opt <shape> The shape of drill marks in the plot. Options are 0 for no drill marks, 1
for small marks, or 2 for actual size marks (default).

--cl <layer list> , -- A comma-separated list of layer names to plot on all layers, such as
common-layers <layer list> F.Cu,B.Cu.

--mode-single Generates a single file with the output arg path acting as the complete
directory and filename path. COMMON_LAYER_LIST does not function in
this mode. Instead LAYER_LIST controls all layers plotted.

--mode-multi Generates one or more files with behavior similar to the KiCad GUI
plotting. The given output path specifies a directory in which files may
be output.

--plot-invisible-text Force plotting of values and references, even if they are invisible.

PCB GenCAD export


The pcb export gencad command exports a board design to a GenCAD file.

Usage: kicad-cli pcb export gencad [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
flip-bottom-pads] [--unique-pins] [--unique-footprints] [--use-drill-origin] [--store-origin-
coord] INPUT_FILE

10
Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the DXF export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .cad file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --flip-bottom-pads Flip bottom footprint padstacks.

--unique-pins Generate unique pin names.

--unique-footprints Generate a new shape for each footprint instance (do not reuse shapes).

--use-drill-origin Use drill/place file origin as origin.

--store-origin-coord Save the origin coordinates in the file.

PCB Gerber export: one layer per file


The pcb export gerbers command exports a board design to Gerber files, with one layer per file.

Be aware that there are two distinct Gerber export commands, gerber and gerbers . The
gerber command plots multiple PCB layers to a single Gerber file, while the gerbers
NOTE
command plots multiple Gerber files, with one PCB layer per file. The gerbers command
is typically the correct command to use for having a PCB fabricated.

Usage: kicad-cli pcb export gerbers [--help] [--output OUTPUT_FILE] [--layers LAYER_LIST] [--
drawing-sheet SHEET_PATH] [--define-var KEY=VALUE] [--exclude-refdes] [--exclude-value] [--
include-border-title] [--no-x2] [--no-netlist] [--subtract-soldermask] [--disable-aperture-
macros] [--use-drill-file-origin] [--precision PRECISION] [--no-protel-ext] [--plot-invisible-
text] [--common-layers COMMON_LAYER_LIST] [--board-plot-params] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

11
-h , --help Show help for the Gerber export command.

-o <output dir> , --output The output folder for the exported files. When this argument is not used,
<output dir> the files are exported to the current directory.

-l <layer list> , --layers A comma-separated list of layer names to plot from the board, such as
<layer list> F.Cu,B.Cu. If this argument is not used, all layers will be plotted.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--erd , --exclude-refdes Exclude footprint reference designators from plot.

--ev , --exclude-value Exclude footprint values from plot.

--ibt , --include-border- Include the sheet border and title block.


title

--no-x2 Do not use the extended X2 format.

--no-netlist Do not include netlist attributes.

--subtract-soldermask Remove silkscreen from areas without soldermask.

--disable-aperture-macros Disable aperture macros.

--use-drill-file-origin Use drill/place file origin instead of absolute origin.

--precision <precision> The precision (number of digits) for the Gerber files. Valid options are 5
or 6 (default).

--no-protel-ext Use .gbr file extension instead of Protel file extensions ( .gbl , .gtl ,
etc.).

--plot-invisible-text Force plotting of values and references, even if they are invisible.

--cl <layer list> , -- A comma-separated list of layer names to plot on all layers, such as
common-layers <layer list> F.Cu,B.Cu.

--board-plot-params Use the Gerber plot settings already configured in the board file.

PCB Gerber export: multiple layers per file


The pcb export gerber command exports one or more board layers to a single Gerber file.

Be aware that there are two distinct Gerber export commands, gerber and gerbers . The
gerber command plots multiple PCB layers to a single Gerber file, while the gerbers
NOTE
command plots multiple Gerber files, with one PCB layer per file. The gerbers command
is typically the correct command to use for having a PCB fabricated.

12
the pcb export gerber command is deprecated in KiCad 9.0 and will be removed in
WARNING
KiCad 10.0. Please use the pcb export gerbers command instead.

Usage: kicad-cli pcb export gerber [--help] [--output OUTPUT_FILE] [--layers LAYER_LIST] [--
drawing-sheet SHEET_PATH] [--define-var KEY=VALUE] [--exclude-refdes] [--exclude-value] [--
include-border-title] [--no-x2] [--no-netlist] [--subtract-soldermask] [--disable-aperture-
macros] [--use-drill-file-origin] [--precision PRECISION] [--no-protel-ext] [--plot-invisible-
text] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

13
-h , --help Show help for the Gerber export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .gbr file extension.

-l <layer list> , --layers A comma-separated list of layer names to plot from the board, such as
<layer list> F.Cu,B.Cu. All layers will be plotted in the output file. At least one layer
must be given.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--erd , --exclude-refdes Exclude footprint reference designators from plot.

--ev , --exclude-value Exclude footprint values from plot.

--ibt , --include-border- Include the sheet border and title block.


title

--no-x2 Do not use the extended X2 format.

--no-netlist Do not include netlist attributes.

--subtract-soldermask Remove silkscreen from areas without soldermask.

--disable-aperture-macros Disable aperture macros.

--use-drill-file-origin Use drill/place file origin instead of absolute origin.

--precision <precision> The precision (number of digits) for the Gerber files. Valid options are 5
or 6 (default).

--no-protel-ext Use .gbr file extension instead of Protel file extensions ( .gbl , .gtl ,
etc.).

--plot-invisible-text Force plotting of values and references, even if they are invisible.

PCB GLB export


The pcb export glb command exports a board design to a GLB (binary glTF) 3D model file.

Usage: kicad-cli pcb export glb [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--grid-origin] [--drill-origin] [--subst-models] [--board-
only] [--cut-vias-in-body] [--no-board-body] [--no-components] [--component-filter VAR] [--
include-tracks] [--include-pads] [--include-zones] [--include-inner-copper] [--include-
silkscreen] [--include-soldermask] [--fuse-shapes] [--fill-all-vias] [--min-distance MIN_DIST]
[--net-filter VAR] [--user-origin VAR] INPUT_FILE

Positional arguments:

14
INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the GLB export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .glb file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--grid-origin Use grid origin as origin of output file.

--drill-origin Use drill origin as origin of output file.

--subst-models Replace VRML models in footprints with STEP or IGS models of the same
name, if they exist.

--board-only Only include the board itself in the generated model; exclude all
component models.

--cut-vias-in-body Cut via holes in board body even if conductor layers are not exported.

--no-board-body Exclude board body.

--no-components Exclude 3D models for components.

--component-filter Only include component 3D models matching this list of reference


<reference designator designators (comma-separated, wildcards supported)
list>

--include-tracks Include tracks and vias on outer conductor layers in export (time
consuming).

--include-pads Include pads in export (time consuming).

--include-zones Include zones in export (time consuming).

--include-inner-copper Include elements on inner conductor layers in export.

--include-silkscreen Include silkscreen graphics in export as a set of flat faces.

--include-soldermask Include solder mask layers in export as a set of flat faces.

--fuse-shapes Fuse overlapping geometry together in export (time consuming).

15
--fill-all-vias Don’t cut via holes in conductor layers.

--min-distance <min Tolerance for considering two points to be in the same location. Default:
distance> 0.01mm.

--net-filter <net filter> Only include copper items belonging to nets matching this wildcard.

--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters.

PCB IPC-2581 export


The pcb export ipc2581 command exports a board design in IPC-2581 format.

Usage: kicad-cli pcb export ipc2581 [--help] [--output OUTPUT_FILE] [--drawing-sheet SHEET_PATH]
[--define-var KEY=VALUE] [--precision PRECISION] [--compress] [--version VAR] [--units VAR] [--
bom-col-int-id FIELD_NAME] [--bom-col-mfg-pn FIELD_NAME] [--bom-col-mfg FIELD_NAME] [--bom-col-
dist-pn FIELD_NAME] [--bom-col-dist FIELD_NAME] INPUT_FILE

INPUT_FILE Board file to export.

Optional arguments:

16
-h , --help Show help for the IPC-2581 export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .xml file extension.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--precision <precision> The precision (number of digits after the decimal separator) for the
exported file. The default is 6.

--compress Compress output file as a ZIP file.

--version <IPC-2581 IPC-2581 standard version to use. Options are B or C (default).


standard version>

--units Units to use in export. Options are mm (default) or in .

--bom-col-int-id Name of the part field to use for the Bill of Materials Internal ID column.
This can be any footprint field, or blank to omit this column.

--bom-col-mfg-pn Name of the part field to use for the Bill of Materials Manufacturer Part
Number column. This can be any footprint field, or blank to omit this
column.

--bom-col-mfg Name of the part field to use for the Bill of Materials Manufacturer
column. This can be any footprint field, or blank to omit this column.

--bom-col-dist-pn Name of the part field to use for the Bill of Materials Distributor Part
Number column. This can be any footprint field, or blank to omit this
column.

--bom-col-dist Name of the part field to use for the Bill of Materials Distributor column.
This can be any footprint field, or blank to omit this column.

PCB IPC-D-356 export


The pcb export ipcd356 command generates an IPC-D-356 netlist from the board design.

Usage: kicad-cli pcb export ipcd356 [--help] [--output OUTPUT_FILE] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

17
-h , --help Show help for the IPC-D-356 export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .d356 file extension.

PCB ODB++ export


The pcb export odb command exports a board design in ODB++ format.

Usage: kicad-cli pcb export odb [--help] [--output OUTPUT_FILE] [--drawing-sheet SHEET_PATH] [--
define-var KEY=VALUE] [--precision PRECISION] [--compression VAR] [--units VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the ODB++ export command.

-o <output filename> , -- The output filename, or folder name if no compression is used.


output <output filename>

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--precision <precision> The precision (number of digits after the decimal separator) for the
exported file. The default is 2.

--compression <mode> Compression mode. Options are none , zip (default), or tgz .

--units <unit> Units to use in the output file. Options are mm (default) or in .

PCB PDF export


The pcb export pdf command exports a board design to a PDF file. Each layer can be plotted as its own file
or as a sheet within a single file.

Usage: kicad-cli pcb export pdf [--help] [--output OUTPUT_FILE] [--layers LAYER_LIST] [--drawing-
sheet SHEET_PATH] [--define-var KEY=VALUE] [--mirror] [--exclude-refdes] [--exclude-value] [--
include-border-title] [--sketch-pads-on-fab-layers] [--hide-DNP-footprints-on-fab-layers] [--
sketch-DNP-footprints-on-fab-layers] [--crossout-DNP-footprints-on-fab-layers] [--negative] [--
black-and-white] [--theme THEME_NAME] [--drill-shape-opt VAR] [--common-layers
COMMON_LAYER_LIST] [--plot-invisible-text] [--mode-single] [--mode-separate] [--mode-multipage]
INPUT_FILE

Positional arguments:

18
INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the PDF export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .pdf file extension.

-l <layer list> , --layers A comma-separated list of layer names to export from the board, such as
<layer list> F.Cu,B.Cu. At least one layer must be given.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-m , --mirror Mirror the board. This can be useful for showing bottom layers.

--erd , --exclude-refdes Exclude footprint reference designators from plot.

--ev , --exclude-value Exclude footprint values from plot.

--ibt , --include-border- Include the sheet border and title block.


title

--sp , --sketch-pads-on- Draw pad outlines and their numbers on front and back fab layers.
fab-layers

--hdnp , --hide-DNP- Don’t plot text and graphics of DNP footprints on fab layers.
footprints-on-fab-layers

--sdnp , --sketch-DNP- Plot graphics of DNP footprints in sketch mode on fab layers.
footprints-on-fab-layers

--cdnp , --crossout-DNP- Plot an 'X' over the courtyard of DNP footprints on fab layers, and
footprints-on-fab-layers strikeout their reference designators.

-n , --negative Plot in negative.

--black-and-white Plot in black and white.

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the board
<theme name> editor’s currently selected theme is used.

--drill-shape-opt The shape of drill marks in the plot. Options are 0 for no drill marks, 1
for small marks, or 2 for actual size marks (default).

--cl <layer list> , -- A comma-separated list of layer names to plot on all layers, such as
common-layers <layer list> F.Cu,B.Cu.

19
--plot-invisible-text Force plotting of values and references, even if they are invisible.

--mode-single Generates a single file with the output arg path acting as the complete
directory and filename path. COMMON_LAYER_LIST does not function in
this mode. Instead LAYER_LIST controls all layers plotted.

--mode-separate Plot the layers to individual PDF files.

--mode-multipage Plot the layers to a single PDF file with multiple pages.

PCB PLY file export


The pcb export ply command exports a board design to a PLY 3D model file.

Usage: kicad-cli pcb export ply [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--grid-origin] [--drill-origin] [--subst-models] [--board-
only] [--cut-vias-in-body] [--no-board-body] [--no-components] [--component-filter VAR] [--
include-tracks] [--include-pads] [--include-zones] [--include-inner-copper] [--include-
silkscreen] [--include-soldermask] [--fuse-shapes] [--fill-all-vias] [--min-distance MIN_DIST]
[--net-filter VAR] [--user-origin VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the PLY export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .ply file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--grid-origin Use grid origin as origin of output file.

--drill-origin Use drill origin as origin of output file.

--subst-models Replace VRML models in footprints with STEP or IGS models of the same
name, if they exist.

20
--board-only Only include the board itself in the generated model; exclude all
component models.

--cut-vias-in-body Cut via holes in board body even if conductor layers are not exported.

--no-board-body Exclude board body.

--no-components Exclude 3D models for components.

--component-filter Only include component 3D models matching this list of reference


<reference designator designators (comma-separated, wildcards supported)
list>

--include-tracks Include tracks and vias on outer conductor layers in export (time
consuming).

--include-pads Include pads in export (time consuming).

--include-zones Include zones in export (time consuming).

--include-inner-copper Include elements on inner conductor layers in export.

--include-silkscreen Include silkscreen graphics in export as a set of flat faces.

--include-soldermask Include solder mask layers in export as a set of flat faces.

--fuse-shapes Fuse overlapping geometry together in export (time consuming).

--fill-all-vias Don’t cut via holes in conductor layers.

--min-distance <min Tolerance for considering two points to be in the same location. Default:
distance> 0.01mm.

--net-filter <net filter> Only include copper items belonging to nets matching this wildcard.

--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters.

PCB position file export


The pcb export pos command exports a position file from a board design.

Usage: kicad-cli pcb export pos [--help] [--output OUTPUT_FILE] [--side VAR] [--format FORMAT] [--
units UNITS] [--bottom-negate-x] [--use-drill-file-origin] [--smd-only] [--exclude-fp-th] [--
exclude-dnp] [--gerber-board-edge] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

21
-h , --help Show help for the position file export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .pos file extension.

--side <side> The side of the board to export. Options are front , back , or both
(default). Gerber format does not support both .

--format <format> The position file format. Options are ascii (default), csv , or gerber .

--units <unit> Units for position file. Options are in (default) or mm . This option has
no effect for Gerber format.

--bottom-negate-x Use negative X coordinates for footprints on the bottom layer. This
option has no effect for Gerber format.

--use-drill-file-origin Use drill/place file origin instead of absolute origin. This option has no
effect for Gerber format.

--smd-only Include only surface-mount components. This option has no effect for
Gerber format.

--exclude-fp-th Exclude all footprints with through-hole pads. This option has no effect
for Gerber format.

--exclude-dnp Exclude all footprints with "Do not populate" attribute.

--gerber-board-edge Include board edge layer in export (Gerber format only).

PCB STEP export


The pcb export step command exports a board design to a STEP file.

Usage: kicad-cli pcb export step [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--grid-origin] [--drill-origin] [--subst-models] [--board-
only] [--cut-vias-in-body] [--no-board-body] [--no-components] [--component-filter VAR] [--
include-tracks] [--include-pads] [--include-zones] [--include-inner-copper] [--include-
silkscreen] [--include-soldermask] [--fuse-shapes] [--fill-all-vias] [--min-distance MIN_DIST]
[--net-filter VAR] [--no-optimize-step] [--user-origin VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the STEP file export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .step file extension.

22
-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--grid-origin Use grid origin as origin of output file.

--drill-origin Use drill origin as origin of output file.

--subst-models Replace VRML models in footprints with STEP or IGS models of the same
name, if they exist.

--board-only Only include the board itself in the generated model; exclude all
component models.

--cut-vias-in-body Cut via holes in board body even if conductor layers are not exported.

--no-board-body Exclude board body.

--no-components Exclude 3D models for components.

--component-filter Only include component 3D models matching this list of reference


<reference designator designators (comma-separated, wildcards supported)
list>

--include-tracks Include tracks and vias on outer conductor layers in export (time
consuming).

--include-pads Include pads in export (time consuming).

--include-zones Include zones in export (time consuming).

--include-inner-copper Include elements on inner conductor layers in export.

--include-silkscreen Include silkscreen graphics in export as a set of flat faces.

--include-soldermask Include solder mask layers in export as a set of flat faces.

--fuse-shapes Fuse overlapping geometry together in export (time consuming).

--fill-all-vias Don’t cut via holes in conductor layers.

--min-distance <min Tolerance for considering two points to be in the same location. Default:
distance> 0.01mm.

--net-filter <net filter> Only include copper items belonging to nets matching this wildcard.

--no-optimize-step Do not optimize STEP file. This enables writing parametric curves, which
reduces file sizes and write/read times, but may reduce compatibility
with other software.

23
--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters.

PCB STL export


The pcb export stl command exports a board design to an STL 3D model file.

Usage: kicad-cli pcb export stl [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--grid-origin] [--drill-origin] [--subst-models] [--board-
only] [--cut-vias-in-body] [--no-board-body] [--no-components] [--component-filter VAR] [--
include-tracks] [--include-pads] [--include-zones] [--include-inner-copper] [--include-
silkscreen] [--include-soldermask] [--fuse-shapes] [--fill-all-vias] [--min-distance MIN_DIST]
[--net-filter VAR] [--user-origin VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the STL export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .stl file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--grid-origin Use grid origin as origin of output file.

--drill-origin Use drill origin as origin of output file.

--subst-models Replace VRML models in footprints with STEP or IGS models of the same
name, if they exist.

--board-only Only include the board itself in the generated model; exclude all
component models.

--cut-vias-in-body Cut via holes in board body even if conductor layers are not exported.

--no-board-body Exclude board body.

--no-components Exclude 3D models for components.

24
--component-filter Only include component 3D models matching this list of reference
<reference designator designators (comma-separated, wildcards supported)
list>

--include-tracks Include tracks and vias on outer conductor layers in export (time
consuming).

--include-pads Include pads in export (time consuming).

--include-zones Include zones in export (time consuming).

--include-inner-copper Include elements on inner conductor layers in export.

--include-silkscreen Include silkscreen graphics in export as a set of flat faces.

--include-soldermask Include solder mask layers in export as a set of flat faces.

--fuse-shapes Fuse overlapping geometry together in export (time consuming).

--fill-all-vias Don’t cut via holes in conductor layers.

--min-distance <min Tolerance for considering two points to be in the same location. Default:
distance> 0.01mm.

--net-filter <net filter> Only include copper items belonging to nets matching this wildcard.

--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters.

PCB SVG export


The pcb export svg command exports a board design to an SVG file.

Usage: kicad-cli pcb export svg [--help] [--output OUTPUT_FILE] [--layers LAYER_LIST] [--drawing-
sheet SHEET_PATH] [--define-var KEY=VALUE] [--mirror] [--theme THEME_NAME] [--negative] [--black-
and-white] [--sketch-pads-on-fab-layers] [--hide-DNP-footprints-on-fab-layers] [--sketch-DNP-
footprints-on-fab-layers] [--crossout-DNP-footprints-on-fab-layers] [--page-size-mode MODE] [--
exclude-drawing-sheet] [--drill-shape-opt SHAPE_OPTION] [--common-layers COMMON_LAYER_LIST] [--
mode-single] [--mode-multi] [--plot-invisible-text] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the SVG file export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .svg file extension.

25
-l <layer list> , --layers A comma-separated list of layer names to export from the board, such as
<layer list> F.Cu,B.Cu. At least one layer must be given.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the board file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-m , --mirror Mirror the board. This can be useful for showing bottom layers.

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the board
<theme name> editor’s currently selected theme is used.

-n , --negative Plot in negative.

--black-and-white Plot in black and white.

--sp , --sketch-pads-on- Draw pad outlines and their numbers on front and back fab layers.
fab-layers

--hdnp , --hide-DNP- Don’t plot text and graphics of DNP footprints on fab layers.
footprints-on-fab-layers

--sdnp , --sketch-DNP- Plot graphics of DNP footprints in sketch mode on fab layers.
footprints-on-fab-layers

--cdnp , --crossout-DNP- Plot an 'X' over the courtyard of DNP footprints on fab layers, and
footprints-on-fab-layers strikeout their reference designators.

--page-size-mode <mode> Set page sizing mode. Options are 0 (default), 1 , or 2 . 0 sets the
output page size to fit the entire sheet, including drawing sheet frame
and title block. 1 sets the output page size to match the current page
size. 2 sets the output page size to the size of the board itself.

--exclude-drawing-sheet Plot SVG without a drawing sheet.

--drill-shape-opt The shape of drill marks in the plot. Options are 0 for no drill marks, 1
for small marks, or 2 for actual size marks (default).

26
--cl <layer list> , -- A comma-separated list of layer names to plot on all layers, such as
common-layers <layer list> F.Cu,B.Cu.

--mode-single Generates a single file with the output arg path acting as the complete
directory and filename path. COMMON_LAYER_LIST does not function in
this mode. Instead LAYER_LIST controls all layers plotted.

--mode-multi Generates one or more files with behavior similar to the KiCad GUI
plotting. The given output path specifies a directory in which files may
be output.

--plot-invisible-text Force plotting of values and references, even if they are invisible.

PCB VRML export


The pcb export vrml command exports a board design to a VRML 3D model file.

Usage: kicad-cli pcb export vrml [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--user-origin VAR] [--units VAR] [--models-dir VAR] [--
models-relative] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

27
-h , --help Show help for the VRML export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .wrl file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters. If this option is not given, the board center is used.

--units <units> Units to use in the output file. Options are mm , m , in (default), or
tenths (tenths of an inch).

--models-dir <output model Name of output directory to copy component models into. If not used,
directory> component models are embedded into the output file.

--models-relative With --models-dir, use relative paths in the output file.

PCB XAO export


The pcb export xao command exports a board design to an XAO (SALOME/Gmsh) 3D model file.

Usage: kicad-cli pcb export xao [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--
force] [--no-unspecified] [--no-dnp] [--grid-origin] [--drill-origin] [--subst-models] [--board-
only] [--cut-vias-in-body] [--no-board-body] [--no-components] [--component-filter VAR] [--
include-tracks] [--include-pads] [--include-zones] [--include-inner-copper] [--include-
silkscreen] [--include-soldermask] [--fuse-shapes] [--fill-all-vias] [--min-distance MIN_DIST]
[--net-filter VAR] [--user-origin VAR] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to export.

Optional arguments:

-h , --help Show help for the XAO export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with the .xao file extension.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

28
-f , --force Overwrite output file.

--no-unspecified Exclude 3D models of components with 'unspecified' footprint type.

--no-dnp Exclude 3D models of components with 'Do not populate' attribute.

--grid-origin Use grid origin as origin of output file.

--drill-origin Use drill origin as origin of output file.

--subst-models Replace VRML models in footprints with STEP or IGS models of the same
name, if they exist.

--board-only Only include the board itself in the generated model; exclude all
component models.

--cut-vias-in-body Cut via holes in board body even if conductor layers are not exported.

--no-board-body Exclude board body.

--no-components Exclude 3D models for components.

--component-filter Only include component 3D models matching this list of reference


<reference designator designators (comma-separated, wildcards supported)
list>

--include-tracks Include tracks and vias on outer conductor layers in export (time
consuming).

--include-pads Include pads in export (time consuming).

--include-zones Include zones in export (time consuming).

--include-inner-copper Include elements on inner conductor layers in export.

--include-silkscreen Include silkscreen graphics in export as a set of flat faces.

--include-soldermask Include solder mask layers in export as a set of flat faces.

--fuse-shapes Fuse overlapping geometry together in export (time consuming).

--fill-all-vias Don’t cut via holes in conductor layers.

--min-distance <min Tolerance for considering two points to be in the same location. Default:
distance> 0.01mm.

--net-filter <net filter> Only include copper items belonging to nets matching this wildcard.

--user-origin <output Specify a custom origin for the output file, with X and Y coordinates. For
origin> example, 1x1in , 1x1inch , or 25.4x25.4mm . The default unit is
millimeters.

29
PCB render
The pcb render command generates a raytraced rendering of the 3D model of the board and saves it to a
PNG or JPEG file.

Usage: kicad-cli pcb render [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--width
WIDTH] [--height HEIGHT] [--side SIDE] [--background BG] [--quality QUALITY] [--preset PRESET] [-
-floor] [--perspective] [--zoom ZOOM] [--pan VECTOR] [--pivot PIVOT] [--rotate ANGLES] [--light-
top COLOR] [--light-bottom COLOR] [--light-side COLOR] [--light-camera COLOR] [--light-side-
elevation ANGLE] INPUT_FILE

Positional arguments:

INPUT_FILE Board file to render.

Optional arguments:

-h , --help Show help for the render command.

-o <output filename> , -- The output filename. This argument must be given. The file extension
output <output filename> given in this argument determines the output image file format. The
filename must end with either .png (for PNG files) or .jpg / .jpeg (for
JPG files).

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-w <width> , --width Image width in pixels. Default: 1600.


<width>

-h <height> , --height Image height in pixels. Default: 900.


<height>

--side <side> The side of the board to render. Options are top (default), bottom ,
left , right , front , or back .

--background <background> Image background. Options are default (default), transparent , or


opaque . For PNG files, default is transparent . For JPG files, default
is opaque .

--quality <quality> Render quality. Options are basic (default), high , user . When user is
specified, the render settings stored in the project are used.

--preset <color preset> Color preset. Options are follow_pcb_editor , follow_plot_settings


(default), or legacy_preset_flag .

--floor Enables floor, shadows and post-processing, even if disabled in quality


preset.

--perspective Use perspective projection instead of orthogonal.

30
--zoom <zoom level> Camera zoom factor as an integer. Default: 1.

--pan <camera pan> Set camera pan location, in millimeters, with the format 'X,Y,Z' , e.g.
'3,0,0' .

--pivot <pivot> Set pivot point relative to the board center in centimeters, with the
format 'X,Y,Z' e.g. '-10,2,0' .

--rotate <rotation> Set board rotation around pivot point, in degrees, with the format
'X,Y,Z' , e.g. '-45,0,45' for isometric view.

--light-top <intensity> Top light intensity, format ’R,G,B'' or a single number, range: 0-1.

--light-bottom <intensity> Bottom light intensity, format ’R,G,B'' or a single number, range: 0-1.

--light-side <intensity> Side lights intensity, format ’R,G,B'' or a single number, range: 0-1.

--light-camera <intensity> Camera light intensity, format ’R,G,B'' or a single number, range: 0-1.

--light-side-elevation Side lights elevation angle in degrees, range: 0-90.


<elevation>

31
Schematic commands
The sch command runs an electrical rule check, exports a schematic to various other file formats, or
exports a bill of materials or netlist. Each subcommand has its own options.

Schematic ERC
The sch erc command runs an electrical rule check on a schematic and generates a report.

Usage: kicad-cli sch erc [--help] [--output OUTPUT_FILE] [--define-var KEY=VALUE] [--format VAR]
[--units VAR] [--severity-all] [--severity-error] [--severity-warning] [--severity-exclusions]
[--exit-code-violations] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to run ERC on.

Optional arguments:

-h , --help Show help for the ERC command.

-o <output filename>, `-- Output filename for the generated ERC report. When this argument is
output <output filename> not used, the output filename will be the same as the input file, with the
.rpt or .json file extension, depending on the selected format.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

--format <format> Report file format. Options are report (default) or json .

--units <unit> Units to use in the report. Options are mm (default), in , or mils .

--severity-all Report all ERC violations. This is equivalent to using all of the other ERC
severity options.

--severity-error Report all error-level ERC violations. This can be combined with the
other ERC severity options.

--severity-warning Report all warning-level ERC violations. This can be combined with the
other ERC severity options.

--severity-exclusions Report all excluded ERC violations. This can be combined with the other
ERC severity options.

--exit-code-violations Return an exit code depending on whether or not ERC violations exist.
The exit code is 0 if no violations are found, and 5 if any violations are
found.

32
Schematic bill of materials export
The sch export bom command exports a BOM from a schematic. The BOM export has a number of options
for controlling the format and included fields. This export method is equivalent to exporting a BOM from
the symbol fields table.

To export a BOM using the legacy XML and Python BOM script workflow, use the sch
NOTE
export python-bom command.

Usage: kicad-cli sch export bom [--help] [--output OUTPUT_FILE] [--preset PRESET] [--format-
preset FMT_PRESET] [--fields FIELDS] [--labels LABELS] [--group-by GROUP_BY] [--sort-field
SORT_BY] [--sort-asc] [--filter FILTER] [--exclude-dnp] [--include-excluded-from-bom] [--field-
delimiter FIELD_DELIM] [--string-delimiter STR_DELIM] [--ref-delimiter REF_DELIM] [--ref-range-
delimiter REF_RANGE_DELIM] [--keep-tabs] [--keep-line-breaks] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to export.

Optional arguments:

33
-h , --help Shows help message and exits

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with a .csv file extension.

--preset <preset> Use a named BOM preset setting from the schematic, e.g. "Grouped By
Value".

--format-preset <format Use a named BOM format preset setting from the schematic, e.g. CSV.
preset>

--fields <fields> An ordered list of fields to export. * includes all fields. Special symbol
fields such as DNP or Exclude from board can be accessed with ${DNP}
or ${EXCLUDE_FROM_BOARD} , respectively (see the text variable
documentation for a list of fields). Default:
"Reference,Value,Footprint,${QUANTITY},${DNP}".

--labels <labels> An ordered list of labels to apply the exported fields (default:
"Refs,Value,Footprint,Qty,DNP").

--group-by <fields> Fields to group references by when field values match.

--sort-field <fields> Field name to sort by (default: "Reference").

--sort-asc If given, sort in ascending order. If not given, sort in descending order.

--filter <filter> Filter string to remove output lines.

--exclude-dnp Exclude symbols with the "Do not populate" attribute.

--include-excluded-from- Include symbols marked 'Exclude from BOM'.


bom

--field-delimiter Separator between output fields/columns (default: ",").


<delimiter>

--string-delimiter Character to surround fields with (none by default).


<delimiter>

--ref-delimiter Character to place between individual references (default: ",").


<delimiter>

--ref-range-delimiter Character to place in ranges of references (default: "-"). Leave blank for
<delimiter> no ranges.

--keep-tabs Keep tab characters from input fields. Stripped by default.

--keep-line-breaks Keep line break characters from input fields. Stripped by default.

Schematic DXF export


The sch export dxf command exports a schematic to a DXF file. Each sheet in the design is exported to its
own file.

34
Usage: kicad-cli sch export dxf [--help] [--output OUTPUT_DIR] [--drawing-sheet SHEET_PATH] [--
define-var KEY=VALUE] [--theme THEME_NAME] [--black-and-white] [--exclude-drawing-sheet] [--
default-font VAR] [--pages PAGE_LIST] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to export.

Optional arguments:

-h , --help Show help for the DXF file export command.

-o <output dir> , --output The output folder for the exported files. When this argument is not used,
<output dir> the files are exported to the current directory.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the schematic file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the
<theme name> schematic editor’s currently selected theme is used.

-b , --black-and-white Export schematic in black and white.

-e , --exclude-drawing- Plot DXF without a drawing sheet.


sheet

--default-font <font name> Default font name. Default: "KiCad Font".

-p <page list> , --pages Comma-separated list of pages to export. Blank or unspecified means all
<page list> pages. To plot specific pages, give the root sheet as INPUT_FILE and
specify the desired output pages with the --pages argument.

Schematic HPGL export


The sch export hpgl command exports a schematic to an HPGL file for a pen plotter. Each sheet in the
design is exported to its own file.

Usage: kicad-cli sch export hpgl [--help] [--output OUTPUT_DIR] [--drawing-sheet SHEET_PATH] [--
define-var KEY=VALUE] [--exclude-drawing-sheet] [--default-font VAR] [--pages PAGE_LIST] [--pen-
size PEN_SIZE] [--origin ORIGIN] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to export.

Optional arguments:

35
-h , --help Show help for the HPGL file export command.

-o <output dir> , --output The output folder for the exported files. When this argument is not used,
<output dir> the files are exported to the current directory.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the schematic file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-e , --exclude-drawing- Plot HPGL without a drawing sheet.


sheet

--default-font <font name> Default font name. Default: "KiCad Font".

--pages <page list> Comma-separated list of pages to export. Blank or unspecified means all
pages. To plot specific pages, give the root sheet as INPUT_FILE and
specify the desired output pages with the --pages argument.

-p <pen size> , --pen-size Set the pen width. The default pen size is 0.5 mm.
<pen size>

-r <origin> , --origin Set plotter origin and scale. Options are 0 , 1 (default), 2 , or 3 . 0 sets
<origin> the origin to the bottom left and uses plotter units. 1 sets the origin to
the center and uses plotter units. 2 scales to the page, and 3 scales to
the content within the page.

Schematic netlist export


The sch export netlist command exports a netlist in various formats from a schematic.

Usage: kicad-cli sch export netlist [--help] [--output OUTPUT_FILE] [--format FORMAT] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to export.

Optional arguments:

-h , --help Show help for the netlist export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with a .net file extension.

-f <format> , --format The netlist output format. Options are kicadsexpr (default), kicadxml ,
<format> cadstar , orcadpcb2 , spice , spicemodel , pads , or allegro .

36
Schematic PDF export
The sch export pdf command exports a schematic to a PDF file. Each sheet in the design is exported to its
own page in the PDF file.

Usage: kicad-cli sch export pdf [--help] [--output OUTPUT_FILE] [--drawing-sheet SHEET_PATH] [--
define-var KEY=VALUE] [--theme THEME_NAME] [--black-and-white] [--exclude-drawing-sheet] [--
default-font VAR] [--exclude-pdf-property-popups] [--exclude-pdf-hierarchical-links] [--exclude-
pdf-metadata] [--no-background-color] [--pages PAGE_LIST] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to export.

Optional arguments:

-h , --help Show help for the PDF file export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with a .pdf file extension.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the schematic file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the
<theme name> schematic editor’s currently selected theme is used.

-b , --black-and-white Export schematic in black and white.

-e , --exclude-drawing- Plot PDF without a drawing sheet.


sheet

--default-font <font name> Default font name. Default: "KiCad Font".

--exclude-pdf-property- Do not generate property popups in PDF.


popups

--exclude-pdf- Do not generate clickable links for hierarchical elements in PDF.


hierarchical-links

--exclude-pdf-metadata Do not generate PDF metadata from AUTHOR and SUBJECT variables.

-n , --no-background-color Export schematic without a background color, regardless of theme.

-p <page list> , --pages Comma-separated list of pages to export. Blank or unspecified means all
<page list> pages. To plot specific pages, give the root sheet as INPUT_FILE and
specify the desired output pages with the --pages argument.

37
Schematic PostScript export
The sch export ps command exports a schematic to a PostScript file. Each sheet in the design is exported to
its own file.

Usage: kicad-cli sch export ps [--help] [--output OUTPUT_DIR] [--drawing-sheet SHEET_PATH] [--
define-var KEY=VALUE] [--theme THEME_NAME] [--black-and-white] [--exclude-drawing-sheet] [--
default-font VAR] [--no-background-color] [--pages PAGE_LIST] INPUT_FILE

Positional arguments:

INPUT_DIR Schematic file to export.

Optional arguments:

-h , --help Show help for the PS file export command.

-o <output dir> , --output The output folder for the exported files. When this argument is not used,
<output dir> the files are exported to the current directory.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the schematic file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the
<theme name> schematic editor’s currently selected theme is used.

-b , --black-and-white Export schematic in black and white.

-e , --exclude-drawing- Plot PS without a drawing sheet.


sheet

--default-font <font name> Default font name. Default: "KiCad Font".

-n , --no-background-color Export schematic without a background color, regardless of theme.

-p <page list> , --pages Comma-separated list of pages to export. Blank or unspecified means all
<page list> pages. To plot specific pages, give the root sheet as INPUT_FILE and
specify the desired output pages with the --pages argument.

Schematic bill of materials export (legacy BOM scripts)


The sch export python-bom command exports an XML BOM file from a schematic. The XML BOM file can
then be processed into your desired BOM format using a custom script or one of the scripts described in the
schematic BOM export documentation.

Usage: kicad-cli sch export python-bom [--help] [--output OUTPUT_FILE] INPUT_FILE

Positional arguments:

38
INPUT_FILE Schematic file to export.

Optional arguments:

-h , --help Show help for the BOM export command.

-o <output filename> , -- The output filename. When this argument is not used, the output
output <output filename> filename will be the same as the input file, with a -bom.xml suffix and file
extension.

Schematic SVG export


The sch export svg command export a schematic to an SVG file. Each sheet in the design is exported to its
own file.

Usage: kicad-cli sch export svg [--help] [--output OUTPUT_DIR] [--drawing-sheet SHEET_PATH] [--
define-var KEY=VALUE] [--theme THEME_NAME] [--black-and-white] [--exclude-drawing-sheet] [--
default-font VAR] [--no-background-color] [--pages PAGE_LIST] INPUT_FILE

Positional arguments:

INPUT_FILE Schematic file to export.

Optional arguments:

39
-h , --help Show help for the SVG file export command.

-o <output dir> , --output The output folder for the exported files. When this argument is not used,
<output dir> the files are exported to the current directory.

--drawing-sheet <sheet Path to drawing sheet to use in plot, overriding the drawing sheet
path> specified in the schematic file.

-D <variable name>= Add or override project variable definitions. Can be used multiple times
<value> , --define-var to define multiple variables.
<variable_name>=<value>

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the
<theme name> schematic editor’s currently selected theme is used.

-b , --black-and-white Export schematic in black and white.

-e , --exclude-drawing- Plot SVG without a drawing sheet.


sheet

--default-font <font name> Default font name. Default: "KiCad Font".

-n , --no-background-color Export schematic without a background color, regardless of theme.

-p <page list> , --pages Comma-separated list of pages to export. Blank or unspecified means all
<page list> pages. To plot specific pages, give the root sheet as INPUT_FILE and
specify the desired output pages with the --pages argument.

40
Symbol commands
The sym subcommand exports symbols to another format or upgrades symbol libraries to the current
version of the KiCad symbol file format.

Symbol export
The sym export svg command exports one or more symbols from the specified library into SVG files.

Usage: kicad-cli sym export svg [--help] [--output OUTPUT_DIR] [--theme THEME_NAME] [--symbol
SYMBOL] [--black-and-white] [--include-hidden-pins] [--include-hidden-fields] INPUT_FILE

Positional arguments:

INPUT_FILE Symbol library file to use for export.

Optional arguments:

-h , --help Show help for the symbol SVG export command.

-o <output dir> , --output The output folder for the exported files. When this argument is not used,
<output dir> the files are exported to the current directory.

-t <theme name> , --theme The name of the theme to use for export. If no theme is given, the
<theme name> symbol editor’s currently selected theme is used.

-s <symbol name> , --symbol The specific symbol to export from the library. When this argument is
<symbol name> not used, all symbols in the library are exported.

--black-and-white Export symbols in black and white.

--include-hidden-pins Export hidden pins in the exported SVG.

--include-hidden-fields Export hidden symbol fields in the exported SVG.

Symbol upgrade
The sym upgrade command converts the the specified symbol library from a legacy KiCad symbol format or
a non-KiCad symbol format to the native format for the current version of KiCad. If the input library is
already in the current file format, no action is taken.

Supported input symbol formats are:

KiCad symbol library ( .kicad_sym )

KiCad (pre-6.0) symbol library ( .lib )

Altium schematic library ( .SchLib )

Altium integrated library ( .IntLib )

CADSTAR parts library ( .lib )

41
EAGLE XML library ( .lbr )

EasyEDA (JLCEDA) Std file ( .json )

EasyEDA (JLCEDA) Pro file ( .elibz , .epro , .zip )

Usage: kicad-cli sym upgrade [--help] [--output OUTPUT_FILE] [--force] INPUT_FILE

Positional arguments:

INPUT_FILE Symbol library to upgrade.

Optional arguments:

-h , --help Show help for the symbol upgrade command.

-o <output filename> , -- The output filename for the upgraded symbol library. When this
output <output filename> argument is not used, the upgraded symbol library is saved over the
original library.

--force Re-save the input library even if it is already in the current file format.

42
Version commands
The version command prints the KiCad version. Without any arguments, it simply prints the version
number, for example 7.0.7 . You can print the version in several other formats using the --format
argument.

Use kicad-cli version --format about for version information to include when
NOTE
submitting bug reports or feature requests on Gitlab.

Usage: kicad-cli version [--help] [--format VAR]

Optional arguments:

--format <format> Format of the version number. Options are plain (default), commit , or
about . plain prints the version number (e.g. 7.0.7 ), which is the
default if the --format argument is not used. commit prints the hash of
the git commit for the build of KiCad you are using. about prints the full
version information, including library versions and basic system
information. You can use the about version information in bug reports.

43

You might also like