Save a command
- Open Commands and choose New command, or + in the Saved commands of the side panel.
- Give it a Name and write the Command.
- Optional: a Folder to group commands, and Default servers for running it on several servers.
From History, Save as command saves a command you already ran.
Use it in a session
- In the side panel, under Saved commands, a tap writes the command on the line without running it, and the play button runs it. The commands for this server come first.
- On iPhone and iPad, ... on the key bar lists your commands: a tap runs one, the paste button only writes it.
- On a production server, a risky command asks before it runs.
- The menu of a command has Run, Edit, Duplicate, Share with team (Team) and Delete.
Variables
Write a variable between double braces, such as:
sudo systemctl restart {{service}}
When you run the command on several servers, the app asks for the value of each variable first.
Run on several servers
- Choose Run on several servers from Cmd+K, Run in the menu of a command, or Run a command on all under More in the menu of a group. The servers do not need to be connected.
- Choose a saved command, or write one.
- Under It goes to, include or exclude servers and groups.
- Choose whether they run At the same time, and Stop after a time limit if you want one.
- Choose Review, then confirm.
The results show each server with its exit code and output. Filter them by Succeeded or Failed. The same, by hand, with OpenSSH:
for h in web1 web2 web3; do ssh "$h" uptime; doneA command at every connection
To run a saved command each time a server connects, choose it in Show more, At startup, Startup command. For example, a command that attaches to tmux.