Usage

kmake - collection of command line KiCad automation utilites. Program must be run in project workdir.

usage: kmake [-h] [--debug]
             {aux-origin,bom,clean,dnp,gerber,get-ignore,globlib,impedance,init-project,kibuzzard-to-graphic,loclib,logos,netlist,pcb-filter,pnp,prettify,rename,sch,set-drc,stackup-export,step,version,wireframe}
             ...

Named Arguments

--debug, --verbose, --dbg

increase verbosity, keep temp files

Default: False

Subcommands

subcommand

Possible choices: aux-origin, bom, clean, dnp, gerber, get-ignore, globlib, impedance, init-project, kibuzzard-to-graphic, loclib, logos, netlist, pcb-filter, pnp, prettify, rename, sch, set-drc, stackup-export, step, version, wireframe

To display help for specific subcommand use “kmake SUBCOMMAND -h”

Sub-commands

aux-origin

Set drill origin to bounding box corner or given x,y coordinate.

kmake aux-origin [-h] (-r | -s {tl,tr,bl,br} | -p x_pos y_pos)

Named Arguments

-r, --reset

Reset position of auxilary origin to (0,0).

Default: False

-s, --side

Possible choices: tl, tr, bl, br

Edge of the PCB bounding box to place aux origin, default: bl.

-p, --position

Position for aux origin to be placed.

bom

Generate Bill-of-Materials (BOM). Include ONLY populated components by default.Default format is default .None of the options include blacklisted components unless –no-ignore flag is passed.

kmake bom [-h] [-d | -a] [--no-ignore] [--fields FIELDS [FIELDS ...]] [-g]
          [-o OUTPUT]

Named Arguments

-d, --dnp

Include ONLY DNP components.

Default: False

-a, --all

Include populated and DNP components.

Default: False

--no-ignore

Don’t ignore blacklisted components.

Default: False

--fields

Change BoM field. Available fields: Reference Designators Reference Quantity Value Footprint Manufacturer Manufacturer Part Number MPN DNP Description. When not provided default setup is selected (Reference Quantity Value Footprint Manufacturer MPN)

-g, --group-references

Group references of components into single line

Default: True

-o, --output

Output file name

clean

Clean redundant project files from project’s directory.

kmake clean [-h]

dnp

Fix discrepancies between DNP, exclude-from-bom and exclude-from-board atributes in schematic symbols and footprints.

kmake dnp [-h] [-l] [-rp] [-sp] [-atp] [-rtp]

Named Arguments

-l, --list-broken

List references of malformed DNP schematic components, do not modify.

Default: False

-rp, --remove-dnp-paste

Remove solder paste from DNP components footprints.

Default: False

-sp, --restore-dnp-paste

Restore solder paste on DNP components footprints.

Default: False

-atp, --add-tht-paste

Add solder paste on THT components footprints.

Default: False

-rtp, --restore-tht-paste

Restore no solder paste on THT components footprints.

Default: False

gerber

Generate production files of PCB layers and drills in Gerber format.

kmake gerber [-h] [-e] [-x] [--drill-origin {absolute,plot}]

Named Arguments

-e, --noedge

Do not copy content of Edge.Cuts to other layers.

Default: False

-x, --excellon

Set drill file format to Excellon.

Default: False

--drill-origin

Possible choices: absolute, plot

Set drill file origin to absolute origin or plot (relative).

Default: 'absolute'

get-ignore

Copy .gitignore file from template.

kmake get-ignore [-h]

globlib

Link symbols and footprints to global libraries.

kmake globlib [-h] [--include-kicad-lib] [--exclude-pcb] [--update-all]
              [--update-properties] [-s [SCH ...]]

Named Arguments

--include-kicad-lib

Use also KiCad official libraries (if installed).

Default: False

--exclude-pcb

Do not propagate footprint links from schematic to PCB

Default: False

--update-all

Include symbols that already link to global libraries

Default: False

--update-properties

Update all properties of symbols/footprints based on global library

Default: False

-s, --sch

Specify list of schematic files to update, this option also enables –exclude-pcb

impedance

Generate impedance maps in Gerber format.

kmake impedance [-h]

init-project

Initialize KiCad project.

kmake init-project [-h] [-c COMPANY] -t [TITLE ...] [--force-title] [-s SIZE]
                   [-r]

Named Arguments

-c, --company

Company name.

-t, --title

Project title.

--force-title

Everride existing title.

Default: False

-s, --size

Page size, default A3.

Default: 'A3'

-r, --reload

Remove project info except: company name, page size, and project title

Default: False

kibuzzard-to-graphic

Convert Kibuzzard footprints to graphical polygons

kmake kibuzzard-to-graphic [-h]

loclib

Create local project library and link symbols/footprint/3D models to this library.

kmake loclib [-h] [-f] [-c]

Named Arguments

-f, --force, --force-override

Rewrite local library.

Default: False

-c, --cleanup, --cleanup-lib-symbols

Remove unrefferenced lib_symbols, footprints and 3D models.

Default: False

logos

Adds selected logo to the schematic.

kmake logos [-h] [-s SIZE] [-p PATH] [--list] [<logo file> ...]

Positional Arguments

<logo file>

Name of the logo file.

Named Arguments

-s, --size

Size of the logos.

Default: 180

-p, --path

Custom path to logos folder.

Default: '/home/runner/.local/share/kmake/logos/'

--list

List available logos.

