Snippets
Save, organize, and run reusable terminal commands with global and host-only scopes.
Snippets let you save commands that you use repeatedly, then run them from the active terminal without retyping them. They are useful for health checks, log searches, deployment steps, and other short operational workflows.
Create a snippet
Section titled “Create a snippet”- Open the Snippets view from the workspace or the command palette.
- Select New Snippet.
- Enter a name and the command to run. A category is optional. Empty categories are shown as
General. - Choose a scope, then select Save.
The command is stored as text. Zync does not rewrite placeholders or add shell quoting, so test a command in the intended shell before sharing it with a team.
Choose a scope
Section titled “Choose a scope”The scope controls which terminals can see a snippet:
| Scope | Available in |
|---|---|
| Global (All Hosts) | Every SSH connection and the local terminal |
| This Host Only | The selected SSH connection |
| Local Terminal Only | The local terminal |
Host scope is tied to the connection identity, not just the visible hostname. If you recreate a host as a new connection, its host-only snippets do not automatically move to the new connection.
Find and run a snippet
Section titled “Find and run a snippet”Use the session tools button in the terminal tab, or press Ctrl+Shift+S, to open the snippet picker. The current shortcut catalog also recognizes Ctrl+Shift+\`` and Ctrl+Shift+~` as session-tools aliases. Search matches the snippet name and command, and categories keep a long list readable. The picker and sidebar filter automatically to global snippets plus snippets scoped to the active connection.
Select a snippet to send its command to the active terminal. Zync appends Enter, so the command starts immediately. Focus returns to the terminal after a quick run.
The Snippets feature view is also useful when you want to browse categories, edit entries, copy a command, or delete an entry. A global snippets view shows global entries only. A connection view shows global entries and entries for that connection.
Edit, copy, or delete
Section titled “Edit, copy, or delete”Open a snippet in the manager to change its name, category, command, or scope. Use the copy action when you need to inspect or adapt a command without running it. Delete is permanent from the local library, so keep a copy of important commands in your normal source-control or runbook workflow.
AI-generated commands
Section titled “AI-generated commands”When the AI Command Bar returns a useful command, save it as a snippet. Review the command and choose a scope before running it. A generated command is not automatically safe for every host, and host-only scope is usually the better default for environment-specific work.
Storage and sync
Section titled “Storage and sync”Zync loads snippets at application startup and stores the library in the local data directory. The local file is snippets.json; it is separate from connection credentials.
If you use Sync, snippets are synchronized as their own domain. Each record keeps its stable logical id, command, name, category, tags, connection scope, and update timestamp. Restore updates an existing record when its logical id matches, and adds records that are not present locally.
Troubleshooting
Section titled “Troubleshooting”- A snippet is missing: Check its scope and the active connection. The global manager intentionally hides host-only entries.
- A command ran on the wrong host: The active terminal was different from the intended target. Switch tabs and run it again.
- The picker has no matches: Clear the search field and check the category and scope.
- A save did not stick: Zync rolls back the optimistic UI update when the local write fails. Retry after checking that the app data directory is writable.
Related docs
Section titled “Related docs”- Split panes for keeping Snippets beside a shell.