Then put this at the top of your system script(eg: ~/.premake/premake-system.lua):
require"export-compile-commands"
Note that while possible, it is not recommended to put the require line in
project-specific premake configuration because the "export-compile-commands"
module will need to be installed everywhere your project is built.
After the above steps, the "export-compile-commands" action will be available
for your projects:
By default, the above command creates a compile_commands.json file near your
other generated project files, but you can override with the --output-file
option: