iTerm2 command line configuration

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