• Stars
    star
    356
  • Rank 119,446 (Top 3 %)
  • Language
    Go
  • License
    Other
  • Created over 8 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Open SSH/SFTP/mosh connections from Alfred 3+

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

Features

  • Auto-suggest hostnames
  • Remembers usernames, so you don't have to type them in every time
  • Alternate actions:
    • Open connection with mosh
    • Open SFTP connection
    • Ping host
  • Sources (can be managed individually):
    • ~/.ssh/config
    • ~/.ssh/known_hosts
    • History (i.e. username + host addresses previously entered by the user)
    • /etc/hosts
    • /etc/ssh/ssh_config

Installation

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

Usage

The main keyword is ssh:

  • ssh [<query>] β€” View and filter known SSH connections.

    • ↩ or ⌘+<NUM> β€” Open the connection.
    • β‡₯ β€” Expand query to selected connection's title. Useful for adding a port number.
    • ⌘+↩ β€” Open an SFTP connection instead.
    • βŒ₯+↩ β€” Open a mosh connection instead.
    • ⇧+↩ β€” Ping host.
    • ^+↩ β€” Forget connection (if it's from history).

Configuration is managed with sshconf:

  • sshconf [<query>] β€” Edit workflow settings (see Configuration)
    • An Update is Available! or Workflow is Up to Date β€” Action to check for an update and install if one is available.
    • Source: XYZ β€” Toggle source on/off
    • Log File β€” Open workflow's log file in the default app (usually Console.app)
    • Documentation / Report Issue / Visit Forum β€” Open this file, the workflow's issue tracker or forum thread in your browser.

Configuration

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

Sources

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

Name Source
SSH Config ~/.ssh/config
SSH Config (system) /etc/ssh/ssh_config
/etc/hosts /etc/hosts
History User-entered hostnames
Known Hosts ~/.ssh/known_hosts

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.

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.

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.

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

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.

Changelog

  • v0.9.0

  • v0.8.0 β€” 2018-03-17
    • Add option to use ssh command instead of URL. Enables loading of local shell configuration before opening connection. #8
    • Add in-workflow configuration of sources
    • Add links to docs, issue tracker and forum thread
  • v0.7.1 β€” 2016-12-12
    • Fix updater bug
    • Smarter SSH URLs for hosts from ~/.ssh/config
    • Better removal of duplicates
  • v0.6.0 β€” 2016-11-09
    • Add in-workflow updates
  • v0.5.0 β€” 2016-10-31
    • Add support for SSH configuration files (~/.ssh/config and /etc/ssh/ssh_config)
    • Alternate action: open connection with mosh
  • v0.4.0 β€” 2016-05-27
    • Add ability to turn sources of suggestions off #1
  • v0.3.0 β€” 2016-05-26
    • Alternate action: Open SFTP connection
    • Alternate action: Ping host
    • Remember connections with usernames, so you don't have to type the username each time
  • v0.2.0 β€” 2016-05-23
    • First public release

More Repositories

1

alfred-workflow

Full-featured library for writing Alfred 3 & 4 workflows
Python
2,970
star
2

awgo

Go library for Alfred 3 + 4 workflows
Go
859
star
3

alfred-convert

Convert between different units in Alfred
Python
721
star
4

zothero

Rapidly search and cite Zotero entries from Alfred
Python
477
star
5

alfred-stackexchange

Search StackOverflow.com from Alfred
Python
434
star
6

alfred-fixum

Fix Alfred 3 Python workflows affected by the Sierra/Alfred-Workflow background process bug
Python
369
star
7

alfred-firefox

Search and control Firefox from Alfred
Go
342
star
8

alfred-repos

Browse, search and open Git repositories in Alfred
Python
313
star
9

alfred-searchio

Alfred workflow to auto-suggest search results from multiple search engines and languages.
HTML
306
star
10

alfred-pwgen

Generate passwords with Alfred
Python
290
star
11

alfred-fakeum

Generate fake test data in Alfred
Python
288
star
12

alfred-gcal

View Google Calendar events in Alfred
Go
222
star
13

alfred-reddit

Browse Reddit from Alfred
Python
214
star
14

alfred-safari-assistant

Alfred 3+ workflow to search and use Safari bookmarks, history, reading list and tabs.
Go
190
star
15

alfred-vpn-manager

Manage Tunnelblick & Viscosity VPN connections from Alfred
Python
154
star
16

alfred-smartfolders

Quick access to your Smart Folders (Saved Searches) from Alfred
Python
119
star
17

alfred-fuzzy

Fuzzy search helper for Alfred 3+ workflows
Python
93
star
18

alfred-appscripts

Alfred workflow to search and run/open AppleScripts for the active application
Python
87
star
19

alfred-sublime-text

Filter and open your Sublime Text (2 and 3) project files from Alfred.
Go
73
star
20

i-sheet-you-not

Automagically turn Excel spreadsheets into Alfred 3 Workflows
Python
67
star
21

alfred-mailto

Send emails to recipients and groups from Alfred
Python
64
star
22

alfred-fuzzyfolders

Fuzzy search across folder subdirectories
Python
57
star
23

alfred-unicode

Preview Unicode characters and emoji in Alfred
Go
57
star
24

alfred-booksearch

Search Goodreads.com from Alfred
Go
56
star
25

alfred-similar-image-search

Google Image searches based on local files via Alfred
Python
50
star
26

alfred-packal-search

Search Packal.org's collection of Alfred workflows from Alfred
Python
43
star
27

alfred-services

Run macOS services from Alfred
Go
39
star
28

go-safari

Access Safari bookmarks, reading list, history and tabs (macOS)
Go
38
star
29

alfred-relative-dates

Alfred workflow to generate relative dates in different locales
Python
35
star
30

alfred-network-location

List, filter and activate network locations from within Alfred
Python
32
star
31

alfred-duden

Search the duden.de German dictionary from Alfred. With auto-suggest.
Python
32
star
32

alfred-index-demo

Demonstration of using sqlite as a search index in Alfred
Python
26
star
33

alfred-default-folder-x

Access your Default Folder X favourites and recent items in Alfred
Python
25
star
34

alfred-forklift

Filter ForkLift favourites in Alfred
Go
23
star
35

alfred-resolve-url

Alfred workflow to resolve HTTP redirects and return the canonical URL
Python
14
star
36

alfred-gifs

Say it with GIFs (and Alfred)
Python
12
star
37

bundler-icon-server

Generate PNG icons from icon fonts like Font Awesome
HTML
12
star
38

go-env

Access environment variables & populate structs from them
Go
11
star
39

alfred-errnum

Search macOS errors in Alfred 3
Python
10
star
40

alfred-mpd

Control mpd music player from Alfred 3
Python
9
star
41

go-fuzzy

Fuzzy matching & sorting for Go
Go
9
star
42

alfred-glosbe

Translate in Alfred using Glosbe.com
Python
8
star
43

CopyLink.mmBundle

MailMate Command to copy a link to the currently selected email
Python
8
star
44

alfred-transmit

Rapidly search Transmit favourites in Alfred
Go
5
star
45

alfred-bundler-python-demo

Demo Workflow showing how to use the Alfred Bundler in Python
Python
5
star
46

cookiecutter-alfred-workflow

cookiecutter template for Alfred 2 workflows
Python
4
star
47

alfred-star-ratings

Add star ratings to your files on OS X with Alfred
Python
4
star
48

alfred-excel-demo

Demo workflow showing how to use an Excel file as a data source for an Alfred Script Filter
Python
4
star
49

alfred-reminders-demo

Goto lists in Reminders.app
Python
3
star
50

bundler-icon-server-iconpacks

Icon packs for Bundler Icon Server
2
star
51

alfred-subdir-search

Alfred 2 Workflow to search subdirectories
Python
2
star
52

alfred-flixsearch

Search FlixSearch.io from Alfred 2
Python
2
star
53

www.deanishe.net

Hugo static site source
Go
1
star
54

just-a-test

Test Repo for GH API
1
star
55

alfred-workflow-dummy

A dummy repo for testing Alfred-Workflow's update functionality
Python
1
star
56

deanishe.github.io

Generated contents of www.deanishe.net
HTML
1
star