IDE parameters ?

There should be a way to define the board type in the code before compilation.
It can be also handled in separate file in the project folder including the settings now under the 'Tools' tag

For example: (DO NOT COPY, NOT WORKING CODE AS 20may2024)
#define card "LOLIN(WEMOS) D1 mini"
#define Erase Flash: "Only Sketsh"
#define Serial Port Speed "74880"

I am using many kind of cards with many kind of special settings even during the same session and many Arduino IDEs open at the same time.
Checking all the settings every time you compile something takes time and is annoying.