Snippets
This page explains how to create, organize, and run snippets in Termius, including executing them on multiple hosts, setting startup snippets, and more.
Overview
In Termius, a snippet is a labeled shell script that you can save and run on different hosts without retyping it. Think of them as a cloud-synced library of your most-used or proven scripts/commands.
Snippets are stored in Vaults, synced across devices, and available to your team when you share the vault with a paid subscription. If you have a team, every member can contribute to the snippets library, making teamwork easier.
With snippets, you can:
Run the same command on multiple hosts
Run a startup snippet each time you connect to a host
Paste or run commands from the terminal side panel
Run saved commands from Autocomplete
Organize snippets with snippet packages
Share approved commands with your team
Create a snippet
On the Desktop, you can create a snippet either from the dedicated Snippets screen or from the side panel in the terminal. You can also use the AI to generate a snippet from your description.
From the Snippets screen
Open the
Vaulttab, then open theSnippetsscreen
Click
New Snippet
In the
Action descriptionfield, describe what the snippet does. Enter the command in theScriptfield. Termius saves the snippet automatically
From the terminal side panel
Open the side panel with
Ctrl/Cmd + .
Open the
Snippetstab
Click
New Snippet
In the
Action descriptionfield, describe what the snippet does. Enter the command in theScriptfield
Click
Save
Generate with AI
Open the
New Snippeteditor from the Snippets screen or the terminal
In the
Action descriptionfield, describe what the command should do in plain language
Click the
magic wandbuttonTermius generates the snippet and inserts it into the
Scriptfield
From the Snippets screen
Tap the back arrow button
<to open the Vaults screen, then open theSnippetsscreen
Tap the plus button and choose
New Snippet
In the
Namefield, describe what the snippet doesEnter a command or a script in the
ScriptfieldSavethe snippet
From the terminal
Open the additional keyboard by tapping the
4 squaresbutton. On iPad, open the right-side panel instead
Open the
Snippetstab
Tap
Add new snippetat the bottom of the list
In the
Namefield, describe what the snippet doesEnter a command or a script in the
ScriptfieldSavethe snippet
Run snippets
To run a snippet from the terminal side panel:
Open the side panel with
Ctrl/Cmd + .
Open the
Snippetstab
Hover over the snippet, then click
PASTEorRUN:Paste inserts the snippet into the terminal without running it
Run executes the snippet in the active terminal. You can also double-click the snippet

When Autocomplete is enabled, Termius suggests snippets as you type. It checks both the snippet name and the snippet content.
Enable
Autocompletein Termius Settings or from the terminal side panel
Start typing the snippet name in the terminal
Select the snippet from the Autocomplete suggestions

Termius inserts the snippet body into the terminal and executes it
Execute a snippet on multiple hosts
Snippets can be executed on multiple hosts at the same time. Use this for updates, health checks, and config changes.
You can save a default set of target hosts for a snippet. The next time you run it from the Snippets screen, Termius preselects those hosts.
Running a snippet from the Snippets screen creates new connections to the selected hosts.
To run a snippet in existing sessions instead, use the terminal side panel.
To execute a snippet on multiple hosts from the Snippets screen:
Open the
Vaulttab, then open theSnippetsscreen
Double-click the snippet, or click the
penicon to edit itSelect the target hosts

Click
RunTermius creates a workspace with the selected hosts
The connection flow may ask for input if some host credentials are not saved
After the hosts connect, Termius runs the snippet
To stop execution, close a host tab or close the workspace tab
Click Save targets to store the selected hosts in the snippet. The next time you run it from the Snippets screen, those hosts are preselected.
This feature allows you to run a snippet in all currently active terminals.
To execute a snippet on multiple hosts from the terminal side panel:
Open the side panel with
Ctrl/Cmd + .
Open the
Snippetstab
Right-click the snippet you want to run on multiple hosts
Click
Run in all tabsin the context menu
Set up startup snippets
A startup snippet is a command that runs automatically every time you connect to a host.
Use it to open a directory, activate a virtual environment, run checks, or attach to an existing tmux session.
To enable a startup snippet for a host:
Open the
Host DetailsscreenScroll down to the
Startup Commandfield and choose the snippet
Save the host on mobile. On desktop, Termius saves it automatically
Organize snippets with packages
Snippets can be organized into packages. They work like folders. Create a package for a project, host category, or task type, then move related snippets into it.
Create a snippet package
To create a snippet package on the desktop:
Open the
Vaulttab, then open theSnippetsscreen
Click the chevron next to
New Snippet, then clickNew snippet package
Enter the package name in the
Labelfield. Termius saves the package automatically
To create a snippet package on mobile:
Tap the back arrow button
<to open the Vaults screen, then open theSnippetsscreen
Tap the plus button and choose
New snippet package
Enter the package
Name
Savethe snippet package
Move snippets into packages
To add a snippet to a package:
Open the
Edit Snippetscreen and select the package
Or, on the
Snippetsscreen, select several snippets and drag them into a package
Share snippets within your team
Snippets are stored in vaults and follow the same access model as other vault content. Shared snippets sync automatically and are available to every team member with access to that vault.
To move snippets between vaults:
Open the Vault tab, then open the Snippets screen

Right-click the snippet, then choose an action:
Copy to: will create a copy of the selected snippet in the target vault
Move to: will transfer the snippet to the target vault

Select the target vault, then choose where to store credentials

You can also open the Edit Snippet screen and choose the vault there.

Delete snippets
If you no longer need a snippet, you can delete it from the Snippets screen.
If the snippet is stored in a shared vault, removing it deletes it for everyone with access to that vault.
To delete a snippet:
Open the
Vaulttab, then open theSnippetsscreen
Delete the snippet in one of these ways:
Right-click the snippet, then click
Remove, or
Open the
Edit Snippetscreen, click the three-dots menu, then clickRemove
Pro tips
Meaningful names
Use clear snippet names to make them easier to find with Autocomplete. Start typing and select the right suggestion.
Snippet variables
Termius does not support variables in the snippet editor yet. You can use the export command in a startup snippet to define environment variables for other snippets. You can also set environment variables in the Host Edit screen.
Last updated
Was this helpful?