If you select File > Preferences > Show verbose output during: > upload and then do an Upload, Upload Using Programmer, or Burn Bootloader, then check the contents of the black console window at the bottom of the Arduino IDE window you will find the avrdude command(s) the Arduino IDE used to do that operation. You can copy that command, modify it as you like, then run it from the command line or a script.
Note that Burn Bootloader is done in two commands. One sets the fuses, the next flashes the bootloader.
You will find the AVRDUDE documentation here:
https://www.nongnu.org/avrdude/user-manual/avrdude.html