Snippets
Everything about creating, editing, and using snippets — templates, arguments, dynamic variables, and more.
Creating Snippets
Section titled “Creating Snippets”There are several ways to create a new snippet:
- From the palette: Press
Command+N - From the Library: Press
Command+Nor click the + button in the toolbar - From a selection: Highlight text in any app, then press
Control+Shift+Space. CommandIt copies the selection, opens the New Snippet form with the template pre-filled, and auto-detects arguments like ports, paths, and URLs. - From the clipboard: In the palette with an empty search, press
Command+Vto open the New Snippet form with the current clipboard contents pre-filled.
Snippet Fields
Section titled “Snippet Fields”| Field | Description |
|---|---|
| Name | A short, descriptive label (e.g., “Docker Run Container”) |
| Summary | Optional one-line description — click the AI button to auto-generate one |
| Template | The command or text with {placeholder} arguments |
| Category | Organizational folder (e.g., Git, Docker, API) |
| Tags | Comma-separated labels for cross-cutting organization |
| Type | What kind of content: Command, Prompt, Query, Text, or URL |

Snippet Types
Section titled “Snippet Types”Choose a type that matches your content:
| Type | Best For | Example |
|---|---|---|
| Code | Source code, boilerplate, editor snippets | struct {name}: Codable { ... } |
| Command | Shell commands, CLI operations | docker run -d --name {name} {image} |
| Prompt | AI prompts, templates for LLMs | Explain {concept} in simple terms |
| Query | Database queries, API calls | SELECT * FROM {table} WHERE {condition} |
| Text | Notes, messages, boilerplate | Meeting notes template |
| URL | Frequently used URLs | https://github.com/{org}/{repo}/pull/{number} |
Template Engine
Section titled “Template Engine”Snippets aren’t just static text — they can have configurable arguments that you fill in each time you paste.
Placeholder Syntax
Section titled “Placeholder Syntax”Wrap argument names in curly braces: {arg_name}
docker run -d --name {name} -p {host_port}:{container_port} {image}When you paste this snippet, CommandIt shows a form where you fill in name, host_port, container_port, and image. The rendered command might look like:
docker run -d --name my-api -p 8080:3000 node:20-alpineArguments are auto-detected from {placeholder} tokens when you save the snippet.
Argument Types
Section titled “Argument Types”Each argument has a type that controls its input field:
Free-form text input. The default for most arguments.
git commit -m "{message}"number
Section titled “number”Numeric input only — digits are validated.
docker run -p {port}:80 nginxselect
Section titled “select”Dropdown with predefined options. Great for values with a known set of choices.
kubectl get {resource} -n {namespace}Set the options for resource to: pods, services, deployments, configmaps
boolean
Section titled “boolean”A checkbox that controls whether a flag is included or omitted.
git push {force} origin {branch}Set force as a boolean with flag --force. When enabled, the output includes --force; when disabled, it’s omitted entirely.
multiline
Section titled “multiline”A text area for longer input — prompts, JSON bodies, config blocks.
curl -X POST {url} -H "Content-Type: application/json" -d '{body}'secret
Section titled “secret”Masked input field — the value isn’t shown as you type and isn’t saved to history.
curl -H "Authorization: Bearer {token}" {url}CLI Flags on Arguments
Section titled “CLI Flags on Arguments”Arguments can have a flag prefix that’s included only when the argument has a value:
- Flag + value: An arg with flag
-pand value8080renders as-p 8080 - Boolean flag enabled: An arg with flag
--verboseand boolean type renders as--verbosewhen checked - Boolean flag disabled or empty arg: The flag and value are both omitted — no leftover spaces or dangling flags
This keeps your rendered commands clean. Empty optional arguments disappear completely instead of leaving blank holes in the output.
Dynamic Variables
Section titled “Dynamic Variables”Dynamic variables auto-fill with live values at paste time. They use double-brace syntax {{variable}} and work alongside regular {arg} placeholders in the same template.
Built-In Variables
Section titled “Built-In Variables”| Variable | Output | Example |
|---|---|---|
{{date}} | Current date | 2026-03-20 |
{{time}} | Current time | 14:30 |
{{datetime}} | Date and time | 2026-03-20 14:30:00 |
{{date:FORMAT}} | Custom date format | {{date:MMMM d, yyyy}} |
{{clipboard}} | Current clipboard contents | Whatever you last copied |
{{env:NAME}} | Environment variable | {{env:HOME}} |
Environment Variable Approval
Section titled “Environment Variable Approval”The first time a snippet reads an environment variable, CommandIt asks for your permission:
- Allow — the variable resolves to its current value, and CommandIt remembers your choice
- Deny — the variable resolves to empty, and CommandIt remembers your choice
- Not Now — the variable resolves to empty this time, but CommandIt asks again next paste
Variables that look sensitive (API keys, tokens, passwords, AWS credentials) show a warning-style dialog. You can review and change all decisions in Settings > Security.
Shell Command Variables
Section titled “Shell Command Variables”Run a shell command at paste time and insert its output:
| Variable | Output |
|---|---|
{{shell:git branch --show-current}} | Current git branch |
{{shell:whoami}} | Your username |
{{shell:date +%Y-%m-%d}} | Today’s date via shell |
{{shell:...}}) require CommandIt Plus.
Example Template
Section titled “Example Template”# {{date}} Standup Notes
Branch: {{shell:git branch --show-current}}Last commit: {{shell:git log --oneline -1}}
## What I did yesterday{yesterday}
## What I'm doing today{today}
## Blockers{blockers}When you paste, {{date}} and the {{shell:...}} variables fill automatically. You only type yesterday, today, and blockers.
Escaping Double Braces
Section titled “Escaping Double Braces”If your snippet needs literal {{ characters (for Handlebars, Mustache, or Jinja templates), escape them with a backslash: \{{ produces {{ in the output.
Import Safety
Section titled “Import Safety”When you import snippets that contain {{env:...}} or {{shell:...}} variables, CommandIt shows a confirmation dialog listing every referenced variable and command. This prevents imported snippets from silently accessing your environment or running commands.
Argument Fill UI
Section titled “Argument Fill UI”When you paste a snippet that has arguments, a fill form appears:

- Each argument shows the appropriate input control (text field, number field, dropdown, checkbox, or text area)
- Default values are pre-populated when set
- Required arguments are validated before submission
- Fields auto-focus on the first argument
- Press
Enteron the last field (or click Paste) to submit - Press
Escapeto cancel and return to search
When a template contains dynamic variables, the form splits into two sections:
- Your inputs — editable argument fields
- Auto-filled at paste — read-only pills showing what
{{date}},{{clipboard}}, etc. will resolve to

New Snippet from Selection
Section titled “New Snippet from Selection”The fastest way to turn any text into a reusable snippet.
- Highlight a command in any app (terminal, editor, documentation) — no need to copy it manually
- Press
Control+Shift+Space(orCommand+Vin the palette with empty search) - CommandIt auto-copies your selection and detects arguments — CLI flags, environment variables, ports, file paths, and more
- Review the detected arguments
- A name and category are suggested automatically
- Save the snippet

Click Detect Args to run AI analysis alongside the built-in pattern detection.
Favorites
Section titled “Favorites”Star your most-used snippets for quick access:
- Press
Command+Fin the palette to toggle favorite on the selected snippet - Use the Favorites filter to see only starred snippets
- Favorites are also accessible from the Library sidebar
Duplicating Snippets
Section titled “Duplicating Snippets”Press Command+D to clone a snippet. The copy gets an auto-numbered name: “Docker Run” becomes “Docker Run (copy)”, and duplicating again creates “Docker Run (copy 2)”.
Import and Export
Section titled “Import and Export”Export
Section titled “Export”Export your snippet library as JSON from the Library toolbar. The export includes all snippet data and arguments.
Import
Section titled “Import”Import snippets from a JSON file. CommandIt validates the file format and handles older export formats automatically.
Imported snippets with
{{env:...}} or {{shell:...}} variables trigger a confirmation dialog showing exactly which variables and commands are referenced.