pin
The kilm pin command adds specified symbol and/or footprint libraries to KiCad’s “Pinned Libraries” list, making them easily accessible in the symbol and footprint choosers.
It operates by modifying the pinned_symbol_libs and pinned_fp_libs arrays within KiCad’s kicad_common.json configuration file.
Note: Changes require restarting KiCad.
kilm pin [OPTIONS]Options
Section titled “Options”-
--kicad-lib-dir TEXT: Specify the path to the KiCad library directory containing the libraries you want to pin. If not provided, KiLM will look for theKICAD_USER_LIBenvironment variable. This directory is scanned to find available libraries if--allis used or to validate specified library names. Default: UsesKICAD_USER_LIBenvironment variable. Example:kilm pin --kicad-lib-dir /path/to/libs -s MyLib -
-s, --symbols TEXT: Specify the name of a symbol library (.kicad_symfile, without extension) to pin. Use this option multiple times to pin several libraries. Example:kilm pin -s Device -s MyCustomSymbols -
-f, --footprints TEXT: Specify the name of a footprint library (.prettydirectory, without extension) to pin. Use this option multiple times to pin several libraries. Example:kilm pin -f Package_SO -f MyCustomFootprints -
--all / --selected: Determines which libraries to pin.--all(Default): Pins all symbol and footprint libraries found within the directory specified by--kicad-lib-dir. Cannot be used if-sor-fare specified.--selected: Pins only the libraries explicitly listed using-sor-f. This is implicitly active when-sor-fare used. Example (pin all):kilm pin --all
-
--dry-run: Show which libraries would be added to the pinned list without actually modifyingkicad_common.json. Example:kilm pin --all --dry-run -
--max-backups INTEGER: Maximum number of timestamped backups KiLM should keep forkicad_common.json. Default:5. Example:kilm pin --max-backups 3 -
-v, --verbose: Show detailed output during the pinning process, including listing libraries found and pinned. Example:kilm pin -s MyLib --verbose -
--help: Show this help message and exit.
Behavior
Section titled “Behavior”- Locates the KiCad configuration directory and
kicad_common.json. - Determines the target library directory using
--kicad-lib-dirorKICAD_USER_LIB. - If
--allis active (default and no-s/-f), lists all symbol/footprint libraries in the target directory. - If specific libraries are provided via
-s/-f, validates they exist in the target directory (issues a warning if not found). - Creates a backup of
kicad_common.json(unless--dry-run). - Reads the current pinned lists from
kicad_common.json. - Adds the names of the determined libraries (all or selected) to the respective lists.
- Writes the updated lists back to
kicad_common.json(unless--dry-run).
Examples
Section titled “Examples”Pin specific libraries:
kilm pin -s MySymbolLib -s AnotherLib -f MyFootprintLibPin all libraries found in the default directory:
(Assumes KICAD_USER_LIB is set)
kilm pin --all# Or simply:kilm pinPin all libraries in a specific directory:
kilm pin --kicad-lib-dir /path/to/company/libs --allPreview pinning all libraries:
kilm pin --all --dry-runPin specific libraries with verbose output:
kilm pin -s Device -f Resistor_SMD -v