DFU-restore Apple Silicon Macs from the command line
restorekit lets you fully wipe or restore a T2 or M series mac without
using any apple tools. Plug the target mac into your host's DFU port,
put it in DFU mode (automatic DFU only works from a macOS host), then:
sudo restorekit-cli restore
This snap needs raw USB access to talk to the device:
sudo snap connect restorekit-cli:raw-usb