Configuration
Configuration keys
board_manager
- the URLs to any additional Boards Manager package index files needed for your boards platforms.additional_urls
- options related to running Arduino CLI as a gRPC server.daemon
- TCP port used for gRPC client connections.port
- directories used by Arduino CLI.directories
- directory used to store Boards/Library Manager index files and Boards Manager platform installations.data
- directory used to stage downloaded archives during Boards/Library Manager installations.downloads
- the equivalent of the Arduino IDE's "sketchbook" directory. Library Manager installations are made to theuser
subdirectory of the user directory. Users can manually install 3rd party platforms in thelibraries
subdirectory of the user directory.hardware
- 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.libraries
- configuration options relating to Arduino libraries.library
- set toenable_unsafe_install
to enable the use of thetrue
and--git-url
flags with--zip-file
. These are considered "unsafe" installation methods because they allow installing files that have not passed through the Library Manager submission process.arduino-cli lib install
- the language used by Arduino CLI to communicate to the user, the parameter is the language identifier in the standard POSIX formatlocale
(for example<language>[_<TERRITORY>[.<encoding>]]
orit
, orit_IT
).it_IT.UTF-8
- configuration options for Arduino CLI's logs.logging
- path to the file where logs will be written.file
- output format for the logs. Allowed values areformat
ortext
.json
- messages with this level and above will be logged. Valid levels are:level
,trace
,debug
,info
,warn
,error
,fatal
.panic
- settings related to the collection of data used for continued improvement of Arduino CLI.metrics
- TCP port used for metrics communication.addr
- controls the use of metrics.enabled
- settings related to text output.output
- ANSI color escape codes are added by default to the output. Set tono_color
to disable colored text output.true
- configuration options relating to Arduino sketches.sketch
- set toalways_export_binaries
to maketrue
always save binaries to the sketch folder. This is the equivalent of using thearduino-cli compile
flag.--export-binaries
- configuration options related to Arduino CLI updatesupdater
- set toenable_notification
to disable notifications of new Arduino CLI releases, defaults tofalse
true
configuration options related to the compilation cachebuild_cache
- the path to the build cache, default ispath
.$TMP/arduino
- a list of paths to look for precompiled artifacts if not found onextra_paths
setting.build_cache.path
- interval, in number of compilations, at which the cache is purged, defaults tocompilations_before_purge
. When10
the cache is never purged.0
- 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 tottl
(30 days).720h
- configuration options related to the network connection.network
- URL of the proxy server.proxy
- network connection timeout, the value format must be a valid input for time.ParseDuration(), defaults toconnection_timeout
(60 seconds).60s
means it will wait indefinitely.0
- if set tocloud_api.skip_board_detection_calls
it will make the Arduino CLI skip network calls to Arduino Cloud API to help detection of an unknown board.true
Default directories
The following are the default directories selected by the Arduino CLI if alternatives are not specified in the configuration file.
The
default is OS-dependent:directories.data
- on Linux (and other Unix-based OS) is:
{HOME}/.arduino15
- on Windows is:
{HOME}/AppData/Local/Arduino15
- on MacOS is:
{HOME}/Library/Arduino15
- on Linux (and other Unix-based OS) is:
The
default isdirectories.download
. If the value of{directories.data}/staging
is changed in the configuration the user-specified value will be used.{directories.data}
The
default is OS-dependent:directories.user
- on Linux (and other Unix-based OS) is:
{HOME}/Arduino
- on Windows is:
{DOCUMENTS}/Arduino
- on MacOS is:
{HOME}/Documents/Arduino
- on Linux (and other Unix-based OS) is:
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.
displays the current configuration values.arduino-cli config dump
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
command line flag:--additional-urls
1$ 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
command to set environment variables. On Windows cmd, you
can use the export
command.set
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:1$ 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:1$ 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
creates a new empty configuration file.arduino-cli config init
This allows saving the options set by command line flags or environment variables. For example:
1arduino-cli config init --additional-urls https://downloads.arduino.cc/packages/package_staging_index.json
Locations
The default configuration file is named
arduino-cli.yaml
. The configuration file is searched in the following
locations, in order of priority:- Location specified by the
command line flag--config-file
- Location specified by the
environment variableARDUINO_CONFIG_FILE
- Location specified by the
environment variableARDUINO_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:
1arduino-cli config dump --verbose
Example
Setting an additional Boards Manager URL using a YAML format configuration file:
1board_manager:2 additional_urls:3 - https://downloads.arduino.cc/packages/package_staging_index.json
Doing the same using a TOML format file:
1[board_manager]2additional_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.
ON THIS PAGE