Default: False

netlist

Create KiCad netlist file.

kmake netlist [-h]

pcb-filter

Create *.kicad_pcb

kmake pcb-filter [-h] [-o OUTFILE] [-i INFILE] [-c] [-x REF_FILTER]
                 [-xo REF_FILTER_OTHER] [-s {top,bottom}] [--std-edge] [-st]
                 [-d] [-t] [-z] [--vias] [-r] [-v] [-l ALLOWED_LAYERS]
                 [-lf ALLOWED_LAYERS_FULL] [--generate-frame]
                 [--std-dimension] [--mirror-bottom]

Named Arguments

-o, --outfile

Name of output file (defaults to filtred.kicad_pcb)

Default: 'filtred.kicad_pcb'

-i, --infile

Name of input file (defaults to {$PRO_NAME}.kicad_pcb)

-c, --cascade

If output file exists use it as input, simplifies cascaded calls

Default: False

-x, --ref-filter
Pattern based component filter

eg. -x “+J+D-D1” - remove components other than connectors(J) and diodes(D), diode D1 will also be removed, eg. -x=”-J-D+D1” - remove connectors(J) and diodes(D), other components and diode D1 will left untouched (note = when first character is -)

-xo, --ref-filter-other

–ref-filter filter used on side opposite to –side

-s, --side

Possible choices: top, bottom

Leave only components from selected layer

--std-edge

Copy edge.cuts from footprints to pcb; Set all Edge.Cuts graphics thickness

Default: False

-st, --stackup

Remove stackup table

Default: False

-d, --dimensions

Remove dimensions (dimmensions should be added on User.Drawings layer)

Default: False

-t, --tracks

Remove tracks

Default: False

-z, --zones

Remove cooper & keepout zones

Default: False

--vias

Remove vias

Default: False

-r, --references

Remove footprint references

Default: False

-v, --values

Remove footprint values

Default: False

-l, --allowed-layers

Remove all graphic/footprint elements except those on specified layers (leaves knockout text untouched)

-lf, --allowed-layers-full

Remove all graphic/footprint elements except those on specified layers (removes also knockout text)

--generate-frame

Generate output that is rectangle created from board outline b-box expanded by 60mm

Default: False

--std-dimension

Standardize/add main dimensions

Default: False

--mirror-bottom

Mirror text if side is bottom

Default: False

pnp

Create footprint position files.

kmake pnp [-h] [-t] [-v] [-o] [-e]

Named Arguments

-t, --tht

Include THT components in output.

Default: False

-v, --virtual

Include Virtual components in output.

Default: False

-o, --other

Include Other type components in output.

Default: False

-e, --excluded

Include components excluded from position files in output.

Default: False

prettify

Pretify files to conform with KiCad formatter

kmake prettify [-h]

rename

Rename project files.

kmake rename [-h] <new_name>

Positional Arguments

<new_name>

New name of project.

sch

Generate schematics in PDF format.

kmake sch [-h] [-t [THEME]]

Named Arguments

-t, --theme

Theme to use for the schematic (default: schematic settings).

Default: ''

set-drc

Sets DRC and custom DRC rules from provided template.

kmake set-drc [-h] [-s [S]] [--no-dru] [-u [U]]

Named Arguments

-s

Manufacturer DRC rules set.

Default: ''

--no-dru

Do not set custom rules.

Default: False

-u

Set custom rules only.

Default: ''

stackup-export

Export stackup information to file.

kmake stackup-export [-h] [-o OUTPUT_FILENAME] [--legacy-csv]

Named Arguments

-o

Change export file name/location.

--legacy-csv

Export as csv with legacy format.

Default: False

step

Export 3D models of PCB in STEP format.

kmake step [-h]

version

Print kmake, kiutils & kicad version

kmake version [-h]

wireframe

Split outline layer to top/bottom and optionally export it as .svg and .gbr files.

kmake wireframe [-h] [-r] [-i INPUT]
                [-p {simple,dimensions,descriptions,assembly_drawing,margin_frame}]
                [-sr] [-f PCB_FILTER_ARGS] [-a] [-x REF_FILTER]
                [-xo REF_FILTER_OTHER]

Named Arguments

-r, --reset

Reset layer of outline items to User.9 .

Default: False

-i, --input

Use specified *.kicad_pcb file as input

-p, --preset

Possible choices: simple, dimensions, descriptions, assembly_drawing, margin_frame

Generate SVG according to preset

-sr, --set-ref

Set footprint references to certain state (reset position, set size, ..)

Default: False

-f, --pcb-filter-args
Additional arguments to be passed to pcb-filter;

(overrides argument value from preset, unless –pcb-filter-args-append specified) eg. -f ‘{“allowed_layers”:”+J+D-D1”}’

Default: {}

-a, --pcb-filter-args-append
Lists/strings, that are passed to pcb-filter (pcb-filter-args, ref-filter, ref-filter-other)

will be appended to ones defined in preset

Default: False

-x, --ref-filter
Argument passed to pcb-filter: Pattern based component filter

eg. -x “+J+D-D1” - remove components other than connectors(J) and diodes(D), diode D1 will also be removed, eg. -x=”-J-D+D1” - remove connectors(J) and diodes(D), other components and diode D1 will left untouched (note = when first character is -)

-xo, --ref-filter-other

Argument passed to pcb-filter: –ref-filter filter used on side opposite to –side


Last update: 2025-03-21