kicad monkey v2026.11.30
On This Page (8)

kcr lib-extract

Extract cleaned symbols, footprints, metadata, and embedded STEP models from a KiCad project into a non-destructive lib_cruncher ingestion bundle.

CommandAliasesCategoryRuntimeConfigGuide
kcr lib-extractkcr library-extractProjects, Libraries & AssetsPython kcrNone (CLI flags only)—

Usage

sh
kcr lib-extract [-h] [-o OUTPUT]
    [--dedupe {name,fingerprint}]
    [--no-embed-models]
    [--no-embed-external-models]
    [--all-embedded-models]
    [--include-asset-scan]
    [--validate-kicad-cli]
    [--kicad-cli KICAD_CLI]
    [file]

Positional Arguments

ArgumentDescription
fileKiCad .kicad_pro project; optional when one .kicad_pro is in CWD

Options

FlagDescription
-o, --output OUTPUTOutput directory (default: ./output/lib-extract)
--dedupe DEDUPEDedupe policy for internal extraction. Choices: name, fingerprint.
--no-embed-modelsDo not copy board-level embedded model payloads into extracted footprints
--no-embed-external-modelsDo not embed resolvable external STEP/STP model references into extracted footprints
--all-embedded-modelsScan the full project and write every embedded STEP/STP payload to models/
--include-asset-scanInclude full project asset/model scan in library_extraction.json
--validate-kicad-cliValidate generated libraries with kicad-cli; project-lib apply mode also runs a before/after schematic ERC library-hygiene gate
--kicad-cli KICAD_CLIExplicit kicad-cli executable for --validate-kicad-cli

How It Works

kcr lib-extract (alias kcr library-extract) produces a lean, non-destructive library-ingestion bundle under -o <dir> (default ./output/lib-extract) tailored for downstream library catalog tools such as lib_cruncher.

It shares the exact extraction engine and model/validation flags with kcr megamaid, with three intentional differences:

When to Pick lib-extract vs megamaid vs project-lib

Flag Semantics & Validation

  1. --dedupe {name,fingerprint}: choose name-based (default) or structural fingerprint deduplication for internal extraction.
  2. Embedded 3D model controls: --no-embed-models skips copying board-level embedded STEP payloads into extracted .kicad_mod files; --no-embed-external-models skips resolving/embedding external STEP/STP files; --all-embedded-models writes every embedded STEP/STP payload found in the project into models/.
  3. --include-asset-scan: appends the full project asset/model scan into library_extraction.json.
  4. --validate-kicad-cli & --kicad-cli <PATH>: validates generated libraries via kicad-cli; returns exit code 1 on validation failure while keeping written files on disk.

Quick Examples

sh
# Extract embedded symbols/footprints from a project into local libraries
kcr lib-extract project.kicad_pro -o output/libs
kicad-monkey v2026.11.30·Docs updated 2026.12.01 15:43 UTC (fd9b75b)