Package: itomate
iTomateAutomate your iTerm layouts and session setupDefine your iTerm layouts, commands to execute in the form of yaml files and run a single command to have iTerm prepare itself for you to start working.RequirementsiTerm2 Version 3.3 or laterPython 3.5 or laterInstallationMake sure that you are running Python 3.5 or laterpipinstallitomateEnable Python API usagein iTerm preferences.itomate--versionExampleThe layout, number of panes, tabs, titles and commands is configurable and is detailed below.UsageOpen iTerm and simply run the below commanditomate-cconfig.ymlIf you don't provide-cflag, itomate will look foritomate.ymlfile in the current directory and use that.Here is the list of options availableitomate[-c,--config<config-file>]# Sets up the iTerm session[-h,--help]# Shows the help screen[-v,--version]# Shows the installed itomate version[-n,--new]# Runs itomate in a new windowConfigurationConfiguration file to set up the sessions has the format belowversion: "1.0"
profile: "My Profile"
tabs:
  window-1:
    root: "~/Documents/Projects/my_project"
    title: "Window 1"
    panes:
      - title: "Some Pane Title"
        position: "1/1"
        commands:
         - !ENV "db authenticate ${DB_PASSWORD}"
         - "second command"
        prompt: "populated command"
      - position: "1/2"
        focus: true
        badge: "Jobs"
      - position: "2/1"
      - position: "2/2"
  window-2:
    title: "Window 2"
    panes:
      - position: "1/1"
      - position: "1/2"
      - position: "2/1"Details for each of the configuration objects above is given belowKeyDescriptionversionRefers to the itomate configuration version. Should always be 1.profileName of the profile you would like to use for all panes. If using-nargument to launch a new window, then window specific profile settings will be appliedtabsWindows or tabs in the iTerm window.window-1Replace with the unique project id e.g.web-catalog-pimrootRoot path for all panes within a tabtitleTitle to be shown in the title bar of the current tabbadgeSet the Badge Text of the panepositionPosition of the pane in the window. It has the format ofnumber1/number2wherenumber1refers to the column andnumber2refers to the row in the column. More on this later in the readme.positionis the only required key in a panefocusPane to be in focus when itomate is finished.focus: true. There should only be one focus flag per Tab. If multiple are found, it will focus on the last pane evaluated.commandsList of commands to execute in the current pane.promptA command which will remain populated in the prompt after allcommands have finished executing. Thepromptcommand itself is not executed automatically.Environment VariablesOperating System Environment Variables can be used to create templates with secrets and variables. This allows itomate files to be safely committed to version control. Note in the above configuration example the line using the environment variable is prefixed with the!ENVtag and then uses one or more Environment Variables
wrapped in the${ }syntax.LayoutsThe parameterpositionin each pane decides where each of the window panes will be displayed. The position value has the format belowx/y–bothxandyarerequiredparameters

x:referstothecolumninthewindow
y:referstotherowofthegivencolumnxHere are some of the examples for different pane layoutsSingle Pane WindowFor single pane, since there is one column and one row, the position for pane would be1/1.------------------.
| 1/1              |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
|                  |
'------------------'Here is how the configuration would look likeversion: "1.0"
tabs:
  some-project:
    title: "Some Project"
    panes:
      - title: "Single Pane"
        position: "1/1"
        commands:
          - "cd ~/Workspace/some-project"
          - "git pull origin master"
          - "yarn dev"Two Panes Vertical Split LayoutFor two panes with equal split or in other words two columns with one row in each, the positions would be1/1for the pane on the left and2/1for the pane on the right i.e. the second column..------------------.------------------.
| 1/1              | 2/1              |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'Here is how it would look in the configurationversion: "1.0"
tabs:
  some-project:
    root: "~/Workspace/some-project"
    title: "Some Project"
    panes:
      - title: "First Half"
        position: "1/1"    # <-- Notice the position
      - title: "Second Half"
        position: "2/1"    # <-- Notice the positionTwo Columns, Three Panes LayoutThe layout below now has two columns. First column has only one row so position for that would be1/1. For the second column we have two panes i.e. two rows; first pane in the second column would be2/1and the second one would be2/2..------------------.------------------.
| 1/1              | 2/1              |
|                  |                  |
|                  |                  |
|                  |                  |
|                  |------------------|
|                  | 2/2              |
|                  |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'Configuration for that would be:version: "1.0"
tabs:
  some-project:
    root: "~/Workspace/dev-server"
    title: "Some Project"
    panes:
      - position: "1/1"    # <-- Notice the position
      - position: "2/1"    # <-- Notice the position
        commands:
          - "./run"
      - position: "2/2"    # <-- Notice the position
        commands:
          - "git standup"Note that thecommandsandtitleare optional parameters in panes. Onlypositionis required.Two Columns, Four Panes Layout.------------------.------------------.
| 1/1              | 2/1              |
|                  |                  |
|                  |                  |
|                  |                  |
|------------------|                  |
| 1/2              |                  |
|                  |                  |
|                  |                  |
|------------------|                  |
| 1/3              |                  |
|                  |                  |
|                  |                  |
'------------------'------------------'Configuration for that would be:version: "1.0"
tabs:
  some-project:
    root: "~/Workspace/project"
    title: "Some Project"
    panes:
      - position: "1/1"    # <-- Notice the position
        commands:
          - "Make clean"
      - position: "1/2"    # <-- Notice the position
        commands:
          - "git standup"
      - position: "1/3"    # <-- Notice the position
        commands:
          - "git standup"
      - position: "2/1"    # <-- Notice the position
        commands:
          - "./run"Three Columns Five Pane Layout.------------------.------------------.------------------.
| 1/1              | 2/1              | 3/1              |
|                  |                  |                  |
|                  |                  |                  |
|                  |                  |                  |
|                  |------------------|                  |
|                  | 2/2              |                  |
|                  |                  |                  |
|                  |                  |                  |
|                  |------------------|                  |
|                  | 2/3              |                  |
|                  |                  |                  |
|                  |                  |                  |
'------------------'------------------'------------------'Configuration for that would beversion: "1.0"
tabs:
  some-project:
    title: "Some Project"
    panes:
      - position: "1/1"    # <-- Notice the position
      - position: "2/1"    # <-- Notice the position
      - position: "2/2"    # <-- Notice the position
      - position: "2/3"    # <-- Notice the position
      - position: "3/1"    # <-- Notice the positionContributorsSpecial thanks to the contributors for making iTomate possible@zakiuu@JohnLegrandRichards@zachvalenta@PSalant726You?Similar ProjectsThere isitermocilwhich relies onApplescript that has been deprecated by iTerm, has limited layout options, and is pretty limited in terms of what it can achieve because of AppleScript. iTomate on the other hand uses iTerm'snewly introduced Python API, has flexible layouts support and can be extended using iTerm's pretty powerful API.ContributionsFeel free to submit pull requests, create issues, spread the word.LicenseMIT ©Kamran Ahmed