Skip to content

Automation engine

ZestSSH’s automation engine lets something outside the terminal run work on your saved hosts: a zestssh:// link, another Android app such as Tasker, a scheduled task, or an iOS Shortcut. On a computer, the Automation page also holds your workflows (see Workflows), their Runs, and your API keys. For each request it signs in to the host, runs the command without opening a terminal tab, collects what the command printed and its exit code, and disconnects.

Automation needs Squeezed. It is off until you turn it on, and every request must carry one of your API keys.

Way in Where Asks you first?
A zestssh:// link (execute, snippet, batch, workflow) Android, iPhone and iPad, Windows, macOS and Linux (see how a computer gets links) Yes: “Run this from a link?”
An Android intent (Tasker and similar apps) Android No
A scheduled task Android; Windows, macOS and Linux from 4.0 No. On Android while ZestSSH is open, otherwise you tap a notification to run it; on a computer while ZestSSH is open or in the tray (see Scheduled tasks)

Any web page or app can open a link, so a link never runs before you say so. An Android intent and a scheduled task run with nobody asked, which is why the keys they sign in with must be allowed for it (see Unattended runs below).

On a computer:

  1. Open Automation in the sidebar.
  2. Click the Automations on switch at the right of the page’s top band. Hover over it to see what it governs.
  3. Confirm Enable external automation? with Enable.

Without Squeezed the switch is dimmed. Building, editing and running workflows on the Workflows tab works with the switch off: it governs only what starts from outside (links, other apps, API keys and schedules). While automation is off, the page says “Automation is off. Deep links and webhooks are ignored.” with a Turn on automation button (Upgrade to Squeezed without Squeezed).

On a phone:

  1. Open More > Automation.
  2. Turn on External automation.
  3. Confirm Enable external automation? with Enable.

Without Squeezed the switch shows a Squeezed badge and cannot be turned on. The phone’s API keys, Automation wizard and Scheduled tasks rows appear once automation is on.

When a zestssh://execute, snippet, batch or workflow link opens the app, ZestSSH shows Run this from a link? It names what would run and where, for example “A link asks to run this command on web-01:” followed by the command. For a snippet it shows the command with the link’s values already filled in. It ends with “Run it only if you opened this link yourself.” Nothing runs until you tap Run.

  • Hosts are named as your personal space names them.
  • Characters that would hide or reorder a command are shown as their codes.
  • With recording mode on, ZestSSH first asks you to turn it off, so the question shows the real command. If you keep recording on, nothing runs.
  • A link that arrives while the app is locked waits until you unlock it.

The API key in the link is checked after you tap Run, like every other request.

Runs one shell command on a saved host.

  • Link: zestssh://execute?connection=web-01&command=uptime&key=API_KEY
  • Intent: com.affluentlabs.zestssh.EXECUTE with extras key, connection_id, command
  • Optional: timeout in seconds (default 30, from 1 to 300), grep, head, tail, and on an intent callback

Runs a saved snippet, found by its name in any letter case.

  • Link: zestssh://snippet?connection=web-01&name=Disk%20usage&key=API_KEY
  • Intent: com.affluentlabs.zestssh.SNIPPET with extras key, connection_id, snippet_name
  • Variables: add var_NAME=value to fill the snippet’s {{NAME}} or ${NAME} (also ${NAME:-default} and ${NAME:secret}). Each value is shell-escaped for the place it lands in, inside any quotes the snippet has around it, and the command is filled in one pass. A variable with a default that gets no value takes its default, at every place it stands. A plain ${NAME} with no value is left as it is, for the remote shell.

Runs one command on several hosts.

  • Link: zestssh://batch?connections=web-01,web-02,db-01&command=uptime&key=API_KEY
  • Intent: com.affluentlabs.zestssh.BATCH with extras key, connections (or connection_ids), command
  • Optional: parallel (default true), timeout, grep, head, tail, and on an intent callback

With parallel on, at most 4 hosts run at once. With it off, they run one after another in the order given. A batch takes at most 25 hosts; the rest are left out. The result has a section for each host, headed === host (exit=N) ===.

Runs a saved workflow, found by its ID or by its name in any letter case. A workflow set to Manually (on a computer) or switched off in the workflow list (on a phone) is not started from outside: the run is refused and Automation history says “Not run: this workflow is turned off.”

  • Link: zestssh://workflow?name=Deploy%20staging&key=API_KEY (or id=WORKFLOW_ID)
  • Intent: com.affluentlabs.zestssh.WORKFLOW with extras key, and workflow_name or workflow_id

