derimagia / sshconfig2iterm

Convert your SSH Config files to iTerm Dynamic Profiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#sshconfig2iterm

This will convert ssh config files (located at ~/.ssh/config) to iTerm2 Dynamic Profiles.

Because this is for iTerm, this will only work on Mac.

To install, run:

npm i -g sshconfig2iterm # Install it

sshconfig2iterm # Generated and print out a iTerm2 dynamic profile from the file found at ~/.ssh/config
sshconfig2iterm --save # to save the profile to ~/Library/Application Support/iTerm2/DynamicProfiles/profiles.json

Example Config Mapping

~/.ssh/config
Host sample # Example Server
  #Tags server, example
  User testuser
  HostName example.com

Will convert to:

#####profile.json

{
  "Profiles": [
    {
      "Guid": "sample",
      "Name": "Example Server",
      "ShortCut": "",
      "Custom Command": "Yes",
      "Command": "ssh sample",
      "Tags": [
        "server",
        "example"
      ]
    }
  ]
}

The Name is first taken from the '#Label' paramter. If this isn't found it'll grab it from the Comment on the same line of the host. It falls back to the Host parameter.

About

Convert your SSH Config files to iTerm Dynamic Profiles


Languages

Language:JavaScript 100.0%