Skip to main content
SuperCmd’s snippet system lets you create reusable text templates with dynamic placeholders for dates, clipboard content, and custom variables.

Overview

Snippets in SuperCmd provide:
  • Quick text expansion - Type keyword, get full text
  • Dynamic placeholders - Insert current date, time, clipboard, etc.
  • Custom variables - Prompt for user input when expanding
  • Import/Export - Share snippets or backup
  • Search & organize - Pin favorites, search by name/content
Snippets are stored in ~/Library/Application Support/SuperCmd/snippets/snippets.json and sync automatically.

Quick Start

1

Open Snippet Manager

Press SuperCmd hotkey, search for “Snippet Manager” or use Cmd+Shift+S.
2

Create Snippet

Click Create New or press Cmd+N.
3

Set Name & Content

  • Name: Display name (e.g., “Email Signature”)
  • Keyword: Optional trigger (e.g., “sig”)
  • Content: Your text with optional placeholders
4

Use Snippet

In Snippet Manager, select snippet and press Enter to copy, or Cmd+Enter to paste directly.

Snippet Manager UI

Implemented in src/renderer/src/SnippetManager.tsx:

Views

40/60 split layout:
  • Left: Snippet list with search
  • Right: Live preview with placeholder resolution
Actions: Copy, Edit, Delete, Duplicate, Pin

Snippet Organization

Snippets are sorted automatically (src/main/snippet-store.ts:101):

Placeholders

Dynamic content insertion:

Built-in Placeholders

Date/Time Formatting

Supported format tokens (src/main/snippet-store.ts:308):
Examples:
  • {date:YYYY-MM-DD} → “2026-03-02”
  • {date:MM/DD/YYYY} → “03/02/2026”
  • {time:HH:mm} → “14:30”
  • {date:YYYY-MM-DD HH:mm:ss} → “2026-03-02 14:30:45”

Custom Variables (Arguments)

Prompt for user input when expanding:
When expanded, SuperCmd prompts:
  • “Name” field (required)
  • “OrderID” field (defaults to “12345”)
After filling in values, the snippet expands:

Argument Syntax (src/renderer/src/SnippetManager.tsx:35)

Arguments are extracted and sorted for the prompt. The same argument name can appear multiple times in the snippet.

Snippet Keywords

Optional trigger phrases for quick expansion:

Setting Keywords

  1. Edit snippet
  2. Set Keyword field (e.g., “addr”)
  3. Save snippet

Using Keywords

Currently, keywords are used for searching in Snippet Manager. Future versions will support inline expansion (type keyword → snippet expands).

Keyword Rules

Invalid characters are rejected (src/main/snippet-store.ts:27):
Keywords cannot contain quotes (”, ’, `) to prevent parsing issues.

Import & Export

Exporting Snippets

1

Open Snippet Manager

Navigate to the Snippet Manager view.
2

Export Action

Click the menu icon and select Export Snippets.
3

Save File

Choose location and save as snippets.json.

Export Format (src/main/snippet-store.ts:352)

Importing Snippets

1

Import Action

Click menu icon > Import Snippets.
2

Select File

Choose a snippets.json file (SuperCmd or Raycast format).
3

Review Results

Toast shows: “Imported X snippets, skipped Y duplicates”.

Import Deduplication (src/main/snippet-store.ts:439)

Duplicate snippets (by name or keyword) are skipped during import to prevent conflicts.

Raycast Compatibility

SuperCmd can import Raycast snippet exports (src/main/snippet-store.ts:423):
Both formats are supported automatically.

Snippet Actions

Available operations:

Placeholder Resolution

Processing pipeline (src/main/snippet-store.ts:261):

Resolution Order

  1. Extract arguments - Find all {argument:...} placeholders
  2. Prompt user - If arguments exist, show input form
  3. Resolve placeholders:
    • Replace {argument:X} with user input
    • Replace {clipboard} with current clipboard
    • Replace {date} / {time} with current date/time
    • Replace {random:UUID} with generated UUID
  4. Return final text

Example Resolution

Snippet:
With inputs:
  • Attendees: “Alice, Bob”
  • Clipboard: “Q1 Planning”
  • Current date: 2026-03-02
Resolved:

Inline Argument Fields

When a snippet has 3 or fewer arguments, they appear inline in the snippet list (src/renderer/src/SnippetManager.tsx:33):
Keep arguments to 3 or fewer for the best inline expansion experience.

Best Practices

Use Descriptive Names

Name snippets clearly: “Email Signature” not “sig1”

Set Keywords

Add keywords for frequently used snippets

Pin Favorites

Pin your most-used snippets to the top

Test Placeholders

Preview snippets before saving to verify placeholders

Common Use Cases

Email Templates

Code Snippets

Meeting Notes

Bug Report Template

Keyboard Shortcuts

Troubleshooting

  • Check placeholder syntax: {date} not {Date}
  • Verify format string: {date:YYYY-MM-DD} not {date:yyyy-mm-dd}
  • For arguments: use {argument:Name} not {Name}
  • Preview snippet before saving to test
  • Verify JSON format is valid
  • Check file has “snippets” array
  • Ensure no duplicate names/keywords with existing snippets
  • Try exporting a snippet first to see correct format
  • Check search query isn’t filtering it out
  • Verify snippet was saved (check edit view)
  • Look for the snippet in All filter (not type-specific)
  • Restart Snippet Manager
  • Verify syntax: {argument name="Field"}
  • Check no invalid characters in argument name
  • Ensure snippet content includes the placeholder
  • Try removing and re-adding the argument

Performance

Search Performance

Snippet search is fast even with hundreds of snippets (src/main/snippet-store.ts:111):

Storage

  • JSON format: Human-readable, easy to backup
  • File size: ~1KB per snippet
  • 1000 snippets: ~1MB file size
  • Load time: Less than 50ms on app startup

Advanced Features

Nested Placeholders

Placeholders can reference each other:

Multi-line Arguments

Arguments support multi-line input:
When prompted, text area allows line breaks.

Preview with Highlighting

Preview panel highlights resolved placeholders (src/renderer/src/SnippetManager.tsx:64):
Use the preview panel to verify your snippet resolves correctly before copying.