See Workflows for how workflows are built.

com.affluentlabs.zestssh.CONNECT with extras key and connection_id checks that a host can be reached: it signs in and runs echo "ZestSSH: connected successfully".

com.affluentlabs.zestssh.OPEN with extras key and connection_id opens a lasting session to the host as a normal tab, so its port forwards set to start with the connection come up. It waits up to timeout seconds (default 30) for the session to connect before it answers.

zestssh://connect links open a host, not an automation run, and take no API key:

  • zestssh://connect?name=web-01 (or id=) asks Connect to web-01? and opens a session to that saved host when you tap Connect.
  • zestssh://connect?host=192.168.10.5&user=alex&port=22 opens Quick connect with that address typed in, for you to connect or not.

A run works on the hosts of your personal space, whatever space is on screen. The connection value is matched first against a host’s ID, then against its name in any letter case. There is no partial match: a run either finds exactly one host or fails.

A run signs in to the host the way a session to it would: as your current network has the host, through its jump hosts, and with its key’s certificate.

Every run the engine handles counts as a run with nobody there, a link’s run included once you tap Run. Such a run:

  • Signs in only with keys switched to Allow unattended runs, the keys of the host’s jump hosts and the key a network gives the host included. On a computer, pick the key in Keys, choose Edit, and turn it on under Unattended runs (the key’s details show Unattended runs: Allowed or Off). On a phone, it is in the key’s editor once the key is saved.
  • Trusts only host keys this device already trusts. Connect to a new host yourself once, so its key is saved; a host whose key changed is refused.
  • Answers no question. Where a server asks for a code, or for a password that is not saved, the run stops and says “Nobody is there to answer: a run by itself signs in only with what is saved, with keys allowed for unattended runs.”
  1. Squeezed: without it the request is refused.
  2. Automation on: while it is off the request is refused.
  3. API key: the key must be one of this device’s, not expired, and pass the rate limit (see API keys).
  4. Key scope: a key limited to one host refuses any other host, and refuses every workflow.
  5. Sign-in: the unattended rules above.

When automation does not run what a link or another app asked, ZestSSH says why in a notice, for example “Automation is off, so the command was not run.” The notice has a button: Upgrade where Squeezed is missing, and Keys where a key is not allowed for unattended runs.

Execute and batch requests can trim the output. The filters apply in this order:

  1. grep: keeps lines that match the pattern, as a case-insensitive regular expression. A pattern longer than 256 characters, one shaped to backtrack without end (such as (a+)+), or one that is not a valid expression is matched as plain text instead.
  2. head: keeps the first N lines.
  3. tail: keeps the last N lines.

Example: zestssh://execute?connection=web-01&command=journalctl%20-n%20100&grep=error&tail=10&key=API_KEY runs journalctl -n 100, keeps the lines with “error”, then returns the last 10 of them.

An execute or batch request sent as an Android intent can carry a callback extra with an HTTPS address. When the command ends, ZestSSH sends a POST with a JSON body:

{
"connection": "web-01",
"command": "uptime",
"stdout": "14:23:01 up 42 days...",
"stderr": "",
"exit_code": 0,
"elapsed_ms": 1523,
"timestamp": "2026-01-15T14:23:02Z"
}
  • Only https:// addresses are used.
  • An address that is localhost, or a loopback, private or link-local IP address, is refused, and redirects are not followed.
  • The call does not hold up the run, and a failed call does not change its result.
  • A callback on a zestssh:// link is ignored.

On Android, when an app starts ZestSSH for a result through one of the intent actions above, ZestSSH hands it back two extras: stdout (the output after any filters, or the error) and exit_code. Runs from links and scheduled tasks have no app waiting, so nothing is handed back. Every run is in the automation history either way.

Each run is logged on this device with its time, action, host, command, output, error output, exit code, result and how long it took. The log keeps the newest 500 entries.

  • On a computer: Automation > Runs.
  • On a phone: More > Automation > Automation history, with search, filters by action and by result, and Clear all.

See Automation history.

  • A link longer than 2,048 characters is refused.
  • A link with any value longer than 256 characters is refused, so a longer command belongs in a snippet.
  • A host name with a control character in it is refused.