Public command

pcb

Runs PCB utility actions that share logic with plugin and daemon workflows.

Usage

kicad-cruncher pcb clean --write-config pcb.clean.config
kicad-cruncher pcb clean board.kicad_pcb --config pcb.clean.config --dry-run

Arguments

pcb clean accepts an optional .kicad_pcb or .kicad_pro input, --config for the JSONC cleanup config, --write-config to write the documented default config, --dry-run for a plan report, and --apply for explicit direct-file mutation.

Output

--write-config writes pcb.clean.config. Dry-run emits a deterministic JSON plan describing selected cleanup layers, layer user-name reset candidates, footprint/board/generated graphical candidate counts, and visible Value fields to hide. --apply writes the resolved board file in place, removes configured documentation-layer graphics, hides configured Value fields, and leaves copper, pads, models, routing, zones, and Edge.Cuts protected. Daemon/plugin usage shares the same planner but returns a mutation request for KiCad IPC application instead of editing a board file behind the editor.

Tests

L0 verifies command registration and help. L3 validates cleanup planning, direct-file apply behavior, daemon routing, and plugin-mode mutation request behavior against public PCB fixtures, including project-to-board resolution, layer reset candidates, footprint graphical removal, Value hiding, and config switches. L99 verifies the linked pcb_clean_config.v0 schema.