Documentation
Onboarding
Getting Started
Power & Battery
Hardware & Components
Build & Assembly
Radio & RF Design
Frequencies & Regulations
Firmware & Software
USB & Connectivity
GPS & Navigation
Morse & Communication
Modes & Operation
Field Operations & Rescue
Building Effectively
Build Variants
Project & Reference
Docs Firmware & Software Arduino CLI Guide

Arduino CLI Guide

Edit on GitHub

Building the firmware with the Arduino CLI instead of PlatformIO: setup, board package, compile, and flash commands.

Arduino CLI Guide

PlatformIO is recommended, but the Arduino CLI is the official, scriptable alternative: lighter, closer to the Arduino IDE, and fine for anyone who prefers the toolchain the Arduino world ships.

Setup

CODE
arduino-cli config init
arduino-cli core update-index
arduino-cli core install esp32:esp32

The ESP32 core package is large; the install takes a few minutes.

The daily commands

CommandPurpose
arduino-cli board listList connected boards
arduino-cli compile --fqbn esp32:esp32:esp32Build
arduino-cli upload -p <port> --fqbn ...Flash
arduino-cli monitor -p <port> -c baudrate=115200Serial monitor

Library management

CODE
arduino-cli lib install "<library>@<version>"

Pin versions exactly as PlatformIO does: @2.1.0 style, not bare names. The libraries used are listed in the Software Build Process page.

The differences from PlatformIO

AspectArduino CLIPlatformIO
Board configIn --fqbn flagsIn platformio.ini
EnvironmentsScripted by youFirst-class
Unit testsNot built inpio test
CI integrationManualNative

If you are happy with one, stay with it; both produce the same firmware. Switch only if a specific feature (tests, environments) pulls you.