Arduino Command Line Interface

Quick reference for Arduino CLI

This page serves as a quick reference for the Arduino CLI commands I use most frequently. I’ve compiled these here to save time on recurring lookups.

Install Cores

Before you can upload a program to a specific Arduino Board, you need to install the relevant core.

These two cores are used for the MKR1010 and Nano ESP32.

arduino-cli core install arduino:samd
arduino-cli core install arduino:esp32

Library Installation

arduino-cli lib install "library name"

E.g.

> arduino-cli lib install "Adafruit AW9523"
Already installed Adafruit BusIO@1.16.0
Downloading Adafruit AW9523@1.0.5...
Adafruit AW9523@1.0.5 downloaded
Installing Adafruit AW9523@1.0.5...
Installed Adafruit AW9523@1.0.5

Note The line Already installed Adafruit BusIO@1.16.0 is because one of the dependencies for this library is already installed.

Use library in code

#include <Adafruit_AW9523>