---
name: kicad-export
description: Generate deterministic KiCad ERC, DRC, fabrication, assembly, documentation, and 3D export outputs with kicad-cli.
title: kicad-export
canonical_url: https://skilld.dev/gh/backplaneworks/kistack/export
last_updated: 2026-11-12T17:11:33.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> 45 supporting files sit beside this SKILL.md. When the Skill refers to one, fetch https://skilld.dev/api/skills-raw/backplaneworks/kistack/export/PATH with PATH replaced.
>
> If the user asked to install this Skill, run `npx skilld install backplaneworks/kistack/export`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/export`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/backplaneworks/kistack/export) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/export`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/export --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/export --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

Run KiCad's CLI as plain `kicad-cli`. In Backplane that is the KiCad Backplane has selected: it is first on your PATH, and `$BACKPLANE_KICAD_CLI` names the same program. Never call a kicad-cli by another install's path (a stock `/usr/bin` or `~/.local/bin` one, a macOS KiCad.app, an old Backplane folder): its version and export behaviour differ. Check which KiCad you have with `kicad-cli version` before the first export.

Using kicad-cli, parse this documentation and use the necessary items to generate ERC/DRC reports, then proceed to create GERBERs, drill files, position files, and BOM files depending on the user's manufacturer. To make this deterministic, store your order of commands in a Python or bash script and modify it per-project.

JLCPCB and NextPCB require a specific format for their position files:
A .csv file with 5 columns: Designator, Mid X, Mid Y, Layer (T or B) and rotation
KiCad does not permit this, so please use the Python script under scripts/convert_position.py to do this. If the user does not have Python installed please inform them before making changes to their computer, unless they have already specified to use a virtual environment or you see one at the root of the project where this skill is being called.

JLCPCB BOMs also require an LCSC part number. Ensure that the JLCPCB BOM preset is available and if not inform the user that this needs to be added. 

Determine which PCB and scheamtic output commands you need to use (documentation is available under the references/ directory under this skill). For example, we often use this set of commands:

  kicad-cli version

  kicad-cli sch erc \
    --output build/<project>-erc.rpt \
    --format report --units mm \
    --severity-warning --severity-error \
    --exit-code-violations <project>.kicad_sch

  kicad-cli pcb drc \
    --output build/<project>-drc.rpt \
    --format report --units mm \
    --severity-warning --severity-error \
    --refill-zones --schematic-parity \
    --exit-code-violations <project>.kicad_pcb

  kicad-cli sch export pdf \
    --output build/schematic.pdf \
    [--variant <name>] [--theme <theme>] \
    <project>.kicad_sch

  kicad-cli sch export bom \
    --preset JLCPCB --format-preset CSV \
    --output build/bom_JLCPCB.csv \
    [--variant <name>] <project>.kicad_sch

  kicad-cli sch export bom \
    --preset NextPCB --format-preset CSV \
    --output build/bom_NextPCB.csv \
    [--variant <name>] <project>.kicad_sch

  kicad-cli sch export netlist \
    --format kicadxml \
    --output build/llm-review/netlist.xml \
    [--variant <name>] <project>.kicad_sch

  kicad-cli sch export netlist \
    --format kicadsexpr \
    --output build/llm-review/netlist.kicadsexpr \
    [--variant <name>] <project>.kicad_sch

  kicad-cli sch export bom \
    --output build/llm-review/components.csv \
    --fields Reference,Value,Footprint,Datasheet,DNP,EXCLUDE_FROM_BOM,EXCLUDE_FROM_BOARD \
    --labels Reference,Value,Footprint,Datasheet,DNP,ExcludeFromBOM,ExcludeFromBoard \
    --sort-field Reference \
    [--variant <name>] <project>.kicad_sch

  kicad-cli pcb export gerbers \
    --output build/gerbs \
    --layers <detected-layer-list> \
    --crossout-DNP-footprints-on-fab-layers \
    --sketch-DNP-footprints-on-fab-layers \
    --subtract-soldermask \
    --precision 5 <project>.kicad_pcb

  kicad-cli pcb export drill \
    --output build/gerbs \
    --format excellon \
    --drill-origin absolute \
    --excellon-units in \
    --excellon-zeros-format decimal \
    --gerber-precision 5 <project>.kicad_pcb

  kicad-cli pcb export pos \
    --output build/positions_raw.csv \
    --format csv --units mm \
    --side both --exclude-dnp \
    --use-drill-file-origin <project>.kicad_pcb

  kicad-cli pcb export pdf \
    --output build/pcb_layout \
    --layers <detected-layer-list> \
    --black-and-white \
    --crossout-DNP-footprints-on-fab-layers \
    --sketch-DNP-footprints-on-fab-layers \
    --include-border-title \
    --drill-shape-opt 2 \
    --mode-multipage <project>.kicad_pcb

  kicad-cli pcb export step \
    --output build/board.step \
    --force --subst-models --no-dnp \
    <project>.kicad_pcb

  kicad-cli pcb render \
    --output build/top.png \
    --width 1280 --height 720 \
    --background transparent --quality basic \
    --preset follow_pcb_editor \
    --light-top 0 --light-bottom 0 \
    --light-side 0.5 --light-camera 0 \
    --light-side-elevation 60 \
    --side top <project>.kicad_pcb

  kicad-cli pcb render \
    --output build/bottom.png \
    --width 1280 --height 720 \
    --background transparent --quality basic \
    --preset follow_pcb_editor \
    --light-top 0 --light-bottom 0 \
    --light-side 0.5 --light-camera 0 \
    --light-side-elevation 60 \
    --side bottom <project>.kicad_pcb

Unless otherwise specified by the user, DRC and ERC errors will result in you throwing a FAILURE to export. If there is a FAILURE you can prompt them: "Should we proceed with export? Please reply with OVERRIDE to restart."
