Configuration file

I'm new to Arduino and would like to learn the CLI. By reading the doc, I tried to create a verbose configuration file arduino-cli.yaml.txt, with the defaults, but there's some errors running arduino-cli config dump:

Invalid value in configuration: schema not defined for key 'directory.download'
Invalid value in configuration: schema not defined for key 'directory.user'
Invalid value in configuration: schema not defined for key 'directory.data'

I think such a config file should be provided (and pointed when reading the configuration doc as a documentation on the config format.

Kristian

Change directory to directories.

I agree with your point.
Like most, I don't directly use the command line interface, but I will keep track of this post to see what I can learn.

@sonofcy I guess I might not use the command line a lot in the end, but understanding how it can be done from the command line, will help me understand what is going on.

You might want to look at the verbose compiler output. The command lines (yes, more than 1) are very long. There is a lot going on under the IDE cover

1 Like

@oqibidipo Tanks ! It took me time to see what you mean :woozy_face:, but it's working now !
...
In the doc, it say the default directories.data is {HOME}/.arduino15 and the default built_cache.path is $TMP/arduino are these both valid format and can you use any environment variable for any configuration item ?
...
For a lot of configuration variables I guessed the default value. Anyway to know the real default, but reading the code ?

In the section default directories, it say :

The directories.download default is {directories.data}/staging

But download should be plural directories.downloads.

First of all, please note that the configuration key name is build_cache.path, not "built_cache.path" (note the "build" instead of "built")

As for your question, the answer is: no. Environment variables are not supported in the configuration file. What the documentation means is that the default is the actual path that would be resolved from the environment variable.

However you can of course use environment variables in your command line commands, and those commands can be used to configure Arduino CLI. For example:

$ arduino-cli config set directories.data "$SOME_ENVIRONMENT_VARIABLE"

In this case, the shell takes care of resolving the environment variable, not Arduino CLI. So what is passed to Arduino CLI is the value of the environment variable, not the variable reference.

You can determine the effective value of any configuration key by using the config get command:

https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_config_get/

If you have explicitly configured a value for the key, then the command will return that value, but if a value has not been explicitly configured then it will return the default.

For example:

$ arduino-cli config get build_cache.path

C:\Users\per\AppData\Local\arduino

Thanks for your report. I have submitted a correction on your behalf:

1 Like

@ptillisch, I made a PR to enhance the doc, but it was rejected du to Check Prettier Formatting / check (pull_request). You can see my last version here. There are missing default values for Windows and MACos, but it should be a starting point on enhancing the documentation.

Kristian

1 Like