iOS Shortcuts
On iPhone and iPad, the Shortcuts app can open a session to a saved host, or run a command, a snippet, a batch or a workflow, in ZestSSH. From 4.0, ZestSSH has three actions of its own in the Shortcuts app, with Siri phrases (iOS 16 and later). Any shortcut can also open ZestSSH with a zestssh:// link, from the Open URLs action. Either way ZestSSH opens and asks before it does anything.
ZestSSH’s actions
Section titled “ZestSSH’s actions”In the Shortcuts app, add an action and search for ZestSSH:
| Action | Fill in | What it does |
|---|---|---|
| Connect via SSH | Host: the name of a saved host, or its ID | Opens ZestSSH, which asks Connect to web-01? and opens a session when you tap Connect |
| Run SSH Command | Host, Command, Timeout (seconds) (5 to 300, 30 by default) and API Key | Opens ZestSSH, which asks Run this from a link? and runs the command when you tap Run |
| Run SSH Snippet | Host, Snippet Name and API Key | The same, for a saved snippet |
The two run actions need an API key and the same setup as a link (see Run a command from a link): automation on, a key from Automation > API keys, and the host’s key allowed for unattended runs. The key is kept in your shortcut, so do not share a shortcut that holds it.
The action itself returns “Command sent to ZestSSH” or “Snippet sent to ZestSSH” to the shortcut, not the command’s output. The actions’ words are in the app’s twelve languages.
On iOS 15 the actions are not offered: use a link instead.
Open a session
Section titled “Open a session”A link that names a saved host opens a session to it:
zestssh://connect?name=web-01ZestSSH looks for the host in your personal space by its name, in any letter case, then by its ID (zestssh://connect?id=HOST_ID names it by ID alone). It asks Connect to web-01? (“A widget, a shortcut or a link asked to open a session to …”) and opens the session when you tap Connect. If no host has that name, it says “No host named web-01 is saved in your personal space.”
A link with an address instead, zestssh://connect?host=192.0.2.10&user=alex&port=22, opens Quick connect filled in. See Endpoints for every link.
Opening a session needs no API key.
Run a command from a link
Section titled “Run a command from a link”The Shortcuts app can open a zestssh:// link that carries your API key. ZestSSH runs it the same way as on Android:
-
In ZestSSH, open More > Automation, turn on External automation (needs Squeezed), and create a key under API keys. Copy it when it is shown: it is shown only once.
-
In Keys, open the key the host signs in with and turn on Allow unattended runs.
-
In your shortcut, add the Open URLs action, with a link such as:
zestssh://execute?connection=web-01&command=uptime&key=YOUR_API_KEY -
When the shortcut runs, ZestSSH opens and asks Run this from a link?. It runs the command only after you tap Run, then checks the API key.
The same works for zestssh://snippet, zestssh://batch and zestssh://workflow links. See the Automation engine page for every parameter. A link always waits for Run, so a shortcut set off by a time or a place stops at that question until you answer it. The key is kept in your shortcut, so do not share a shortcut that holds it.
From 4.0 (iOS 16 and later), Siri knows ZestSSH’s actions by phrases of their own, with no shortcut to make first:
- “Connect to server with ZestSSH”, “SSH connect with ZestSSH” or “Open SSH connection with ZestSSH”
- “Run SSH command with ZestSSH”, “Execute command on server with ZestSSH” or “Run command with ZestSSH”
- “Run SSH snippet with ZestSSH” or “Execute snippet with ZestSSH”
Siri then asks for what the action needs, such as the host. The phrases are in the app’s twelve languages.
Siri also runs any shortcut when you say its name: name a shortcut “Web server” and say “Hey Siri, Web server”. ZestSSH then asks what it asks for the link, and goes on when you tap.
Setting up a shortcut
Section titled “Setting up a shortcut”- Open the Shortcuts app on your iPhone or iPad.
- Create a new shortcut and give it a name you can say.
- Add the Open URLs action.
- Type the link, for example
zestssh://connect?name=web-01. - Run the shortcut, then tap Connect (or Run) in ZestSSH.
See iOS Shortcuts examples for more.
Limitations
Section titled “Limitations”- The app opens: every link opens ZestSSH to do its work.
- No output back: ZestSSH does not hand a command’s output back to the shortcut. The run’s result is in More > Automation > Automation history, or a workflow’s Notify step shows it.
- Every run asks first: a link waits for Run, and a connect link for Connect.
- Link limits: a link of more than 2,048 characters, or with a value of more than 256, is refused. Keep long commands in a snippet.
- No scheduled tasks on iOS: ZestSSH’s own scheduled tasks run on Android and on computers, not on iOS.
Troubleshooting
Section titled “Troubleshooting”- “No host named … is saved in your personal space”: check the name in the link against the host’s name in ZestSSH. Letter case does not matter, but the name must match whole.
- Nothing happens while the app is locked: a link that arrives while ZestSSH is locked waits until you unlock it.
- “Automation is off, so the command was not run.”: turn on External automation in More > Automation.