Getting Started with Cuttlefish
Write firmware in TypeScript. Cuttlefish turns it into the C++ that runs on Arduino and ESP32 boards.
About Cuttlefish
Cuttlefish is a tool that turns TypeScript into firmware for small, low-cost computers like Arduino and ESP32 boards.
- You write firmware in TypeScript, and Cuttlefish turns it into the C++ the board runs
- It checks your code for common hardware mistakes as you type, not after you upload
- The result runs as fast as hand-written code, with nothing extra slowing it down
- You can write tests in TypeScript and run them on the real board
- It works with typeCAD, which lets you design the circuit board itself in code
Quick Start
Install Node.js
- Download and install Node.js (LTS version recommended)
- Verify:
node --version
Create Your First Project
npx cuttlefish create my-project --target arduino-uno cd my-project npm installWrite Firmware Edit
src/sketch.ts:import { D13 } from '@typecad/board-arduino-uno'; const led = D13.asOutput(); // In setup — nothing needed // In loop — toggle the LED led.toggle();Compile and Upload
npx cuttlefish build --compile --upload --port COM4
Next Steps
- GPIO & Digital I/O — Pin modes, read/write, toggle
- Communication Buses — I2C, SPI, UART
- Ownership Model — How peripherals are safely managed
- CLI Reference — Full command reference
- Examples — Ready-to-run firmware examples
Quick Reference
| Task | Syntax |
|---|---|
| Create project | npx cuttlefish create my-project --target arduino-uno |
| Compile | npx cuttlefish build --compile |
| Upload | npx cuttlefish build --upload --port COM4 |
| Watch mode | npx cuttlefish build --watch --compile |
| Diagnostics | npx cuttlefish build --diagnostics |