use-kicad-cli

Drives kicad-cli to export KiCad fabrication files, BOMs, 3D models, and run ERC/DRC checks.

588|49|Updated Aug 4, 2025
One-click install
npx skills add https://github.com/FradSer/dotclaude --skill use-kicad-cli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: use-kicad-cli
Source: https://github.com/FradSer/dotclaude/tree/main/hardware/skills/use-kicad-cli
Command: npx skills add https://github.com/FradSer/dotclaude --skill use-kicad-cli

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Generating fabrication outputs and running design checks from KiCad projects requires memorizing dozens of kicad-cli subcommands, flags, and platform-specific quirks, and mistakes like missing --exit-code-violations cause CI checks to silently pass despite violations.

Core Features & Use Cases

  • Fabrication Output Generation: Export gerbers, drill files, pick-and-place files, BOMs, and netlists from .kicad_pcb and .kicad_sch files with correct flags and output semantics.
  • Design Rule Checking in CI: Run pcb drc and sch erc with --exit-code-violations so violations produce exit code 5, with a ready-made gating pattern for GitHub Actions using the official kicad/kicad:9.0 Docker image.
  • Documentation and 3D Exports: Produce schematic PDFs, board renders, STEP/GLB/VRML 3D models, and reproducible multi-output builds via jobset run.
  • Use Case: A hardware engineer needs a complete fab package before sending a board to manufacturing; the skill locates the kicad-cli binary, exports gerbers and drill files to a directory, generates the pick-and-place CSV and BOM, and reports every produced file.

Quick Start

Ask the assistant to export gerbers, drill files, and a BOM from your KiCad board project into a fab folder using kicad-cli.

Frequently Asked Questions about use-kicad-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I export gerbers from KiCad using the command line?

Use kicad-cli pcb export gerbers with -o pointing to an output directory and -l listing the layers, for example F.Cu,B.Cu,F.Mask,B.Mask,Edge.Cuts. The plural gerbers command replaces the deprecated singular gerber command removed in KiCad 10.0.

How do I run KiCad DRC and ERC in CI and fail on violations?

Pass --exit-code-violations to kicad-cli pcb drc and sch erc so they exit with code 5 when violations exist; without it they exit 0 even with violations. Run inside the official kicad/kicad:9.0 Docker image and treat exit 5 as violations and other non-zero codes as tool errors.

Where is the kicad-cli binary located on macOS?

On macOS kicad-cli is not on PATH; it lives at /Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli. On Linux it is typically on PATH, and on Windows it is kicad-cli.exe in the KiCad bin folder. Confirm with kicad-cli version before building a pipeline.

Can kicad-cli generate a BOM with quantity grouping?

Yes, kicad-cli sch export bom supports --fields, --group-by, --exclude-dnp, and custom delimiters, outputting a CSV file. Single-quote field variables like ${QUANTITY} so the shell does not expand them before KiCad receives them.

Why does kicad-cli fail in headless CI environments?

Some kicad-cli operations expect an X display even though the tool generally runs headless. The robust patterns are running inside the official kicad/kicad:9.0 Docker image or starting Xvfb on display :99 and exporting DISPLAY=:99.

How do I export a STEP 3D model from a KiCad board?

Use kicad-cli pcb export step with -o specifying the output file. Useful flags include --subst-models to use STEP component models, --no-dnp to exclude do-not-populate parts, and --force to overwrite existing files.