Snippets

Snippets are reusable commands you can save once and run instantly in your terminal sessions. They support global and host-specific scope, quick search, and one-click execution.

What snippets are for

Use snippets for repetitive commands such as log tailing, deployment checks, service restarts, and diagnostics. Instead of retyping long commands every time, keep them in a searchable library and run them from inside Zync.

  • Faster workflows — Keep frequent commands ready to run.
  • Fewer mistakes — Reuse verified commands rather than typing from memory.
  • Scoped behavior — Keep host-specific commands separated from global commands.

Scopes: Global vs host-only

Every snippet has a scope:

  • Global — Available in all connection tabs and local terminal tabs.
  • Host only — Available only when the active tab matches that snippet's host/connection.

While creating or editing a snippet, choose scope in the snippet form. If your active tab is local, host-only appears as Local Terminal Only.

Quick access overlays

Zync provides two fast ways to access snippets directly over the terminal:

ShortcutAction
Ctrl+Shift+SOpen snippet picker (fuzzy search + Enter to run)
Ctrl+Shift+`Toggle snippet sidebar (category list + click to run)

Scope-aware quick access

Both the picker and sidebar automatically show only snippets in scope for the current tab: global snippets plus host-only snippets for the active connection.

Managing snippets

Open the Snippets feature view in a connection tab to manage your library.

  • Create — Add a name, optional category, command, and scope.
  • Edit — Update command text or move between Global and Host only.
  • Delete — Remove snippets you no longer need.
  • Copy — Copy the raw command to clipboard.

Categories are optional and help keep large snippet collections organized.

Running behavior

Running a snippet sends the command directly to the active terminal session and appends an Enter key automatically, so execution starts immediately.

  • If no connection is active in the manager view, Zync warns that there is no active terminal target.
  • After quick-run from picker/sidebar, terminal focus is restored so you can continue typing immediately.

Integration with AI Command Bar

AI-generated commands can be saved into snippets so useful one-off suggestions become reusable building blocks for future sessions. See AI Command Bar for the full workflow.

Persistence

Snippets are stored locally and persist across restarts. Your snippet library is loaded at app startup so quick access is available immediately when you open a terminal.

Troubleshooting

  • Snippet not visible — Check scope. Host-only snippets appear only on their matching connection tab. For all tabs, set scope to Global.
  • Shortcut does nothing — Ensure a connection tab is active, then confirm keybindings in Settings → Shortcuts.
  • Snippet runs in the wrong place — Execution always targets the active terminal in the active tab. Switch to the intended tab first.
  • No snippet matches in picker — Clear search text or check category/scope assumptions for the current connection.