Configuration
Configuration keys¶
board_manageradditional_urls- the URLs to any additional Boards Manager package index files needed for your boards platforms.
daemon- options related to running Arduino CLI as a gRPC server.port- TCP port used for gRPC client connections.
directories- directories used by Arduino CLI.data- directory used to store Boards/Library Manager index files and Boards Manager platform installations.downloads- directory used to stage downloaded archives during Boards/Library Manager installations.user- the equivalent of the Arduino IDE's "sketchbook" directory. Library Manager installations are made to thelibrariessubdirectory of the user directory.builtin.libraries- the libraries in this directory will be available to all platforms without the need for the user to install them, but with the lowest priority over other installed libraries with the same name, it's the equivalent of the Arduino IDE's bundled libraries directory.builtin.tools- it's a list of directories of tools that will be available to all platforms without the need for the user to install them, it's the equivalent of the Arduino IDE 1.x bundled tools directory.
library- configuration options relating to Arduino libraries.enable_unsafe_install- set totrueto enable the use of the--git-urland--zip-fileflags witharduino-cli lib install. These are considered "unsafe" installation methods because they allow installing files that have not passed through the Library Manager submission process.
locale- the language used by Arduino CLI to communicate to the user, the parameter is the language identifier in the standard POSIX format<language>[_<TERRITORY>[.<encoding>]](for exampleitorit_IT, orit_IT.UTF-8).logging- configuration options for Arduino CLI's logs.file- path to the file where logs will be written.format- output format for the logs. Allowed values aretextorjson.level- messages with this level and above will be logged. Valid levels are:trace,debug,info,warn,error,fatal,panic.
metrics- settings related to the collection of data used for continued improvement of Arduino CLI.addr- TCP port used for metrics communication.enabled- controls the use of metrics.
output- settings related to text output.no_color- ANSI color escape codes are added by default to the output. Set totrueto disable colored text output.
sketch- configuration options relating to Arduino sketches.always_export_binaries- set totrueto makearduino-cli compilealways save binaries to the sketch folder. This is the equivalent of using the--export-binariesflag.
updater- configuration options related to Arduino CLI updatesenable_notification- set tofalseto disable notifications of new Arduino CLI releases, defaults totrue
build_cacheconfiguration options related to the compilation cachecompilations_before_purge- interval, in number of compilations, at which the cache is purged, defaults to10. When0the cache is never purged.ttl- cache expiration time of build folders. If the cache is hit by a compilation the corresponding build files lifetime is renewed. The value format must be a valid input for time.ParseDuration(), defaults to720h(30 days).
Configuration methods¶
Arduino CLI may be configured in three ways:
- Command line flags
- Environment variables
- Configuration file
If a configuration option is configured by multiple methods, the value set by the method highest on the above list overwrites the ones below it.
If a configuration option is not set, Arduino CLI uses a default value.
arduino-cli config dump displays the current configuration values.
Command line flags¶
Arduino CLI's command line flags are documented in the command line help and the Arduino CLI command reference.
Example¶
Setting an additional Boards Manager URL using the --additional-urls command line flag:
$ arduino-cli core update-index --additional-urls https://downloads.arduino.cc/packages/package_staging_index.json
Environment variables¶
All configuration options can be set via environment variables. The variable names start with ARDUINO, followed by the
configuration key names, with each component separated by _. For example, the ARDUINO_DIRECTORIES_USER environment
variable sets the directories.user configuration option.
On Linux or macOS, you can use the export command to set environment variables. On Windows cmd, you
can use the set command.
ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS environment variables can be a list of space-separated URLs.
Example¶
Setting an additional Boards Manager URL using the ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS environment variable:
$ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/packages/package_staging_index.json
Setting multiple additional Boards Manager URLs using the ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS environment variable:
$ export ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS="https://downloads.arduino.cc/packages/package_staging_index.json https://downloads.arduino.cc/packages/package_mbed_index.json"
Configuration file¶
arduino-cli config init creates or updates a configuration file with the current
configuration settings.
This allows saving the options set by command line flags or environment variables. For example:
arduino-cli config init --additional-urls https://downloads.arduino.cc/packages/package_staging_index.json
File name¶
The configuration file must be named arduino-cli, with the appropriate file extension for the file's format.
Supported formats¶
arduino-cli config init creates a YAML file, however a variety of common formats are supported:
Locations¶
Configuration files in the following locations are recognized by Arduino CLI:
- Location specified by the
--config-filecommand line flag - Arduino CLI data directory (as configured by
directories.data)
If multiple configuration files are present, the one highest on the above list is used. Configuration files are not combined.
The location of the active configuration file can be determined by running the command:
arduino-cli config dump --verbose
Example¶
Setting an additional Boards Manager URL using a YAML format configuration file:
board_manager:
additional_urls:
- https://downloads.arduino.cc/packages/package_staging_index.json
Doing the same using a TOML format file:
[board_manager]
additional_urls = [ "https://downloads.arduino.cc/packages/package_staging_index.json" ]
JSON schema¶
The configuration file JSON schema can be used to independently validate the file content. This schema should be considered unstable in this version.