The CLI

Everything ships through the typecad-pcb binary that comes with @typecad/pcb. Every command takes --json for machine-readable output, --help for usage, and --version. Flags accept --flag=value or --flag value.

reference

commands

The full command list. Click through the sections below for the flags that matter per group.

Example first

CommandWhat it does
createScaffold a new project (interactive, or 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 into typeCAD TypeScript
diffVisually diff two boards — files or git revisions
docRender Markdown + a board into an HTML document
validateType-check and run the entry file without a full build
erc / drcRun the built-in electrical and design rule checks — --kicad for KiCad's own
checkBuild + unconnected pins + ERC + DRC in one pass, one report
diagnosticsBoard report: power tree, BOM, ERC/DRC summary
queryAsk a built board questions — nets, components, power
editSmall edits to a built board — connect, move, route
export gerbers / drillFabrication outputs — typeCAD's own writer, no KiCAD needed
skillsAI-assistant skill packs for coding with typeCAD
packageBrowse and install typeCAD packages from npm
doctorVerify the environment; --fix attempts automatic fixes
cleanRemove generated build output
reference

create / build

Project creation and the build loop. Build writes .kicad_pcb, .kicad_sch, .net, and the BOM .csv into ./build/.

Example first

create flagMeaning
--name=<name>Project name
--hal=<true|false>Also scaffold a typeCAD/hal firmware project (default false)
--git=<true|false>Initialize a git repository (default false)
--yesAccept defaults — needs --name for fully non-interactive use

build flags

FlagMeaning
[entry]Optional entry file override
--watch, -wRebuild on file changes
--outDir <dir>Output directory (default ./build/)
--skip-erc / --skip-drcWith --diagnostics: leave one check out of the report
--diagnosticsWrite a Markdown board report (--out=<file.md> names it)
--verboseChatty output
reference

add component / search

Finding parts and generating their class files. Passives never need this — they're built in. See Passives.

Example first

add component flagMeaning
--symbol_source=<kicad|local|jlcpcb>Where the symbol comes from
--footprint_source=<kicad|local|jlcpcb>Where the footprint comes from — can differ from the symbol source
--symbol= / --footprint=KiCAD library paths for --kicad
--c=<C###>JLCPCB part number for --jlcpcb
--folder=<path>Output directory (default: current directory)

search

FlagMeaning
<query>Fuzzy match against the KiCAD symbol libraries
--footprintSearch the installed footprint libraries instead — results show library:footprint and pad numbers
--format=<detailed|compact|table|json>Output style (default detailed)
--sort=<score|id|manufacturer|package>Result ordering (default score)
--limit=<n>Result count (default 5, footprints 10)
reference

checks

Validation at every level: type-check the source, run the electrical and design rule checks, or produce a full board report. The JSON shapes are stable — checks are CI-friendly.

Example first

CommandBehavior
erc / drc [path]One check; the board/schematic is auto-detected from ./build/
erc/drc --json{ passed, errors, warnings, ... } — exit code 1 on any failure
check [entry]build → unconnected → ERC → DRC, one report, non-zero exit on failure
diagnostics [entry | .kicad_pcb]Board report to --out=<file.md> (--skip-build, --skip-erc, --skip-drc)
doctorEnvironment check — Node, config, kicad-cli, libraries, Git; --fix repairs, --json for CI
validate [entry]Type-check and execute the entry without generating files
terminal
typecad-pcb drc --json
typecad-pcb query unconnected --json
reference

query / edit / export / skills

Working with built boards: read them, nudge them, fabricate them, and hand AI assistants the manuals.

Example first

CommandBehavior
query summary|nets|net <name>|components|component <ref>|unconnected|powerRead a built board — --json for machines
edit connect <a> <b> [...]Add a connection — pins as R1.1, nets by name
edit move <ref> --to x,y | --left-of <ref> [--gap mm]Move a part — relative placement included
edit route <from> <to> [--width mm] [--layers F.Cu,B.Cu]Route a pair; --dry-run previews, --file targets a source file
export gerbers | export drill -o <dir>Fabrication outputs (default ./build/gerbers/)
skills list | get <name> | search <query> | exportAI skill packs — --out defaults to .claude/skills
© 2026 typeCAD — code-defined electronics github