Skip to content

arduino/arduino-cli

Repository files navigation

arduino-cli

Build Status

Arduino CLI is a tool to access all Arduino Create API from Command Line. It implements all functions provided by web version of Arduino Create.

Installation

  1. git clone this repository into a folder of your choice

  2. Add '/path/to/arduino-cli/folder' to your PATH environment variable

  3. Reload shell configuration or reboot

Compiling

There are two ways to execute the project:

  1. By running the go main file.

    $ go run main.go ARGS
  2. By compiling then running the go program.

    $ go build -o arduino
    $ ./arduino ARGS

If you want autocompletion and manpages you have to compile and execute (second way)

And you’re done, now let’s see how to use the CLI.

Usage : An example

A general call is

  $ arduino [COMMAND] [options]

To see the full list of commands, call one of the following:

  $ arduino help [COMMAND]
  $ arduino [COMMAND] -h
  $ arduino [COMMAND] --help

Here is the output from help command arduino help:

Arduino Create Command Line Interface (arduino-cli)

Usage:
  arduino [flags]
  arduino [command]

Available Commands:
  core        Arduino Core operations
  help        Help about any command
  lib         Arduino commands about libraries
  version     Shows version Number of arduino

Flags:
      --config string        config file (default is $HOME/.arduino.yaml)
      --format string        the output format, can be [text|json] (default "text")
      --generate-docs        generates the docs for the CLI and puts it in docs folder
  -h, --help                 help for arduino
  -v, --verbose count[=-1]   enables verbose output (use more times for a higher level)

Use "arduino [command] --help" for more information about a command.

== Contributing

To contribute to this project:

. `git clone` this repository
. Create a new branch with the name `feature-to-implement` or `bug-to-fix`
. Code your contribution and push to your branch
. Ask a Pull Request

== Tips and Tricks
==== Download all libraries of the current library index:
[source, bash]

$ arduino lib search | tr "\n" " " | xargs arduino lib install

Same trick can be used on cores as well:
[source, bash]

$ arduino core search | tr "\n" " " | xargs arduino core install

And with the `download` command:
[source, bash]

$ arduino lib search | tr "\n" " " | xargs arduino lib download $ arduino core search | tr "\n" " " | xargs arduino core download