Skip to content

Start here: VS Code

You write MicroGoose programs in Visual Studio Code. VS Code checks the program as you type, and Ctrl+Shift+B builds it, flashes it to the board and shows what it prints. This page sets that up and shows the everyday moves. The tutorials after it use them.

VS Code with a MicroGoose traffic light program open, and below it the terminal showing the program's output from an ESP32 board after Ctrl+Shift+B

Ctrl+Shift+B: built, flashed to an ESP32, and its output below the program.

Install

You need Python 3.10 or newer and VS Code. Then open a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS and Linux) and run:

pip install microgoose
microgoose setup

setup downloads the Goose compiler and checks that your terminal can run the microgoose command. If it says the command is not on PATH, or that Windows blocks it, type python -m microgoose wherever these pages say microgoose. If pip itself stops with externally-managed-environment, Getting started shows the two ways around it.

Make a project

microgoose new hello
created hello/main.goose
editor:  wrote hello/.vscode/settings.json
editor:  wrote hello/.vscode/tasks.json
next:    microgoose run hello/main.goose --target s3   (or esp32, h7, pico2w)
         or open the folder hello in VS Code: Ctrl+Shift+B runs it
         (the Goose extension, once: code --install-extension C:\Users\you\.microgoose\goose\goose-v2026.5-windows-x64\vscode\goose-language.vsix)

The folder holds the program, main.goose, and a .vscode folder that tells VS Code how to check and run it.

The tasks build for the ESP32-S3. For another board, say which:

Board Command
ESP32-S3-DevKitC-1 microgoose new hello
ESP32 DevKit V1, or a WROOM-32 or WROVER-E module microgoose new hello --target esp32
STM32H743, over an ST-Link microgoose new hello --target h7

Install the Goose extension

Once, run the code --install-extension line that microgoose new printed. It names the extension on your computer: it comes with the Goose compiler that setup downloaded, and isn't in VS Code's Marketplace. Or, in VS Code, choose Extensions: Install from VSIX... from the Command Palette (Ctrl+Shift+P) and pick goose-language.vsix in the folder that line names.

Open the project

Open the folder in VS Code: File > Open Folder and pick hello, or from the terminal:

code hello

When VS Code asks whether you trust the authors of the files in this folder, choose Yes: VS Code checks and runs programs only in a folder you trust. Then click main.goose.

VS Code with a MicroGoose project open: the Explorer shows the folder with .vscode, diagram.json and main.goose, and the editor shows the program, starting with import mcu

A project open in VS Code. This one is the traffic light from tutorial 1.

Run it on your board

Plug the board in with a USB cable that carries data, and press Ctrl+Shift+B (Cmd+Shift+B on a Mac), or choose Terminal > Run Build Task. VS Code saves the file, and a terminal opens below the program: MicroGoose builds the firmware, flashes it, and shows what the program prints for 30 seconds. The board keeps running after that.

The first build takes several minutes while MicroGoose downloads the board's toolchain. After that, a build takes seconds.

If more than one board is plugged in, MicroGoose can't tell which one you mean and says so: unplug the others, or see Choosing the serial port.

See mistakes as you type

VS Code underlines a mistake while you type, before you build. Hover over the underline to read what's wrong, or open the Problems panel (Ctrl+Shift+M), where clicking a problem jumps to its line. The status bar at the bottom counts the errors.

VS Code underlining a misspelled function name, pin_writ, with the Problems panel below saying unknown function: pin_writ, at line 19

A misspelled pin_write, underlined, and listed in Problems.

A mistake that only the build finds shows up in Problems too, after Ctrl+Shift+B.

Look things up

Hover over a function to see what it takes and returns. Press F12 on it (or Ctrl+click) to open where it is defined. For the board's functions, that's MicroGoose's mcu.goose, which lists them all, with comments. Hardware API describes each one.

VS Code showing a tooltip over pin_write: extern fn pin_write(pin: i32, level: i32)

Hovering over pin_write.

The other tasks

Terminal > Run Task... lists the rest:

VS Code's Run Task list showing five MicroGoose tasks: build, files for Velxio, monitor the board, run in the emulator, and run on the board

Terminal > Run Task...
Task What it does
MicroGoose: run on the board build, flash and show the output: what Ctrl+Shift+B runs
MicroGoose: build build without flashing, to check that it compiles
MicroGoose: monitor the board restart the board and show its output again
MicroGoose: run in the emulator run the program with no board, in an emulator of the chip
MicroGoose: files for Velxio (velxio.dev) build for the Velxio browser simulator

No board?

Two tasks run a program without one:

  • MicroGoose: run in the emulator runs the same firmware in an emulator of the chip, QEMU for the ESP32s or Renode for the STM32H7, and shows what it prints in the terminal, as a board would. It doesn't show the pins. You install the emulator once: see No board: emulators.
  • MicroGoose: files for Velxio (velxio.dev) writes the files for Velxio, a free ESP32 simulator in your web browser, where you see LEDs light and click buttons. Tutorial 1 shows how to load them.

VS Code's terminal showing the traffic light program's output from the ESP32 emulator

The same program in the ESP32's emulator.

Change the board later

To make the tasks build for another board, run this in the project's parent folder, then reopen the folder:

microgoose vscode hello/main.goose --target esp32 --force

Run the same after upgrading MicroGoose, so the folder uses the new release's compiler. Editors says what the .vscode files hold, and how to use Neovim, Helix or Emacs instead.

Without VS Code

Every task is a microgoose command, so a terminal and any text editor work too: microgoose run hello/main.goose --target s3 is what Ctrl+Shift+B runs. The tutorials give both.

Next, tutorial 1 builds a traffic light.