Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Configuration

Configuration keys

  • board_manager
    • additional_urls - the URLs to any additional Boards Manager package index files needed for your boards platforms.
    • enable_unsafe_install - set totrue to allow installation of packages that do not pass the checksum test. This is considered an unsafe installation method and should be used only for development purposes.
  • daemon - options related to running Arduino CLI as agRPC 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 thelibraries subdirectory of the user directory. Users can manually install 3rd party platforms in thehardware subdirectory 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.
  • library - configuration options relating to Arduino libraries.
    • enable_unsafe_install - set totrue to enable the use of the--git-url and--zip-file flags 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 exampleit orit_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 aretext orjson.
    • 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 totrue to disable colored text output.
  • sketch - configuration options relating toArduino sketches.
  • updater - configuration options related to Arduino CLI updates
    • enable_notification - set tofalse to disable notifications of new Arduino CLI releases, defaults totrue
  • build_cache configuration options related to the compilation cache
    • path - the path to the folder under which build caches are stored.
    • extra_paths - a list of paths to look for precompiled artifacts if not found onbuild_cache.path setting.
    • compilations_before_purge - interval, in number of compilations, at which the cache is purged, defaults to10. When0 the 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 fortime.ParseDuration(), defaults to720h (30 days).
  • network - configuration options related to the network connection.
    • proxy - URL of the proxy server.
    • connection_timeout - network connection timeout, the value format must be a valid input fortime.ParseDuration(), defaults to60s (60 seconds).0 means it will wait indefinitely.
    • cloud_api.skip_board_detection_calls - if set totrue it will make the Arduino CLI skip network calls to Arduino Cloud API to help detection of an unknown board.

Default directories

The following are the default directories selected by the Arduino CLI if alternatives are not specified in theconfiguration file.

  • Thebuild_cache.path default is OS-dependent:
    • on Linux (and other Unix-based OS) is: if$XDG_CACHE_HOME is defined,$XDG_CACHE_HOME/arduino. Otherwise{HOME}/.config/arduino.
    • on Windows is:{HOME}/AppData/Local/arduino
    • on MacOS is:{HOME}/Library/Caches/arduino
  • Thedirectories.data default is OS-dependent:
    • on Linux (and other Unix-based OS) is:{HOME}/.arduino15
    • on Windows is:{HOME}/AppData/Local/Arduino15
    • on MacOS is:{HOME}/Library/Arduino15
  • Thedirectories.downloads default is{directories.data}/staging. If the value of{directories.data} is changed in the configuration the user-specified value will be used.
  • Thedirectories.user default is OS-dependent:
    • on Linux (and other Unix-based OS) is:{HOME}/Arduino
    • on Windows is:{DOCUMENTS}/Arduino
    • on MacOS is:{HOME}/Documents/Arduino

Configuration methods

Arduino CLI may be configured in three ways:

  1. Command line flags
  2. Environment variables
  3. Configuration file

If a configuration option is configured by multiple methods, the value set by the method highest on the above listoverwrites 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 theArduino CLI command reference.

Example

Setting an additional Boards Manager URL using the--additional-urls command line flag:

$arduino-clicoreupdate-index--additional-urlshttps://downloads.arduino.cc/packages/package_staging_index.json

Environment variables

All configuration options can be set via environment variables. The variable names start withARDUINO, followed by theconfiguration key names, with each component separated by_. For example, theARDUINO_DIRECTORIES_USER environmentvariable sets thedirectories.user configuration option.

On Linux or macOS, you can use theexport command to set environment variables. On Windows cmd, youcan use theset command.

ARDUINO_BOARD_MANAGER_ADDITIONAL_URLS environment variables can be a list of space-separated URLs.

Example

Setting an additional Boards Manager URL using theARDUINO_BOARD_MANAGER_ADDITIONAL_URLS environment variable:

$exportARDUINO_BOARD_MANAGER_ADDITIONAL_URLS=https://downloads.arduino.cc/packages/package_staging_index.json

Setting multiple additional Boards Manager URLs using theARDUINO_BOARD_MANAGER_ADDITIONAL_URLS environment variable:

$exportARDUINO_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 a new empty configuration file.

This allows saving the options set by command line flags or environment variables. For example:

arduino-cliconfiginit--additional-urlshttps://downloads.arduino.cc/packages/package_staging_index.json

Locations

The default configuration file is namedarduino-cli.yaml. The configuration file is searched in the followinglocations, in order of priority:

  1. Location specified by the--config-file command line flag
  2. Location specified by theARDUINO_CONFIG_FILE environment variable
  3. Location specified by theARDUINO_DIRECTORIES_DATA environment variable

If multiple configuration files are present, the one highest on the above list is used. Configuration files are notcombined.

The location of the active configuration file can be determined by running the command:

arduino-cliconfigdump--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 fileJSON schema can be used to independently validate the file content. Thisschema should be considered unstable in this version.


[8]ページ先頭

©2009-2025 Movatter.jp