I've done this a bit using atprogram, which is found in the "atbackend" folder in the Atmel Studio install directory. I went back and found a little thing I wrote a while ago for one-click programming of a device, here's the key line from it:
bin\atprogram --tool AtmelICE --interface SWD --device ATSAMD11D14AM --force --clock 4MHz --externalreset info --signature chiperase program -f app/program.elf --verify > tmplog
The "> tmplog" at the end just redirects output to a temporary file so that it can be parsed to check for errors. This is for one of the ATSAM (ARM) devices obviously, but I believe atprogram will work with any target the Atmel ICE supports. The interface flag says that "aWire, debugWIRE, HVPP, HVSP, ISP, JTAG, PDI, UPDI, TPI, and SWD" are all supported, so that's pretty comprehensive, given that the Atmel ICe doesn't support half of those
. Looks like it also supports the snap, pickit4, and flip tools. Running atprogram with no parameters will get you a list of the available commands.