ssh2iterm2

command module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2018 License: MIT Imports: 11 Imported by: 0

README

Create iTerm2 dynamic profile from SSH config

Build Status release Go Report Card

Converts your ~/.ssh/config to Dynamic profiles in iTerm2.

By default it looks up your Host definitions in ~/.ssh/config.

You can supply another location via the environment variable SSH2ITERM2_GLOB.

I.e. set SSH2ITERM2_GLOB=~/.ssh/config.d/*.conf to run through all *.conf files in ~/.ssh/config.d and SSH2ITERM2_GLOB=~/.ssh/**/*.conf will run through all *.conf files in all folders under ~/.ssh.

The glob pattern should follow Gos path/filepath patterns.

The generated dynamic profile

The generated dynamic profile has some features/caveats (they suit me well :-)

  • The command is not a direct call to ssh. That is because iTerm2 doesn't have /usr/local/bin in its path. Instead we wrap it in a call to sh:

    sh -c 'PATH=/usr/local/bin:$PATH ssh <host>'
    
  • We add the host as a badge

  • If the the filename where the Host is defined is not config we use the filename as a tag on the profile (extension removed from file, preprending digits followed by underscore removed).

    This way you can group your Hosts.

    I.e. all Hosts defined in 20_production.conf will get a "production" tag.

  • A trigger that opens iTerm2s password manager is added on the regular expression \\[sudo\\] password for.

    The password manager will get the host name as parameter.

Download

A compiled MacOS binary can be downloaded from releases.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL