On This Page (6)
KiCad Cruncher CLI (kcr)
kicad-cruncher (short alias kcr) is the command-line companion to kicad-monkey for headless KiCad automation. It bundles manufacturing releases (Gerber X2/X1, Excellon NC drill, IPC-2581B, Micro-STEP, BOM/PnP/JLCPCB), virtual documentation baking (vdoc), 3D-projected PCB SVG and Toon rendering, agent-first design-review packages, library extraction, 3D STEP embedding, and KiCad workstation helpers into one consistent CLI.
Install & Entry Points
uv tool install kicad-cruncher
uv tool update-shell
kcr versionInstalling kicad-cruncher provides two identical Python entry points:
kcr— short primary alias (kcr fab,kcr vdoc,kcr pcb-svg,kcr toon,kcr dr, …)kicad-cruncher— full CLI name
Native Rust CLI Parity (k3) Ten core commands (fab, vdoc, bom, pnp, jlc, pcb-layer-step, pcb-svg, toon, design, version) also ship in the standalone zero-Python Rust binary k3 (kicad-cruncher-cli), sharing the same JSONC configs and output schemas. See the Native Rust CLI (k3) Parity Guide for the full command matrix and flag-level differences.
CLI Workflow Map
| Guide | Commands Covered | Typical Use |
|---|---|---|
Fabrication, vdoc & Micro-STEP | fab (gerbz, ipc2581), vdoc, bom, pnp, jlc, pcb-layer-step | Analytic Gerber X2/X1, NC drill, IPC-2581B, virtual-layer baking into boards or .pretty libraries, BOM/PnP/JLCPCB tables, and pure-Python/Rust Micro-STEP alignment models |
| PCB SVG, Toon & Design Review | pcb-svg, toon, design (dr) | Composable physical + virtual PCB SVGs, shaded 3D-projected Toon board renders, and agent-first D0 design-review bundles |
Native Rust CLI (k3) Parity | All 10 dual-runtime commands + 7 Python-only commands | Exact comparison of kcr vs k3 flags, output formats, and config inheritance |
| Full Command Reference | All 17 core commands including project, project-lib, health, megamaid, lib-extract, pcb, kicad, version | One dedicated page per command with live argparse options, annotated JSONC configs, and conflict/precedence rules |
Configuration Files (JSONC)
Config-driven commands accept commented JSONC (//, /* ... */, trailing commas) that can be committed right alongside your .kicad_pro and .kicad_pcb:
| Config File | Schema | Commands | Discovery & Auto-Creation | Starter Command |
|---|---|---|---|---|
fab.jsonc | kicad_cruncher.fab_config.a0 | fab, gerbz, ipc2581 (inherited read-only by vdoc, pcb-svg, toon) | Sibling <pcb_dir>/fab.jsonc; auto-creates unless --dry-run (--config errors if missing) | kcr fab --init-config --config fab.jsonc |
<stem>.vdoc.jsonc (or vdoc.jsonc) | kicad_cruncher.vdoc_config.a0 | vdoc (virtual-doc) | Boards: <stem>.vdoc.jsonc -> vdoc.jsonc -> auto-create (unless --dry-run). Footprints: <root>/vdoc.jsonc -> <parent>/vdoc.jsonc -> defaults (never auto-creates) | kcr vdoc --init-config --config vdoc.jsonc |
bom.config | kicad_cruncher.bom.config.a0 | bom, pnp, jlc | ./bom.config in CWD (not beside input). bom auto-creates in config mode; pnp and jlc never auto-create | kcr bom --write-config bom.config |
pcb-layer-step.jsonc | kicad_cruncher.pcb_layer_step.config.a0 | pcb-layer-step | <input_dir>/pcb-layer-step.jsonc (or --config); auto-creates if missing | kcr pcb-layer-step --init-config --config pcb-layer-step.jsonc |
<stem>.pcb.svg.config (or pcb.svg.config) | kicad_cruncher.pcb_svg.config.a0 | pcb-svg | <stem>.pcb.svg.config -> pcb.svg.config -> auto-creates with generated board components | Auto-created on first kcr pcb-svg run |
toon.config | kicad_cruncher.pcb_svg.config.a0 | toon | <board_dir>/toon.config (or --config); auto-creates with resolved preset + theme | kcr toon --write-config toon.config |
project-create.jsonc | KiCadProjectCreateOptions | project create | Explicit --config only (never auto-discovers) | kcr project create --emit-config project-create.jsonc |
pcb.clean.config | kicad_cruncher.pcb.clean.config.a0 | pcb clean | Explicit --config only (never auto-discovers) | kcr pcb clean --write-config pcb.clean.config |
Python kcr fab, kcr vdoc, kcr pcb-svg, and kcr toon share one unified "virtual_layers" configuration block through sibling fab.jsonc inheritance.
Output & Write Policy
- Output-producing commands accept
-o/--output <dir>and default to./output/<command>/, with five intentional exceptions:kcr vdocedits the.kicad_pcb,.kicad_mod, or.prettylibrary in place (writing.bakbackups unless--no-backupor-o <path>is passed).kcr pcb embed-modelsedits the.kicad_pcbor.kicad_modin place by default (pass--dry-run,--backup, or-o <path>; refuses in-place writes if KiCad.lcklock files exist). Conversely,kcr pcb cleanis dry-run/plan by default and requires--apply.kcr project-libdefaults to./local-library.kcr designdefaults to./output/design_review.kcr bom(config mode) andkcr jlcdefault to./output+{Command}template (sojlcwrites to./output/jlc, matching native Rustk3 jlc).
Common Workflows
# 1. Manufacturing release package (Gerber X2, NC Drill, IPC-2581B, PnP, BOM, Micro-STEP)
kcr fab board.kicad_pcb --ipc2581 --pnp --bom --micro-step -o output/fab
# 2. Bake virtual documentation layers onto F.Fab/B.Fab & User.* (boards or .pretty libraries)
kcr vdoc board.kicad_pcb --dry-run
kcr vdoc board.kicad_pcb -o baked.kicad_pcb
kcr vdoc MyParts.pretty --fab-only -o MyParts_fab.pretty
# 3. Audit 3D model portability and embed external STEP models natively (KiCad 10.0.8 format)
kcr health project.kicad_pro --require-embedded --fail-on-issues
kcr pcb embed-models board.kicad_pcb --backup
# 4. Configured PCB SVG, shaded Toon renders, and agent-first design review
kcr pcb-svg board.kicad_pcb -o output/pcb-svg
kcr toon board.kicad_pcb --side top --theme green -o output/toon
kcr dr project.kicad_pro -o output/review
# 5. Fast Micro-STEP 3D alignment model (zero Geometer/OCCT dependency)
kcr pcb-layer-step board.kicad_pcb --layer B.Cu -o output/step
# 6. BOM, Pick-and-Place, and JLCPCB upload bundle
kcr bom project.kicad_pro -o output
kcr pnp project.kicad_pro -o output
kcr jlc project.kicad_pro -o output