Announcing the Arduino Command Line Interface (CLI)
The Arduino team has been working hard to support the needs of our professional developer community. Many of you requested a way to use our tools in Makefiles, and wanted Arduino IDE features available via a fast, clean command line interface. How cool would it be to install project dependencies with:
arduino-cli lib install "WiFi101” “WiFi101OTA”
So that’s what we’ve done! To make it even cooler, most Arduino CLI commands have the option to output JSON for easy parsing by other programs:
arduino-cli --format json lib search wifinina | jq { "libraries": [ { "Name": "WiFiNINA", "Author": "Arduino", "Maintainer": "Arduino <info@arduino.cc>", "Sentence": "Enables network connection (local and Internet) with the Arduino MKR WiFi 1010, Arduino MKR VIDOR 4000 and Arduino UNO WiFi Rev.2.", "Paragraph": "With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. The board can connect either to open or encrypted networks (WEP, WPA). The IP address can be assigned statically or through a DHCP. The library can also manage DNS.", "Website": "http://www.arduino.cc/en/Reference/WiFiNINA", "Category": "Communication", "Architectures": [ "*" ], "types": [ "Arduino" ], "releases": { "1.0.0": { "version": "1.0.0", "resource": { "URL": "http://downloads.arduino.cc/libraries/github.com/arduino-libraries/WiFiNINA-1.0.0.zip", "ArchiveFileName": "WiFiNINA-1.0.0.zip", "Checksum": "SHA-256:79f133fedf86411ca7add773a4293137dec057a3b8f1a7904db2d444ed8f4246", "Size": 65651, "CachePath": "libraries" } } }, "Folder": null, "SrcFolder": null, "UtilityFolder": null, "Layout": 0, "RealName": "", "DotALinkage": false, "Precompiled": false, "LDflags": "", "IsLegacy": false, "Version": "", "License": "", "Properties": null } ] }
The other big news is you can run Arduino CLI on both ARM and Intel (x86, x86_64) architectures. This means you can install Arduino CLI on a Raspberry Pi or on your servers, and use it to compile Sketches targeting the board of your choice (Don’t forget you can also remotely manage your Linux device with Arduino Create Device Manager!)
Getting Started
This first release is an alpha, and we would like your feedback to help us improve it. You can download the Arduino CLI alpha preview binaries from:
Linux (64-bit): https://downloads.arduino.cc/arduino-cli/0.1.0-alpha.preview/arduino-cli-0.1.0-alpha.preview-linux64.tar.bz2
Linux (32-bit): https://downloads.arduino.cc/arduino-cli/0.1.0-alpha.preview/arduino-cli-0.1.0-alpha.preview-linux32.tar.bz2
Linux (ARM): https://downloads.arduino.cc/arduino-cli/0.1.0-alpha.preview/arduino-cli-0.1.0-alpha.preview-linuxarm.tar.bz2
OSX: https://downloads.arduino.cc/arduino-cli/0.1.0-alpha.preview/arduino-cli-0.1.0-alpha.preview-osx.zip
Once you’ve installed Arduino CLI, you can try it out using our getting started guide: https://github.com/arduino/arduino-cli#getting-started
The Arduino CLI code repository is also available at: https://github.com/arduino/arduino-cli. As usual, it’s open source – but if you’re a company who wants to use it to create a customized tool, you can also contact us for a commercial license.
Integrate Arduino Support Into Your Preferred Platform
After we used Arduino CLI for awhile, we decided to make it the standard way our software communicates. Imagine having the Arduino IDE or Arduino Create Editor speaking directly to Arduino CLI – and you having full control of it. You will be able to compile on your machine or on our online servers, detect your board or create your own IDE on top of it!
We want you to be able to add Arduino support to whatever development flow you prefer. Whether you use Atom, Eclipse, Emacs, Vim, VSCode, or are even building your own tools, Arduino CLI makes this possible. Let us know what you think!
August 24th, 2018 at 18:57:21
Add support to powershell!
August 24th, 2018 at 19:16:26
This is good news!
Thanks for the hard work that made it possible.
Please, keep up 🙂
August 24th, 2018 at 20:39:07
Good job, lads!
Cheers!
August 25th, 2018 at 17:04:42
Thank you! A cli was really needed!!! Good job, keep it up!!!
August 25th, 2018 at 19:11:32
Cool!!
August 28th, 2018 at 14:41:27
This is a nice tool.. thanks…
August 28th, 2018 at 16:55:03
It looks like this is a separate install. Please don’t let it stay that way! I teach Arduino classes and it’s already hard enough to get a group of people on 3 different OSes to install Arduino IDE, libraries, 3rd party boards, and 3rd party drivers. I want everyone to learn to use the CLI and this counter productive to adoption.
August 28th, 2018 at 20:31:37
this sounds as a great tool.
my first try on windows 10 gives me an unexpected error/warning like this:
arduino-cli-0.2.0-alpha.preview-windows.exe core install arduino:avr
The tool arduino:avr-gcc@4.9.2-atmel3.5.4-arduino2 is not available for the current OS
is this the expected behavior (no classical Arduino on win10) or I am missing something?
September 4th, 2018 at 04:17:56
Running on Raspberry Pi I get
“Ave-g++: error: missing device or architecture after ‘-mmcu=’
Any suggestions on how to fix this?
I’m really looking forward to using this, if I can get it to work!
Thanks Gareth
October 13th, 2018 at 00:07:12
It will be possible to specify additional CFLAGS,CXXFLAGS to compiler ?
October 31st, 2018 at 01:44:47
Hello all. I’m really new on Arduino/IDE environment and need help about how to use Arduino-cli to build systems on a nodemcu/esp12-E board. Thanks in advance!
December 7th, 2018 at 07:25:52
if I install this on Yun or Yun shield I will I push code into arduino chip in both cases ?
June 6th, 2019 at 23:42:12
Obviously great for scripts, and for headless builds, especially on certain other SOC/ARM platforms.
Extends easily to automated build and propagation by pull, very instructional.
March 10th, 2020 at 10:43:59
This is really exciting news! ?
I would love to have a build core that will be shared between the classic Arduino IDE and my favorite editor, which is VS Code.
Before the days of `arduino-builder`, I used to check the “Use external editor” option in the IDE in order to use more capable editors (such as Notepad++ at that time). I have been using VS Code for a couple of years now, so I’m eager to see what `arduino-cli` can offer to simplify my workflow.