On This Page (6)
CLI: Fabrication, vdoc, BOM/PnP & Micro-STEP
These kcr and native Rust k3 commands lower KiCad boards, projects, schematics, and footprint libraries through the shared FabView pipeline. Use them to produce Gerber/drill/IPC-2581B releases, baked KiCad vdoc layers, BOM/PnP/JLCPCB tables, and pure-Python/Rust Micro-STEP alignment models from one consistent geometry model.
Commands At A Glance
| Command | Config File | Purpose | Primary Inputs |
|---|---|---|---|
kcr fab (gerbz, ipc2581) | fab.jsonc | Analytic Gerber X2/X1, Excellon NC drill, IPC-2581B, virtual fab layers, PnP/BOM CSV, Micro-STEP, and opt-in --bake | .kicad_pcb, .kicad_pro |
kcr vdoc (virtual-doc) | <stem>.vdoc.jsonc / vdoc.jsonc | Safe doc-layer cleanup + baking of the 17 virtual layers into native KiCad graphics | .kicad_pcb, .kicad_pro, .kicad_mod, .pretty |
kcr bom | ./bom.config (CWD) | Multi-output grouped/raw BOM (JSON, CSV, formatted XLSX) with variants & DNP controls | .kicad_pro, .kicad_sch, .kicad_pcb |
kcr pnp | ./bom.config (CWD) | Pick-and-Place centroid tables (CSV, JSON, XLSX, jlc-cpl) in mm or mils | .kicad_pro, .kicad_pcb |
kcr jlc | ./bom.config (CWD) | JLCPCB BOM + CPL workbooks (strictly mm) with missing-LCSC terminal audit table | .kicad_pro, .kicad_pcb |
kcr pcb-layer-step | pcb-layer-step.jsonc | Colored, instanced ISO 10303-21 Micro-STEP fixture-alignment models (zero Geometer/OCCT) | .kicad_pcb, .kicad_pro |
kcr fab (gerbz, ipc2581)
Generates analytic fabrication deliverables from KiCadFabView (Python) or FabViewData (native Rust k3) driven by fab.jsonc (kicad_cruncher.fab_config.a0):
- Clean re-runs by default: removes stale Gerber and NC drill files from earlier runs of the same
<stem>(consulting<stem>.fab-report.jsonplus standard Gerber/Excellon extensions) and prints a per-layer status table with item counts, diagnostics, and timings. - KiCad-native defaults: emits copper, mask, paste, silkscreen,
.GM1board profile (with cutout callouts), Excellon NC drill/slot files, and configured virtual layers cleanly while keeping Altium-only films (pad_masters,keepout,drill_guide,drill_drawing) off by default. - Unified
"virtual_layers"block: component polarity overrides and visibility rules infab.jsoncare inherited read-only by siblingkcr vdoc,kcr pcb-svg, andkcr toonruns.
kcr fab --init-config --config fab.jsonc
kcr fab board.kicad_pcb -o output/fab
kcr gerbz board.kicad_pcb --virtual-layers CUTOUTS,PIN1_TOP,DIODES_TOP -o output/gerbers
kcr ipc2581 board.kicad_pcb -o output/ipc2581See kcr fab for the complete annotated fab.jsonc schema, alias precedence, --gerbers/--no-gerbers rules, and .GM1 extension collision guards.
kcr vdoc (virtual-doc)
Cleans legacy documentation-layer artwork using the shared kcr pcb clean engine (removing legacy F.Fab/B.Fab/User.* graphics and hiding visible Reference/Value fields without ever deleting mandatory fields, pads, 3D models, copper, Edge.Cuts, silkscreen, mask, paste, or *.CrtYd courtyards) and bakes any subset of the 17 virtual fab layers into native KiCad graphics grouped under Virtual_<LAYER_KEY> with readable User.N display names.
Three built-in layout presets (layer_preset in vdoc.jsonc or --preset on CLI):
- **
fab(default):F.Fab/B.Fabcarry both** assembly outlines and fitted designators;CUTOUTS,PIN1_*, andDIODES_*map toUser.1..User.5. fab-outlines:F.Fab/B.Fabcarry assembly outlines only; fitted designators move toUser.6/User.7.user-only: all virtual layers stay onUser.1..User.9(Eco1.User/Eco2.UserforPAD_LABELS_*), leavingF.Fab/B.Fabuntouched.
kcr vdoc --init-config --config vdoc.jsonc
kcr vdoc board.kicad_pcb --dry-run
kcr vdoc board.kicad_pcb -o baked.kicad_pcb
kcr vdoc board.kicad_pcb --preset fab-outlines -o baked.kicad_pcb
kcr vdoc MyParts.pretty -o MyParts_vdoc.pretty
kcr vdoc MyParts.pretty --fab-only -o MyParts_fab.pretty
kcr vdoc board.kicad_pcb --clean-only
kcr vdoc board.kicad_pcb --clear-onlySee kcr vdoc for board-vs-footprint auto-detection, config discovery, --map precedence, snapshot-before-clean safety ordering, and collision guards.
kcr bom, kcr pnp, and kcr jlc (bom.config)
All three assembly commands share one commented JSONC configuration schema (kicad_cruncher.bom.config.a0), discovered at ./bom.config in the current working directory (or via --config <path>):
kcr bomauto-creates./bom.configin config mode (when--formatis omitted) and writesraw-json+ formattedgrouped-xlsxplusbom.config.used.json.kcr pnpandkcr jlcnever auto-create./bom.config, reject standalone.kicad_schinputs, always exclude DNP parts from placement tables, and strictly requireunits == "mm"for any JLCPCB CPL output.kcr jlcprints a colorized missing-JLCPCB-Part-# table whenever any fitted grouped BOM line lacks an LCSC/JLCPCB part number.
kcr bom --write-config bom.config
kcr bom project.kicad_pro -o output
kcr pnp project.kicad_pro --units mm -o output
kcr jlc project.kicad_pro --all-variants -o outputSee kcr bom, kcr pnp, and kcr jlc for the full bom.config template and conflict rules.
kcr pcb-layer-step
Both Python kcr pcb-layer-step and native Rust k3 pcb-layer-step emit self-contained ISO 10303-21 Micro-STEP alignment models directly from FabView with zero Geometer or OpenCASCADE dependency:
- Exact analytic curves & assembly instancing: circular pads, vias, obrounds, arcs, and holes emit true analytic STEP
CIRCLE/CYLINDRICAL_SURFACEentities instanced across repeated footprints. - Multi-output fixture presets (
pcb-layer-step.jsonc): default output targetsB.Cuwith red-highlightedTP*test points, plated/non-plated drill rings, and yellow board-outline/cutout bodies.
kcr pcb-layer-step --init-config --config pcb-layer-step.jsonc
kcr pcb-layer-step board.kicad_pcb --layer F.Cu -o output/step
k3 pcb-layer-step board.kicad_pcb --layer F.Cu -o output/stepSee kcr pcb-layer-step for the full pcb-layer-step.jsonc schema, option merge ladder, and drill-color cascade.