4.1 KB


Rain is a command line tool to store and categorize SSH hosts.

$ rain help
☔  ./rain <command> [options]

  ssh <alias>
  add [alias] [root@][hostname][:22]
  note <alias>
  search <alias|hostname|notes>
  delete <alias>

Report bugs at


Make sure you have your $gopath set. For bash you might do something like this:

$ mkdir -p ~/go/src ~/go/bin
$ echo 'export GOPATH=~/go' >> ~/.bashrc
$ echo 'export PATH=$PATH:$GOPATH/bin' >> ~/.bashrc
$ source ~/.bashrc

For fish:

$ mkdir -p ~/go/src ~/go/bin
$ echo "set -x GOPATH ~/go" >> ~/.config/fish/
$ echo "set -x PATH ~/go/bin $PATH" >> ~/.config/fish/

Then just use go get to retrieve rain:

$ go get -u


Hosts are saved with rain add.

$ rain add router admin@
☔	admin@ added successfully.

After that, rain ssh will connect to the server. router is the friendly name that is passed to the ssh subcommand.

$ rain ssh router
☔	Connecting to admin@
Last login: Tue Jun  9 14:05:22 2015 from

You can also run ad-hoc commands on the remote server by appending the command or commands after the hostname.

$ rain ssh router echo hello world
☔	Connecting to admin@
hello world
Connection to admin@ closed.

All of the stored hosts can be listed with rain list.

$ rain list
Alias              Hostname                     Hits
c7-employee             5
gitrex                      56
rpi                pi@          8
rpi2                      14
strider                     1

The list of servers can be searched with rain search.

$ rain search rpi
Alias    Hostname               Hits
rpi      pi@    8
rpi2           14

$ rain search 192.168.1
Alias     Hostname               Hits
router    admin@      1
rpi       pi@    8
rpi2           14

Not visible here, but the matching substrings are highlighted with color.


Automatic reconnection

If an SSH connection drops or SSH returns an unusual code, rain will automatically reconnect.

$ rain ssh managed
☔	Connecting to
Last login: Tue Jun  9 14:19:11 2015 from
[pat@managed ~]$ killall sshd
☔	Reconnecting. Press Ctrl+C to abort.
Last login: Tue Jun  9 14:20:08 2015 from
[pat@managed ~]$

Tab Completion

Press tab to autocomplete commands as well as hostnames.

$ rain ssh rpi<TAB>
rpi  (pi@  rpi2  (

This currently works with bash and fish shell.


Notes can be added to each saved server. The syntax is rain note friendlyname. This will open vim with the contents of any existing notes. These notes are searched also when using rain search, so it's helpful to add keywords into the notes.

$ rain search gitlab
Alias     Hostname      Hits
gitrex    57

These notes will be shown at each login as well.

$ rain ssh gitrex
☔	Connecting to
☔	Notes for gitrex:
Gitrex Gitlab Server
☔	Connected.
[root@gitrex ~]#

Best search match connection

If you rain ssh to a server that isn't in local database, but the name provided matches exactly one server as a substring, rain will automatically connect to that server.

$ rain search yapsbuilder
Alias              Hostname      Hits
phx-yapsbuilder    3
$ rain ssh yaps
☔	Matched one result, going to
Last login: Thu Jun  4 13:14:07 2015 from
[root@phx1-yapsbuilder1 ~]#

No match connection

If no matches are found, rain will connect to the provided hostname. It will still auto-reconnect if the SSH connection drops.


Feedback is very welcome. Please send any here: