Hi! I have been looking for a way to move the default config file (the one that is generated by arduino-cli config init) from the default location in macOS to something more accessible (e.g. under ~/.config.
Unfortunately, internet does not help and while the docs tell you how to configure env vars to override the default behaviours, none of them include changing the default configs. Does anybody know how to do that?
Thank you!
Hi @lucabaggi. You can specify the location the configuration file should be created at via the --dest-dir flag:
https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_config_init/#options
Arduino CLI will automatically use that configuration file if it is in one of the locations listed here:
https://arduino.github.io/arduino-cli/latest/configuration/#locations
If you have selected another location, make sure to specify that in all your arduino-cli commands that depend on the configuration file via the --config-file flag.
Hi @ptillisch, thank you for the reply! So it's either one of the locations above, or I always have to specify the --config-file with every command I run - am I right?
That is correct, except not necessarily "every command". For example, it is likely the default configuration will work just fine when running an arduino-cli sketch new command, so you could skip the --config-file flag on that command even if your configuration file was not in one of the locations where it is automatically used by Arduino CLI.