Start with custom preferences

Hi,
is it possible to start the IDE with custom preferences?

I have a preferences text file for each project (board settings, library folder, ...).

I was able to start the IDE with the arg

--preferences-file preferences.txt

It doesn't work anymore. Is there another way to load or save the current IDE preferences?

Arduino IDE 2.x uses Arduino CLI for all non-GUI related tasks. This means that some aspects of Arduino IDE 2.x can be configured via Arduino CLI's configuration, and of course that is all manageable via the command line.

The bundled copy of Arduino CLI is located in the resources/app/node_modules/arduino-ide-extension/build subfolder of the Arduino IDE 2.x installation folder.

The configuration file for Arduino CLI is located at ~/.arduinoIDE/arduino-cli.yaml.

The configuration of Arduino CLI is managed via the arduino-cli config command, which is documented here:
https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_config/

The configuration is documented here:
https://arduino.github.io/arduino-cli/latest/configuration/

The libraries folder is a subfolder of the sketchbook, and the sketchbook location is set via the directories.user configuration key. So if you want to change the libraries folder then you'll need to change the directories.user configuration. If the sketchbook was at /my/custom/sketchbook, then the command would look something like this:

resources/app/node_modules/arduino-ide-extension/build/arduino-cli --config-file ~/.arduinoIDE/arduino-cli.yaml config set directories.user /my/custom/sketchbook

Then you can just start Arduino IDE 2.x normally.

Thank you for the answer.

I found the files for the settings on Windows:

%APPDATA%/../../.arduinoIDE

arduino-cli.yaml and settings.json

If I understand it, you are changing the main settings and start the IDE, right?

On the old IDE I was able to start it with custom settings, without changing all settings for the other projects.

To be more precise, I had some custom settings (mypreferences.txt) in my project folder and merged them with the current settings (preferences.txt) in a temporary folder (temppreferences.txt) and used that to launch the IDE.

In this way, I was able to set different preferences for each project but leave the default settings when I started the IDE directly (without opening a project).

I assume, this is not possible anymore without modify some files inside the Arduino folders, right?