An Alfred Workflow for SSH aliases
Although I was already using the good SSH plugin from Oh My ZSH to provide alias-based autocompletion, I wanted to be able to access my configured aliases from Alfred for its ability to remember often used options, so I created a workflow.
The workflow is tiny and is made of a script filter input and a run script action.
The input script is a shell script using jq
to format the Alfred output as JSON.
cat ~/.ssh/config \
| grep -E "^Host " \
| sed 's/Host //' \
| xargs -I _ echo '{"title": "_", "uid": "_", "arg": "_"}' \
| jq -s '{ items: . }'
The action script opens a new WezTerm window with a custom command to start, receiving the {query}
from the input script.
open -a wezterm --new --args start ssh {query}
If you use another terminal application, you should be able to find a way to setup the same kind of opening with a quick search, be it Google, ChatGPT or Claude.
Et voilà, I can connect to my servers in seconds: