iTerm2 command line configuration Is there a way to configure iTerm2 preferences from the command line?  I am specifically looking to automate setting the Key preferences, for instance configuring escape codes to be sent when certain key combinations are pressed.  I am using a script similar to https://mths.be/macos for other osx automation.

Thanks!
Is there a way to configure iTerm2 preferences from the command line?


Technically, it's possible.  Your keybinding are held in your profile which is accessible in ~/Library/Prferences/com.googlecode.iterm2.plist.  To write custom profiles you will have to...  


Convert to XML (plutil -convert xml1)
Make your changes
Convert back to Binary (plutil -convert binary1)


(I highly suggest making backups of your original .plist before doing this.)

This will require some due diligence and reverse engineering on your end to ensure you're adhering to the XML structure for iTerm as this isn't documented anywhere.

An alternative to this would be to look at Dynamic Profiles within iTerm2