Git diff
Boards are text, so git already diffs them — but a line-level diff of a .kicad_pcb tells you nothing. typecad-pcb diff renders two boards
against each other: layer images to eyeball, plus netlist and BOM deltas, in one HTML report.
diff
Three ways to call it: two files, a git revision against the working tree, or two git revisions. Git forms extract the board from history with git show — no stash, no checkout.
Example first
file vs file
typecad-pcb diff original.kicad_pcb modified.kicad_pcbrevision vs working tree
typecad-pcb diff HEAD ./build/typecad_concepts.kicad_pcbrevision vs revision
typecad-pcb diff v1.0 v1.1 -- ./build/typecad_concepts.kicad_pcb| Flag | Meaning |
|---|---|
| --full | Include all layers — the standard set otherwise (User layers off) |
| --theme=<name> | SVG plot theme for the renders (default: the typeCAD house theme) |
| --output=<path> | HTML destination — default gitdiff-results.html next to the modified file |
What's in the report
| Section | Content |
|---|---|
| Layer renders | Every copper layer side by side — the HTML viewer offers side-by-side, overlay, onion-skin, diff-only, and swipe views |
| Netlist diff | Nets added, removed, and re-pinned between the two boards |
| BOM diff | Parts added, removed, changed, with values and footprints |
| Textual diff | The raw board file differences |
generateDiffs
The same comparison from code — build it into CI, a pre-merge check, or your own tooling. Requires KiCAD initialized first.
Example first
diff.ts
import { KiCAD } from '@typecad/pcb';
import { generateDiffs } from '@typecad/pcb/diff';
new KiCAD();
let html = await generateDiffs({
originalFile: 'original.kicad_pcb',
modifiedFile: 'modified.kicad_pcb',
fullMode: false,
theme: 'KiCAD Default',
});Returns the written HTML file's path. fullMode and theme mirror
the CLI flags.