🧰 Getting started

Write firmware in TypeScript. typeCAD/hal turns it into the C++ that runs on Zephyr boards — ESP32, nRF52, RP2040, STM32, and more. Common hardware mistakes are caught in your editor as you type, not after you upload, and the result runs as fast as hand-written code.

checklist

🧰 Requirements

Node.js is the only real requirement, and it works the same on Linux, macOS, and Windows (no WSL). No Python, conda, or SDK to set up first.

Example first

SoftwareNotesLink
Node.jsLTS version recommended — node --version to verifynodejs.org
Visual Studio CodeNot required, but recommended — the typeCAD/hal extension comes vendored into every projectcode.visualstudio.com
gitOptionalgit-scm.com
command

📦 Create your first project

One command scaffolds the project — config file, tsconfig wired to the board target, a blink starter, and dependencies installed. --target picks the board; the framework's full board catalog is fair game.

Example first

terminal
npx @typecad/hal create my-project
cd my-project

Then edit src/main.ts — this blinks the board LED, and it's the whole program. Construction carries the configuration; there is no setup() to write:

src/main.ts
import { GPIO, Time } from '@typecad/hal';
import { LED } from '@typecad/hal';

// Construction carries the configuration — there is no setup() to write.
const led = new GPIO(LED, GPIO.OUTPUT);

while (true) {
  led.toggle();
  Time.sleep(1000);
}
command

➡️ Compile and upload

One build command compiles the TypeScript to C++, builds the Zephyr image, and flashes it over the serial port.

Example first

terminal
npx @typecad/hal build --compile --upload --port COM4

Quick reference

TaskCommand
Create projectnpx @typecad/hal create my-project
Compilenpx @typecad/hal build --compile
Uploadnpx @typecad/hal build --upload --port COM4
Watch modenpx @typecad/hal build --watch --compile
Diagnosticsnpx @typecad/hal build --diagnostics
Check environmenttypecad-hal doctor

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

© 2026 typeCAD — code-defined electronics github