This all can be done using Arduino CLI. This toolchain is fully based upon this really great tool: There are no tricks, no hacks, no manual parsing of obscure text files at undocumented locations.