The CLI

Everything ships as typecad-hal — run it through npx @typecad/hal or install it. The whole toolchain is one binary: the daily loop is create, build, test.

reference

commands

The full command list. Global options: --help, and the port can always come from the TYPECAD_HAL_PORT environment variable.

Example first

CommandWhat it does
typecad-hal create [name]Scaffold a project for a board target
typecad-hal buildTranspile, and with flags compile, upload, monitor
typecad-hal test [files...]Flash and run hardware tests
typecad-hal board sync | regenRebuild the board catalog / regenerate the board module
typecad-hal previewBrowser preview of a UI screen
typecad-hal doctorVerify the toolchain (west, SDK, board target)
typecad-hal licensesSPDX audit of the Zephyr tree and its projects
typecad-hal sbomEmit/verify the build-true SBOM (CycloneDX 1.6 or SPDX 2.3)
typecad-hal auditSecurity baseline over the last build’s merged Kconfig + devicetree
typecad-hal trace capture | report | viewRuntime trace: record the board, summarize it, serve the live timeline
typecad-hal library search | install | init | validateThe library-package catalog
typecad-hal queryAsk the board module questions
typecad-hal gen-declsGenerate .d.ts from C++ headers
typecad-hal cleanRemove generated output
typecad-hal debug-server start | stopDrive the west GDB server for debugging
terminal
typecad-hal create my-project --target xiao_ble/nrf52840
typecad-hal build --compile --upload --monitor --port COM4
reference

build

The transpile-and-flash pipeline. Flags chain: --compile builds, --upload flashes, --monitor watches the serial port. Most flags have sensible defaults; the config file covers the rest.

Example first

FlagMeaning
--compileRun west build
--uploadFlash — requires --compile
--monitorAttach a serial monitor after upload — waits out post-flash re-enumeration instead of racing it
--watch, -wRebuild on changes (not combinable with --monitor)
--expect [file]Run hardware tests after the build
--port / --baudSerial port for upload/monitor/tests
--diagnosticsWrite the build report (Markdown/JSON)
--debugNative GDB source-level debugging (F5 in VS Code) — boards without a debug probe fail with debug-unsupported-target
--forceBypass the cached lint gate
--skip-type-check / --no-transpilePartial runs for special cases

Tree-shaking

Unused code never reaches the board — reachability from the entry point decides. Flags override:

FlagMeaning
--no-tree-shakeKeep everything
--keep-unused-enums / -classes / -types / -variablesKeep one category
--entry-point <name>Additional entry point — repeatable

Everything else

FlagMeaning
--autosar[=off|warn|strict]AUTOSAR C++14 checks on the generated code (bare flag = strict)
--autosar-arxmlEmit the deviation file for ARXML consumers
--strict-cssUI CSS warnings become errors
--emit cpp | splitSingle file or per-source split (default split)
--emit-maps / --build-target / --frameworkSource maps, target override, framework override
reference

create

Scaffolds a project: config file, tsconfig wired to the board module, a blink starter, and tests — installed and ready to build.

Example first

FlagMeaning
--target, -t / --board, -bThe board target, e.g. xiao_ble/nrf52840
--framework, -fFramework package (default: @typecad/framework-zephyr)
--probe, --flash <id>Named probe method — stlink, jlink, dfu, uf2...
--port, -p / --baudSerial defaults for the project
--no-starter / --no-installSkip the blink starter / skip npm install
--outDir, -oWhere the project goes
© 2026 typeCAD — code-defined electronics github