Snippets and broadcasting commands
Save commands you use often and send them to one terminal or to several connected terminals at once.
Snippets are saved commands you can type into terminals with one click. Like hosts, they’re stored in a vault and sync with it.
Creating a snippet
- Open Snippets from the sidebar (⌘4 on a Mac).
- Click New snippet.
- Choose the Vault to save the snippet in.
- Enter a Label and the Command. You can add Tags to make the snippet easier to find.
- Click Save.
The command is typed into the terminal exactly as saved, followed by Enter. A command with several lines runs line by line.
Use Search snippets to filter by label, command or tag. Each snippet’s ⋯ menu (or right-click) has Run…, Copy command, Edit, Move or copy to vault… and Delete. Editing, moving and deleting are only offered in vaults you can write to.
Running a snippet in the current terminal
In a connected terminal, click the Run snippet button in the toolbar and pick a snippet. It runs in that terminal only. The button is greyed out until the terminal is connected.
Broadcasting to several terminals
- On the Snippets page, click the snippet’s Run button, or choose Run… from its menu.
- Under Send to, tick the terminals that should receive the command. Only connected terminals are listed.
- To send it to every connected terminal, click Select all (broadcast).
- Click Run.
A message confirms how many terminals it was sent to, for example “Sent to 3 terminals”. If you picked a single terminal, Duo22 switches to it.
If no terminals are connected, the dialog says “Open a terminal first; snippets run in connected sessions.”
Tips
- Broadcasting runs the same command on every terminal you’ve ticked. Check your selection before running anything destructive.
- Use tab colours (Settings → Tabs) so production hosts stand out in the tab bar. See Terminal tabs and split panes.
- Snippets in a shared vault sync to the other members of that vault, like everything else in it.
Still stuck? Check the FAQ, or browse thehelp centre.