kicad monkey v2026.11.30
On This Page (9)

kcr health

Scan a KiCad project for local assets, embedded model references, external STEP/STP references, and missing model payloads.

CommandAliasesCategoryRuntimeConfigGuide
kcr health—Projects, Libraries & AssetsPython kcrNone (CLI flags only)—

Usage

sh
kcr health [-h] [-o OUTPUT] [--fail-on-issues]
    [--require-embedded] [--show-exempt] [--show-all]
    [--json] [--no-color]
    [file]

Positional Arguments

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

Options

FlagDescription
-o, --output OUTPUTOutput directory (default: ./output/health)
--fail-on-issuesReturn a nonzero exit code when diagnostics or missing models are found
--require-embeddedTreat resolved external 3D models as issues (enforce embedded portability)
--show-exemptList expected model-less footprints (test points, fiducials, mounting holes, DNP)
--show-allShow every table row instead of truncating after 15 rows
--jsonAlso print the machine-readable JSON report to stdout
--no-colorDisable ANSI colors and animated spinners

How It Works

kcr health is a 100% read-only asset and 3D-model portability auditor for KiCad projects (.kicad_pro). It scans schematics, PCBs, footprints, library tables, and 3D model references, then writes:

Pass --json to also print the complete project_health.json payload to stdout for CI scripts and agents.

Issue Classification & Promotion Rules

kcr health cleanly separates hard portability issues (ok: false), non-fatal warnings, and expected exemptions:

FindingDefault StatusWith --require-embeddedNotes
Missing embedded payload (kicad-embed:// absent from embedded_files)Issue (missing_embedded_payload)IssueBroken reference inside .kicad_pcb/.kicad_mod
Unresolved external model fileIssue (missing_or_unresolved_model)IssueExternal path does not resolve on disk
Resolved external STEP/STP modelWarning / informationalPromoted to Issue (external_model_reference)Enforces self-contained CI portability; fix with kcr pcb embed-models
Resolved .wrl-only model (no .step/.stp sibling)Warning onlyPromoted if external (external_model_reference)WRL-only by itself is a warning (not a hard error) when embedded; Geometer 3D HLR requires STEP
Actionable footprint missing a visible 3D modelIssue (footprint_without_model)Issue (footprint_without_model)Grouped by footprint + PCB; hidden-only models are flagged
Exempt model-less footprintExempt (hidden unless --show-exempt)ExemptSee exemption rules below

Exempt Model-Less Footprints

Footprints without visible 3D models are automatically classified as exempt (never cluttering actionable issues) when they match any of:

Exit Codes & CI Gating

  1. Default behavior: returns exit code 0 even when issues are found (so interactive audits can inspect the full report).
  2. --fail-on-issues: returns exit code 1 whenever report["ok"] is false (any scan diagnostic or portability issue — including missing_embedded_payload, missing_or_unresolved_model, footprint_without_model, and external_model_reference when --require-embedded is also set).
  3. Table truncation: terminal tables cap at 15 rows by default; pass --show-all to print every row and --show-exempt to include the exempt model-less table.

Quick Examples

sh
# Audit embedded vs external STEP/STP references and missing payloads
kcr health project.kicad_pro --fail-on-issues
sh
# Fail if any board/footprint model is still external instead of kicad-embed://
kcr health project.kicad_pro --require-embedded --fail-on-issues
kicad-monkey v2026.11.30·Docs updated 2026.12.01 15:43 UTC (fd9b75b)