Use kicad cli

From FradSer/dotclaude · View interactive version

Use kicad cli is an AI agent skill from the GitHub repository FradSer/dotclaude. Drives the KiCad command-line interface (`kicad-cli`, version 9.0) to export schematics and PCBs, produce fabrication outputs, and run design checks. This skill should be used when the user asks to export gerbers, drill, or pick-and-place files, generate a BOM or netlist, run ERC or DRC (including i

How to use this skill

Skill file

Use kicad-cli

Generate fabrication, documentation, and 3D outputs from KiCad projects, and run electrical/design rule checks, by driving kicad-cli — KiCad 9.0's command-line tool. It has six command groups: sch (schematic), pcb (board), sym (symbols), fp (footprints), jobset (batch job sets), and version.

Process

  1. Identify which artifact the user wants (fabrication files, BOM, a check, a 3D model, a PDF, a library upgrade) and map it to a command group with the table below.
  2. Locate and verify the binary before running anything (see "Locating the binary"). Run kicad-cli version first to confirm it works.
  3. Load the matching reference file and use its exact flags. Do not invent flags — when unsure, run kicad-cli <group> <command> -h.
  4. Build the command, create any output directory first, then run it. Report the produced files (and, for checks, the exit code plus report path).

CRITICAL operating rules

Command map

| User wants | Command | Reference |

|---|---|---|

| Gerbers / drill / pick-and-place | pcb export gerbers / drill / pos | references/pcb-export.md |

| Board PDF / SVG / DXF | pcb export pdf / svg / dxf | references/pcb-export.md |

| 3D model (STEP/GLB/VRML/…) | pcb export step / glb / vrml | references/pcb-export.md |

| IPC-2581 / IPC-D-356 / ODB++ | pcb export ipc2581 / ipcd356 / odb | references/pcb-export.md |

| Board render (PNG/JPEG) | pcb render | references/pcb-export.md |

| Schematic PDF / SVG / DXF / PS / HPGL | sch export <fmt> | references/sch-export.md |

| BOM / netlist | sch export bom / netlist | references/sch-export.md |

| Design / electrical rule check | pcb drc / sch erc | references/checks.md |

| Symbol/footprint SVG or library upgrade | sym ... / fp ... | references/sym-fp-jobset.md |

| Reproducible batch of outputs | jobset run | references/sym-fp-jobset.md |

| End-to-end recipes | — | references/workflows.md |

Locating the binary

Try, in order: kicad-cli on PATH; macOS /Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli; Windows C:\Program Files\KiCad\9.0\bin\kicad-cli.exe. Assign the resolved path to a shell variable and reuse it:

KCLI=$(command -v kicad-cli || echo /Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli)
"$KCLI" version

If none works, tell the user KiCad 9.0 is not installed or ask for the install path.

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.