Posts | Comments

Planet Arduino

Archive for the ‘Arduino CLI’ Category

Our dev team is about to head out for holiday break, but not without sharing some exciting news first: the release of arduino-cli 0.7.0!

Highlights include:

  • Notarization compliance for macOS
  • Some breaking changes:
    • Remove Sketchbook concept, introduce user data folder
    • “lib list” now returns an empty JSON array when there are no libraries installed
    • Change configuration file format
    • Terminate daemon command when parent process exits; added “–daemonize” flag to keep old behavior
  • Added a lot of bugfixing and minor features

The latest version will be available on the other distribution channels (i.e. Homebrew) in the coming days. Stay tuned!

Arduino now has an officially supported command-line interface. The project, called arduino-cli, is the first time that the official toolchain has departed from the Java-based editor known as the Arduino IDE. You can see the official announcement video below.

Obviously this isn’t a new idea. Platform IO and other command-line driven tools exist. But official support means even if you don’t want to use the command line yourself, this should open up a path to integrate the Arduino build process to other IDEs more easily.

The code is open source, but they do mention in their official announcement that you can license it for commercial use. We assume that would mean if you wanted to build it into a product, not just provide an interface to it. This seems like something Arduino expects, because a lot of the command line tools can produce json which is a fair way to send information to another application for parsing.

The command line interface doesn’t just build a sketch. You can do things like install and manage libraries. For example, to create a new sketch:

arduino-cli sketch new HackadayPgm

You can update the installed platforms, list the connected boards, and search for board support:

arduino-cli core update-index

arduino-cli board list

arduino-cli core search mkr1000

If you don’t already have the board support, you can install it and verify that it is there:

arduino-cli core install arduino:samd

arduino-cli core list

That last step will give you the FQBN or unique name for the core. So to compile and upload you have this mouthful:

arduino-cli compile --fqbn arduino:samd:mkr1000 Arduino/HackadayPgm

arduino-cli upload -p /dev/ttyACM0 -fqbn arduino:samd:mkr1000 Arduino/HackadayPgm

Unlike, say, PlatformIO, this is clearly better for building into a tool, even if it is a makefile. We’d like to see a .build.json file or something that allows you to just issue short commands that do the right thing in a working directory. Of course, you could build that with a little shell scripting. Hmm….

It is nice to see the release of an official method and we hope this will lead to more editors being able to handle Arduino seamlessly.

Arduino now has an officially supported command-line interface. The project, called arduino-cli, is the first time that the official toolchain has departed from the Java-based editor known as the Arduino IDE. You can see the official announcement video below.

Obviously this isn’t a new idea. Platform IO and other command-line driven tools exist. But official support means even if you don’t want to use the command line yourself, this should open up a path to integrate the Arduino build process to other IDEs more easily.

The code is open source, but they do mention in their official announcement that you can license it for commercial use. We assume that would mean if you wanted to build it into a product, not just provide an interface to it. This seems like something Arduino expects, because a lot of the command line tools can produce json which is a fair way to send information to another application for parsing.

The command line interface doesn’t just build a sketch. You can do things like install and manage libraries. For example, to create a new sketch:

arduino-cli sketch new HackadayPgm

You can update the installed platforms, list the connected boards, and search for board support:

arduino-cli core update-index

arduino-cli board list

arduino-cli core search mkr1000

If you don’t already have the board support, you can install it and verify that it is there:

arduino-cli core install arduino:samd

arduino-cli core list

That last step will give you the FQBN or unique name for the core. So to compile and upload you have this mouthful:

arduino-cli compile --fqbn arduino:samd:mkr1000 Arduino/HackadayPgm

arduino-cli upload -p /dev/ttyACM0 -fqbn arduino:samd:mkr1000 Arduino/HackadayPgm

Unlike, say, PlatformIO, this is clearly better for building into a tool, even if it is a makefile. We’d like to see a .build.json file or something that allows you to just issue short commands that do the right thing in a working directory. Of course, you could build that with a little shell scripting. Hmm….

It is nice to see the release of an official method and we hope this will lead to more editors being able to handle Arduino seamlessly.

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

{“libraries”:[{“Name”:”WiFiNINA”,”Releases”:{“1.0.0”:{“Author”:”Arduino”,”Version”:”1.0.0″,”Maintainer”:”Arduino \u003cinfo@arduino.cc\u003e”,”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”],”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”}}}}]}

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

Windows: https://downloads.arduino.cc/arduino-cli/0.1.0-alpha.preview/arduino-cli-0.1.0-alpha.preview-windows.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!

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

{“libraries”:[{“Name”:”WiFiNINA”,”Releases”:{“1.0.0”:{“Author”:”Arduino”,”Version”:”1.0.0″,”Maintainer”:”Arduino \u003cinfo@arduino.cc\u003e”,”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”],”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”}}}}]}

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

Windows: https://downloads.arduino.cc/arduino-cli/0.1.0-alpha.preview/arduino-cli-0.1.0-alpha.preview-windows.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!



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook