CLI command design

pnp

Exports pick-and-place placement data from Altium projects using the shared BOM/PnP normalization layer for canonical parameter fields, stable sorting, JSON, CSV, XLSX, and JLC CPL output.

Usage

altium-cruncher pnp project.PrjPcb --format json -o output/pnp
altium-cruncher pnp project.PrjPcb --format csv
altium-cruncher pnp project.PrjPcb --format xlsx
altium-cruncher pnp project.PrjPcb --format jlc-cpl
altium-cruncher pnp project.PrjPcb --format jlc-cpl-xlsx
altium-cruncher pnp project.PrjPcb --position-mode component-origin
altium-cruncher pnp --write-config bom.config
altium-cruncher pnp project.PrjPcb --config bom.config

Arguments

file is a .PrjPcb. --format selects one legacy output format and overrides multi-output config mode. --config loads the shared BOM/PnP JSON or JSONC config; if omitted, bom.config in the working directory is used when present. --write-config writes a default editable JSONC config. Generated config comments are part of the public editing surface and follow ADR-0007: string/enum fields list accepted options in the field comment. --units selects mm or mils; JLC CPL output requires mm. --position-mode selects altium-pick-place or component-origin; the default uses Altium Monkey's documented Altium-compatible Pick Place position. --variant, --all-variants, and --exclude-no-bom control variant and component inclusion.

Output

Legacy output is written under the selected output directory. Config output uses shared output path templates and can emit json, csv, xlsx, jlc-cpl, and jlc-cpl-xlsx in one run. The generated default name template is {SourceStem}_{VariantName}{OutputKindSuffix}, so ordinary JSON/CSV/XLSX outputs rely on the file extension and do not add redundant _json or _csv stems; semantic outputs such as jlc-cpl-xlsx keep a _jlc-cpl stem. JSON includes normalized placement records with canonical fields, units, and selected position mode. JLC CPL outputs emit Designator, Layer, Mid X, Mid Y, and Rotation. Configured outputs write bom.config.used.json beside generated artifacts.

Tests

L3 verifies Hydroscope JSON generation. Unit tests cover placement normalization, top-before-bottom sorting, natural designator sorting, JSON payload shape, table rows, XLSX generation, and JLC CPL rows. Planned tests should use node_test_array for hierarchy, variant B4, sorting, and JLC CPL behavior.