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

  1. Install Node.js

    • Download and install Node.js (LTS version recommended)
    • Verify: node --version
  2. Create Your First Project

    npx cuttlefish create my-project --target arduino-uno
    cd my-project
    npm install
  3. Write 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();
  4. Compile and Upload

    npx cuttlefish build --compile --upload --port COM4

Next Steps

Quick Reference

TaskSyntax
Create projectnpx cuttlefish create my-project --target arduino-uno
Compilenpx cuttlefish build --compile
Uploadnpx cuttlefish build --upload --port COM4
Watch modenpx cuttlefish build --watch --compile
Diagnosticsnpx cuttlefish build --diagnostics