๐Ÿงฐ Getting started

typeCAD/pcb designs circuit boards in TypeScript: you write code, and the build produces a KiCAD project โ€” board, schematic, netlist, and BOM โ€” that you open in KiCAD for the final visual layout pass.

checklist

๐Ÿงฐ Requirements

Make sure your system has the required software. KiCAD and Node.js are the only hard requirements; everything else is optional depending on how you work.

Example first

SoftwareNotesLink
KiCADversion 10.0 โ€” required for the part libraries and the final layout pass; the build, checks, and gerber export run without itkicad.org
npm / Node.jsversion 18 or later โ€” requirednodejs.org
Visual Studio CodeNot required, but highly recommended โ€” new projects bundle the typeCAD/pcb extension (board viewer, pin hovers)code.visualstudio.com
typeCAD/halOptional โ€” firmware projects scaffolded by create use ittypecad.dev/hal/docs
gitOptional โ€” used for version control features; keep git in your PATHgit-scm.com
ngspiceOptional โ€” used for circuit simulations, see the Simulation pagengspice.sourceforge.io
command

๐Ÿ“ฆ Create a project

One command scaffolds a project. You'll be prompted for the project name, whether to also scaffold a typeCAD/hal firmware project (and its board target), and whether to create a git repository.

Example first

terminal
npx @typecad/pcb create

No install step โ€” npx fetches the package and scaffolds the project. The project is created in the current directory, including a VSCode workspace file โ€” open it and the project comes up ready to work. All the prompts can also be passed as flags:

non-interactive
npx @typecad/pcb create --name=typecad_project --git=false --hal=false

--help npx @typecad/pcb create --help

Lists every parameter for scripted project creation.

command

โžก๏ธ Build

Builds the project: runs the TypeScript entry file and generates the KiCAD outputs into ./build/. Run it from the hw/ directory, or click the build script in VSCode's NPM Scripts sidebar.

Example first

terminal
npx @typecad/pcb build

Project layout

PathWhat it is
hw/The project directory โ€” build commands run from here
hw/src/index.tsThe TypeScript entry file your board is defined in
hw/typecad.conf.tsOptional build configuration (entry, KiCAD paths, verbosity)
build/Generated output โ€” .kicad_pcb, .kicad_sch, .net, and BOM .csv
workflow

๐Ÿงฉ VSCode

Not required, but the recommended editor. The generated workspace file opens the project with everything wired up โ€” including the bundled typeCAD/pcb extension, installed workspace-scoped so it never touches your global setup. It adds pin hovers, a board viewer panel with Gerber and assembled-board views, and click-through cross-probing between board and source. The NPM Scripts sidebar also exposes the CLI as clickable scripts โ€” build and Add Component are the two you'll use constantly.

Example first

add a component
npx @typecad/pcb add component

What the extension gives you day-to-day โ€” hovers, viewer, cross-probing โ€” is covered on The VS Code extension page.

add component asks for the symbol/footprint source โ€” the installed KiCAD library, a local file, or an EasyEDA/JLCPCB C### part โ€” then generates a typed [component].ts file with usage instructions. There's no need to add passives (resistors, capacitors, etc.) this way โ€” they come built into @typecad/pcb.

reference

โŒจ๏ธ The CLI

All commands are accessed through the typecad-pcb binary that ships with @typecad/pcb. Every command supports --json for machine-readable output, --help for usage, and --version.

Example first

CommandWhat it does
createScaffold a new project (interactive, or fully scripted with flags)
buildRun the entry file and generate the KiCAD outputs into ./build/
add componentGenerate a component .ts file from KiCAD, a local file, or JLCPCB
add packageScaffold a reusable, publishable typeCAD package
searchFuzzy-search the KiCAD symbol libraries
importConvert an existing .kicad_pcb file into typeCAD TypeScript
diffVisually diff two KiCAD PCB files, netlists, and BOMs
docGenerate HTML documentation from Markdown and PCB files
doctorVerify the environment; --fix attempts automatic fixes
validateCheck source code without a full build
drc / ercRun the built-in design and electrical rule checks โ€” --kicad for KiCad's own
--json / --help / --versionGlobal options on every command

Something here unclear or out of date? Open an issue โ€” we'd rather hear about it.

ยฉ 2026 typeCAD โ€” code-defined electronics github