Home

Awesome

Secure SHell for Alfred

Open SSH/SFTP/mosh connections from Alfred 3 with autosuggestions based on SSH config files, /etc/hosts and your history.

demo

<!-- MarkdownTOC autolink="true" bracket="round" levels="1,2,3,4" autoanchor="true" --> <!-- /MarkdownTOC -->

<a id="features"></a> Features

<a id="installation"></a> Installation

Download the latest release and double-click the file to install in Alfred.

<a id="usage"></a> Usage

The main keyword is ssh:

Configuration is managed with sshconf:

<a id="configuration"></a> Configuration

Sources can be configured from within the workflow using the sshconf keyword. Other settings are managed via the workflow's configuration sheet.

<a id="sources"></a>

Sources

The following sources are available and can be toggled on/off using sshconf:

NameSource
SSH Config~/.ssh/config
SSH Config (system)/etc/ssh/ssh_config
/etc/hosts/etc/hosts
HistoryUser-entered hostnames
Known Hosts~/.ssh/known_hosts

<a id="advanced-configuration"></a>

Advanced configuration

There are several additional settings that can only be edited via the workflow's configuration sheet, which allow you to specify a few commands and applications.

To understand these, it's necessary to understand a bit about how the workflow works.

The workflow opens connections either via a URL (sftp://... and ssh://... by default) or via a shell command (ping and mosh by default). URLs are passed off to the system, which opens them in the default application. Shell commands are handled by Alfred's Terminal Command Action, which effectively creates a new tab in your default terminal and pastes the command in there.

<a id="urls"></a>

URLs

If you'd like sftp://... or ssh://... URLs to be passed to a specific application, specify its name for SFTP_APP or SSH_APP respectively, e.g. Transmit or ForkLift for SFTP, or Terminal for SSH.

<a id="commands"></a>

Commands

The handling of shell commands is configured in Alfred's own preferences (see Using iTerm2 for more information).

There are two commands you can configure in the workflow, MOSH_CMD and SSH_CMD.

MOSH_CMD sets the command that is pasted in your terminal when the command is run. Normally, the default of mosh should be sufficient, but set to a full path if the command can't be found.

Set MOSH_CMD to empty to disable mosh.

SSH_CMD allows you to override the default behaviour of generating and opening an ssh://... URL. If SSH_CMD is non-empty, a shell command is generated and run in your terminal instead. SSH_CMD is the name or path of the ssh command.

Compared to the default ssh://... URL method, this has the advantage of running the command in your own shell, so your local configuration files should be loaded before the SSH connection is made. It has the downside of being slower and less well-tested than the default URL method.

<a id="using-iterm2"></a>

Using iTerm2

If you'd prefer to use iTerm2 rather than Terminal.app, there are two steps:

  1. To have shell commands open in iTerm2, install @stuartcryan's iTerm2 plugin for Alfred.
  2. To open ssh://... URLs in iTerm2, Set iTerm2 as the default handler for ssh: URLs in iTerm2's own preferences under Profiles > PROFILE_NAME > General > URL Schemes:

iTerm2 > Preferences > PROFILE_NAME > General > URL Schemes

<a id="licensing--thanks"></a> Licensing & thanks

This workflow is released under the MIT Licence.

It uses the following libraries (all MIT Licence):

And icons from or based on the following fonts (all SIL Licence):

This workflow started as a port of @isometry's Python SSH workflow to Go as a testbed for AwGo. It has since gained some additional features.

If you need Alfred 2 support, check out @isometry's workflow.

<a id="changelog"></a> Changelog