CLI command design

libraries

Discover symbol and footprint names in Altium schematic and PCB libraries.

Usage

altium-cruncher libraries
altium-cruncher libraries mating_parts
altium-cruncher libraries C:\cad\parts --json
altium-cruncher libraries local_lib --no-recursive --absolute

Arguments

Positional roots may be .SchLib files, .PcbLib files, or directories. With no roots, the command scans the current directory. Directory scans are recursive by default; --no-recursive limits the scan to direct children. --json emits machine-readable JSON. --absolute keeps absolute paths in human output. --no-color disables terminal color.

Behavior

The command parses Altium schematic libraries for symbol names and PCB libraries for footprint names using the same scanner used by mate library resolution. Human output is optimized for command-line inspection: section headers include counts, names are aligned, and paths are relative to the current working directory when possible. JSON output uses schema altium_cruncher.libraries.scan.a0 and keeps absolute paths for automation.

Output

Human output has Symbols and Footprints sections. Each row contains the discovered name and the library file path. Parse warnings are listed separately without failing the full scan unless scanner setup itself fails.

Tests

Coverage lives in tests/test_mate.py. It verifies SchLib/PcbLib symbol and footprint discovery, relative-path human output, JSON schema output, and the compatibility path used by the mate planner.