Skip to content

Snippets

Everything about creating, editing, and using snippets — templates, arguments, dynamic variables, and more.


There are several ways to create a new snippet:

  • From the palette: Press Command+N
  • From the Library: Press Command+N or 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+V to open the New Snippet form with the current clipboard contents pre-filled.
New Snippet from Selection is free for all users. No Plus required \u2014 just the hotkey.
FieldDescription
NameA short, descriptive label (e.g., “Docker Run Container”)
SummaryOptional one-line description — click the AI button to auto-generate one
TemplateThe command or text with {placeholder} arguments
CategoryOrganizational folder (e.g., Git, Docker, API)
TagsComma-separated labels for cross-cutting organization
TypeWhat kind of content: Command, Prompt, Query, Text, or URL

New snippet creation form


Choose a type that matches your content:

TypeBest ForExample
CodeSource code, boilerplate, editor snippetsstruct {name}: Codable { ... }
CommandShell commands, CLI operationsdocker run -d --name {name} {image}
PromptAI prompts, templates for LLMsExplain {concept} in simple terms
QueryDatabase queries, API callsSELECT * FROM {table} WHERE {condition}
TextNotes, messages, boilerplateMeeting notes template
URLFrequently used URLshttps://github.com/{org}/{repo}/pull/{number}

Snippets aren’t just static text — they can have configurable arguments that you fill in each time you paste.

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-alpine

Arguments are auto-detected from {placeholder} tokens when you save the snippet.


Each argument has a type that controls its input field:

Free-form text input. The default for most arguments.

git commit -m "{message}"

Numeric input only — digits are validated.

docker run -p {port}:80 nginx

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

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.

A text area for longer input — prompts, JSON bodies, config blocks.

curl -X POST {url} -H "Content-Type: application/json" -d '{body}'

Masked input field — the value isn’t shown as you type and isn’t saved to history.

curl -H "Authorization: Bearer {token}" {url}

Arguments can have a flag prefix that’s included only when the argument has a value:

  • Flag + value: An arg with flag -p and value 8080 renders as -p 8080
  • Boolean flag enabled: An arg with flag --verbose and boolean type renders as --verbose when 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 auto-fill with live values at paste time. They use double-brace syntax {{variable}} and work alongside regular {arg} placeholders in the same template.

VariableOutputExample
{{date}}Current date2026-03-20
{{time}}Current time14:30
{{datetime}}Date and time2026-03-20 14:30:00
{{date:FORMAT}}Custom date format{{date:MMMM d, yyyy}}
{{clipboard}}Current clipboard contentsWhatever you last copied
{{env:NAME}}Environment variable{{env:HOME}}

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.

Run a shell command at paste time and insert its output:

VariableOutput
{{shell:git branch --show-current}}Current git branch
{{shell:whoami}}Your username
{{shell:date +%Y-%m-%d}}Today’s date via shell
Shell command variables ({{shell:...}}) require CommandIt Plus.
# {{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.

If your snippet needs literal {{ characters (for Handlebars, Mustache, or Jinja templates), escape them with a backslash: \{{ produces {{ in the output.

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.


When you paste a snippet that has arguments, a fill form appears:

Argument fill form for a snippet with multiple args

  1. Each argument shows the appropriate input control (text field, number field, dropdown, checkbox, or text area)
  2. Default values are pre-populated when set
  3. Required arguments are validated before submission
  4. Fields auto-focus on the first argument
  5. Press Enter on the last field (or click Paste) to submit
  6. Press Escape to 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

Dynamic variable indicators in the arg fill form


The fastest way to turn any text into a reusable snippet.

  1. Highlight a command in any app (terminal, editor, documentation) — no need to copy it manually
  2. Press Control+Shift+Space (or Command+V in the palette with empty search)
  3. CommandIt auto-copies your selection and detects arguments — CLI flags, environment variables, ports, file paths, and more
  4. Review the detected arguments
  5. A name and category are suggested automatically
  6. Save the snippet

New Snippet form with auto-detected arguments

Free for all users. The ⌃⇧Space hotkey and selection capture are available on the Free tier. Plus adds AI-powered suggestions (name, tags, improved commands) inside the same form.
AI-powered detection
Click Detect Args to run AI analysis alongside the built-in pattern detection.

Star your most-used snippets for quick access:

  • Press Command+F in 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

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)”.


Export your snippet library as JSON from the Library toolbar. The export includes all snippet data and arguments.

Import snippets from a JSON file. CommandIt validates the file format and handles older export formats automatically.

Safety checks
Imported snippets with {{env:...}} or {{shell:...}} variables trigger a confirmation dialog showing exactly which variables and commands are referenced.