You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Auto-suggest hostnames from `~/.ssh/*` and `/etc/hosts` (sources can be individually disabled).
13
-
- Remembers usernames, so you don't have to type them in every time. (You can also remove connections from your history or disable it entirely.)
26
+
- Auto-suggest hostnames
27
+
- Remembers usernames, so you don't have to type them in every time
14
28
- Alternate actions:
15
-
- Open connection with mosh instead of SSH.
16
-
- Open SFTP connection instead of SSH.
17
-
- Ping host.
18
-
19
-
20
-
### Data sources
21
-
22
-
The workflow reads hosts from the following sources (in this order of priority):
23
-
24
-
1.`~/.ssh/config`
25
-
2. History (i.e. username + host addresses previously entered by the user)
26
-
3.`~/.ssh/known_hosts`
27
-
4.`/etc/hosts`
28
-
5.`/etc/ssh/ssh_config`
29
-
30
-
29
+
- Open connection with **mosh**
30
+
- Open **SFTP** connection
31
+
-**Ping** host
32
+
- Sources (can be managed individually):
33
+
-`~/.ssh/config`
34
+
-`~/.ssh/known_hosts`
35
+
- History (i.e. username + host addresses previously entered by the user)
36
+
-`/etc/hosts`
37
+
-`/etc/ssh/ssh_config`
38
+
39
+
40
+
<aid="installation"></a>
31
41
Installation
32
42
------------
33
43
34
44
Download [the latest release][gh-releases] and double-click the file to install in Alfred.
35
45
36
46
47
+
<aid="usage"></a>
37
48
Usage
38
49
-----
39
50
40
-
Keyword is `ssh`:
51
+
The main keyword is `ssh`:
41
52
42
53
-`ssh [<query>]` — View and filter known SSH connections.
43
54
44
-
-`↩` or `⌘+<NUM>` — Open the connection.
45
-
-`⇥` — Expand query to selected connection's title. Useful for adding a port number.
46
-
-`⌘+↩` — Open an SFTP connection instead.
47
-
-`⌘+⌥` — Open a mosh connection instead.
48
-
-`⇧+↩` — Ping host.
49
-
-`^+↩` — Forget connection (if it's from history).
55
+
-`↩` or `⌘+<NUM>` — Open the connection.
56
+
-`⇥` — Expand query to selected connection's title. Useful for adding a port number.
57
+
-`⌘+↩` — Open an SFTP connection instead.
58
+
-`⌥+↩` — Open a mosh connection instead.
59
+
-`⇧+↩` — Ping host.
60
+
-`^+↩` — Forget connection (if it's from history).
61
+
62
+
Configuration is managed with `sshconf`:
63
+
64
+
-`sshconf [<query>]` — Edit workflow settings (see [Configuration](#configuration))
65
+
-`An Update is Available!` or `Workflow is Up to Date` — Action to check for an update and install if one is available.
66
+
-`Source: XYZ` — Toggle source on/off
67
+
-`Log File` — Open workflow's log file in the default app (usually Console.app)
68
+
-`Documentation` / `Report Issue` / `Visit Forum` — Open docs, issue tracker or forum thread in your browser.
69
+
70
+
71
+
<aid="configuration"></a>
72
+
### Configuration ###
73
+
74
+
Sources can be configured from within the workflow using the `sshconf` keyword. Other settings are managed via the [workflow's configuration sheet][confsheet].
75
+
50
76
77
+
<aid="sources"></a>
78
+
#### Sources ####
51
79
52
-
### Configuration
80
+
The following sources are available and can be toggled on/off using `sshconf`:
53
81
54
-
There are several options available in the workflow's configuration sheet. Notably, you can turn off individual autosuggestion sources.
|`DISABLE_CONFIG`| Set to `1` to turn off suggestions from `~/.ssh/config`. |
59
-
|`DISABLE_ETC_CONFIG`| Set to `1` to turn off suggestions from `/etc/ssh/ssh_config`. |
60
-
|`DISABLE_ETC_HOSTS`| Set to `1` to turn off suggestions from `/etc/hosts`. |
61
-
|`DISABLE_HISTORY`| Set to `1` to disable the History (reading and writing). |
62
-
|`DISABLE_KNOWN_HOSTS`| Set to `1` to turn off suggestions from `~/.ssh/known_hosts`. |
63
-
|`EXIT_ON_SUCCESS`| Set to `1` (default) to close shell if `ping` or `mosh` command exits cleanly |
64
-
|`EXTERNAL_TRIGGER`| Set to `1` to use an External Trigger instead of AppleScript to re-open Alfred. The External Trigger is safer, but leaves Alfred in a weird mode. |
65
-
|`MOSH_CMD`| Set to the full path to `mosh` if your shell can't find it. Set to empty to disable `mosh` connections. |
66
90
67
-
<!--
68
-
**Please note**: The workflow generates an `ssh://` (or `sftp://`) URL and asks Alfred to open it. Similarly, the `ping` and `mosh` features uses Alfred 3's Terminal Command feature. If it's not opening in the right app, it's not the workflow's fault.
69
-
-->
91
+
<aid="advanced-configuration"></a>
92
+
#### Advanced configuration ####
70
93
71
-
For SSH and SFTP connections, the workflow creates an `ssh://` (or `sftp://`) URL and asks the system to open it. These will open in whichever application you have configured to handle these URLs (Terminal.app is the default for `ssh://`).
94
+
There are several additional settings that can only be edited via the [workflow's configuration sheet][confsheet], which allow you to specify a few commands and applications.
72
95
73
-
The `ping` and `mosh` commands use Alfred's [Terminal Command][alfterm] output, which also call Terminal.app by default.
96
+
To understand these, it's necessary to understand a bit about how the workflow works.
74
97
98
+
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][termcmd], which effectively creates a new tab in your default terminal and pastes the command in there.
75
99
76
-
#### Using iTerm2
100
+
101
+
##### URLs #####
102
+
103
+
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.
104
+
105
+
106
+
##### Commands #####
107
+
108
+
The handling of shell commands is configured in Alfred's own preferences (see [Using iTerm2](#using-iterm2) for more information).
109
+
110
+
There are two commands you can configure in the workflow, `MOSH_CMD` and `SSH_CMD`.
111
+
112
+
`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.
113
+
114
+
Set `MOSH_CMD` to empty to disable mosh.
115
+
116
+
`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.
117
+
118
+
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.
119
+
120
+
121
+
<aid="using-iterm2"></a>
122
+
#### Using iTerm2 ####
77
123
78
124
If you'd prefer to use iTerm2 rather than Terminal.app, there are two steps:
79
125
80
-
1. To have `ping` and `mosh` commands open in iTerm2, install [@stuartcryan][stuart]'s [iTerm2 plugin for Alfred][iTerm2-plugin].
81
-
2. To open `ssh:` connections in iTerm2, Set iTerm2 as the default handler for `ssh:` URLs in iTerm2's own preferences under `Profiles > PROFILE_NAME > General > URL Schemes`:
126
+
1. To have shell commands open in iTerm2, install [@stuartcryan][stuart]'s [iTerm2 plugin for Alfred][iTerm2-plugin].
127
+
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`:
82
128
83
129
![iTerm2 > Preferences > PROFILE_NAME > General > URL Schemes][iTerm2-screenshot]
84
130
85
131
86
-
Licencing & thanks
132
+
<aid="licensing--thanks"></a>
133
+
Licensing & thanks
87
134
------------------
88
135
89
136
This workflow is released under the [MIT Licence][mit].
90
137
91
-
It uses the following libraries and resources:
138
+
It uses the following libraries (all [MIT Licence][mit]):
139
+
140
+
-[ssh_config][ssh_config] to parse SSH config files.
141
+
-[AwGo][awgo] for the workflowy stuff.
142
+
143
+
And icons from or based on the following fonts (all [SIL Licence][sil]):
92
144
93
-
-[ssh_config][ssh_config] ([MIT Licence][mit]) by [havoc-io][havoc-io] to parse SSH config files.
94
-
-[awgo][awgo] ([MIT Licence][mit]) for the workflowy stuff.
95
-
-The icon is based on [Octicons][octicons] ([SIL Licence][sil]) by [Github][gh].
145
+
-[Octicons][octicons]
146
+
-[Material Design Iconic Font][material]
147
+
-[FontAwesome][fontawesome]
96
148
97
-
This workflow started as a port of [@isometry's][isometry] Python [SSH workflow][ssh-breathe] to Go as a testbed for [awgo][awgo]. It has since gained some additional features.
149
+
This workflow started as a port of [@isometry's][isometry] Python [SSH workflow][ssh-breathe] to Go as a testbed for [AwGo][awgo]. It has since gained some additional features.
98
150
99
151
If you need Alfred 2 support, check out [@isometry's workflow][ssh-breathe].
100
152
101
153
154
+
<aid="changelog"></a>
102
155
Changelog
103
156
---------
104
157
158
+
- v0.8.0 — 2018-03-17
159
+
- Add option to use `ssh` command instead of URL.
160
+
Enables loading of local shell configuration before opening connection. #8
161
+
- Add in-workflow configuration of sources
162
+
- Add links to docs, issue tracker and forum thread
105
163
- v0.7.1 — 2016-12-12
106
-
- Fix updater bug
107
-
- Smarter SSH URLs for hosts from `~/.ssh/config`
108
-
- Better removal of duplicates
164
+
- Fix updater bug
165
+
- Smarter SSH URLs for hosts from `~/.ssh/config`
166
+
- Better removal of duplicates
109
167
- v0.6.0 — 2016-11-09
110
-
- Add in-workflow updates
168
+
- Add in-workflow updates
111
169
- v0.5.0 — 2016-10-31
112
-
- Add support for SSH configuration files (`~/.ssh/config` and `/etc/ssh/ssh_config`)
113
-
- Alternate action: open connection with `mosh`
170
+
- Add support for SSH configuration files (`~/.ssh/config` and `/etc/ssh/ssh_config`)
171
+
- Alternate action: open connection with `mosh`
114
172
- v0.4.0 — 2016-05-27
115
-
- Add ability to turn sources of suggestions off #1
173
+
- Add ability to turn sources of suggestions off #1
116
174
- v0.3.0 — 2016-05-26
117
-
- Alternate action: Open SFTP connection
118
-
- Alternate action: Ping host
119
-
- Remember connections with usernames, so you don't have to type the username each time
175
+
- Alternate action: Open SFTP connection
176
+
- Alternate action: Ping host
177
+
- Remember connections with usernames, so you don't have to type the username each time
0 commit comments