Arduino CLI is a command line tool that allows to manage libraries, compile, verify and upload sketches to Arduino boards, or perform other operations related with Arduino ecosystem.
This tutorial shows how to install Arduino CLI on Ubuntu 20.04.
Install Arduino CLI
Download the latest tar.gz file from official Arduino website:
wget -qO arduino-cli.tar.gz https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz
Extract arduino-cli executable file from archive to /usr/local/bin directory.
sudo tar xf arduino-cli.tar.gz -C /usr/local/bin arduino-cli
Now arduino-cli command can be used all users as a system-wide command.
We can check Arduino CLI version:
arduino-cli version
Remove unnecessary tar.gz file:
rm -rf arduino-cli.tar.gz
Testing Arduino CLI
Arduino CLI supports various operations. For example, sketch new allows to create a new sketch for Arduino project.
arduino-cli sketch new helloworld
Command creates a new directory named helloworld which contains helloworld.ino file. It has basic code to start writing Arduino program.
helloworld/helloworld.ino
void setup() {
}
void loop() {
}
Uninstall Arduino CLI
If you want to completely remove Arduino CLI, delete executable file:
sudo rm -rf /usr/local/bin/arduino-cli
You can also remove Arduino CLI data directory:
rm -rf ~/.arduino15
Leave a Comment
Cancel reply