`arduino-cli` is an all-in-one solution that provides builder, boards/library manager, uploader, discovery and many other tools needed to use any Arduino compatible board and platforms.
`arduino-cli` is an all-in-one solution that provides builder, boards/library manager, uploader,
discovery and many other tools needed to use any Arduino compatible board and platforms.
This software is currently in alpha state: new features will be added and some may be changed.
It will be soon used as a building block in the Arduino IDE and Arduino Create.
## How to contribute
Contributions are welcome!
Please read the document [How to contribute](CONTRIBUTING.md) which will guide you through how to
build the source code, run the tests, and contribute your changes to the project.
## How to install
### Download the latest stable release
...
...
@@ -16,8 +24,8 @@ This is **not yet available** until the first stable version is released.
#### Download the latest unstable "alpha" preview
Please note that these are **preview** build, they may have bugs, some features may not work or may be changed without notice,
the latest preview version is `0.3.7-alpha.preview`:
Please note that these are **preview** builds, they may have bugs, some features may not work or may
be changed without notice, the latest preview version is `0.3.7-alpha.preview`:
@@ -236,7 +253,8 @@ We can finally upload the sketch and see our board blinking, we now have to spec
### Step 7. Add libraries
Now we can try to add a useful library to our sketch. We can at first look at the name of a library, our favourite one is the wifi101, here the command to get more info
Now we can try to add a useful library to our sketch. We can at first look at the name of a library,
our favourite one is the wifi101, here the command to get more info:
$ arduino-cli lib search wifi101
Name: "WiFi101OTA"
...
...
@@ -260,7 +278,8 @@ Now we can try to add a useful library to our sketch. We can at first look at th
We are now ready to install it! Please be sure to use the full name of the lib as specified in the "Name:" section previously seen
We are now ready to install it! Please be sure to use the full name of the lib as specified in the
"Name:" section previously seen:
$ arduino-cli lib install "WiFi101"
Downloading libraries...
...
...
@@ -271,110 +290,85 @@ We are now ready to install it! Please be sure to use the full name of the lib a
`arduino-cli` is a container of commands, to see the full list just run:
```bash
$ arduino-cli
Arduino Command Line Interface (arduino-cli).
Usage:
arduino-cli [command]
Examples:
arduino <command>[flags...]
Available Commands:
board Arduino board commands.
compile Compiles Arduino sketches.
config Arduino Configuration Commands.
core Arduino Core operations.
help Help about any command
lib Arduino commands about libraries.
sketch Arduino CLI Sketch Commands.
upload Upload Arduino sketches.
version Shows version number of Arduino CLI.
....
```
$ arduino-cli
Arduino Command Line Interface (arduino-cli).
Each command has his own specific help that can be obtained with the `help` command, for example:
Usage:
arduino-cli [command]
```bash
$ arduino-cli help core
Arduino Core operations.
Examples:
arduino <command> [flags...]
Available Commands:
board Arduino board commands.
compile Compiles Arduino sketches.
config Arduino Configuration Commands.
core Arduino Core operations.
help Help about any command
lib Arduino commands about libraries.
sketch Arduino CLI Sketch Commands.
upload Upload Arduino sketches.
version Shows version number of Arduino CLI.
....
Each command has his own specific help that can be obtained with the `help` command, for example:
Usage:
arduino-cli core [command]
$ arduino-cli help core
Arduino Core operations.
Examples:
arduino-cli core update-index # to update the package index file.
Usage:
arduino-cli core [command]
Available Commands:
download Downloads one or more cores and corresponding tool dependencies.
install Installs one or more cores and corresponding tool dependencies.
list Shows the list of installed cores.
update-index Updates the index of cores.
Examples:
arduino-cli core update-index # to update the package index file.
Flags:
-h, --helphelp for core
Available Commands:
download Downloads one or more cores and corresponding tool dependencies.
install Installs one or more cores and corresponding tool dependencies.
list Shows the list of installed cores.
update-index Updates the index of cores.
Global Flags:
--config-file string The custom config file (if not specified the default one will be used).
--debug Enables debug output (super verbose, used to debug the CLI).
--format string The output format, can be [text|json]. (default "text")
Flags:
-h, --help help for core
Use "arduino-cli core [command] --help"for more information about a command.
Global Flags:
--config-file string The custom config file (if not specified the default one will be used).
--debug Enables debug output (super verbose, used to debug the CLI).
--format string The output format, can be [text|json]. (default "text")
```
Use "arduino-cli core [command] --help" for more information about a command.
# FAQ
## FAQ
#### Why the Arduino Uno/Mega/Duemilanove is not detected when I run `arduino-cli board list`?
### Why the Arduino Uno/Mega/Duemilanove is not detected when I run `arduino-cli board list`?
Because:
- Your board is a cheaper clone, or
- It mounts a USB2Serial converter like FT232 or CH320: these chips always reports the same USB VID/PID to the operating system, so the only thing that we know is that the board mounts that specific USB2Serial chip, but we don't know which board is.
- It mounts a USB2Serial converter like FT232 or CH320: these chips always reports the same USB
VID/PID to the operating system, so the only thing that we know is that the board mounts that
specific USB2Serial chip, but we don't know which board is.
#### What is the core for the Uno/Mega/Nano/Duemilanove?
### What is the core for the Uno/Mega/Nano/Duemilanove?
`arduino:avr`
#### What is the FQBN for ...?
### What is the FQBN for ...?
- Arduino UNO: `arduino:avr:uno`
- Arduino Mega: `arduino:avr:mega`
- Arduino Nano: `arduino:avr:nano` or `arduino:avr:nano:cpu=atmega328old` if you have the old bootloader
#### How can I find the core/FQBN for a board?
### How can I find the core/FQBN for a board?
Update the core index to have latest boards informations:
Further help can be found in [this comment](https://github.com/arduino/arduino-cli/issues/138#issuecomment-459169051) in [#138](https://github.com/arduino/arduino-cli/issues/138).
For a deeper understanding of how FQBN works, you should understand Arduino Hardware specification. You can find more information in this [arduino/Arduino wiki page](https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification)
# Testing
Currently Unit and Integration test are available for launch in 2 ways:
1. classic `go test ./...` to launch both unit and integration test
2. via [task](https://taskfile.dev) that includes the following options:
```
* build: Build the project
* check: Check fmt and lint, `legacy` will be skipped
* check-legacy: Check fmt and lint for the `legacy` package
* protoc: Compile protobuf definitions
* rpc-client: Run the rpc client test routine (server must be already started)
* test: Run the full testsuite, `legacy` will be skipped
* test-integration: Run integration tests only
* test-legacy: Run tests for the `legacy` package
* test-unit: Run unit tests only
* test-unit-race: Run unit tests only with race condition detection
```
For Example to launch unit tests only run: `task test-unit`
For a deeper understanding of how FQBN works, you should understand Arduino Hardware specification.
You can find more information in this [arduino/Arduino wiki page](https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification)