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 insrc/renderer/src/SnippetManager.tsx:
Views
- Search View
- Create/Edit View
40/60 split layout:
- Left: Snippet list with search
- Right: Live preview with placeholder resolution
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):{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:- “Name” field (required)
- “OrderID” field (defaults to “12345”)
Argument Syntax (src/renderer/src/SnippetManager.tsx:35)
Snippet Keywords
Optional trigger phrases for quick expansion:Setting Keywords
- Edit snippet
- Set Keyword field (e.g., “addr”)
- 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):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):Snippet Actions
Available operations:Placeholder Resolution
Processing pipeline (src/main/snippet-store.ts:261):Resolution Order
- Extract arguments - Find all
{argument:...}placeholders - Prompt user - If arguments exist, show input form
- 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
- Replace
- Return final text
Example Resolution
Snippet:- Attendees: “Alice, Bob”
- Clipboard: “Q1 Planning”
- Current date: 2026-03-02
Inline Argument Fields
When a snippet has 3 or fewer arguments, they appear inline in the snippet list (src/renderer/src/SnippetManager.tsx:33):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
Placeholders not resolving
Placeholders not resolving
- 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
Import failed
Import failed
- 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
Snippet not appearing in list
Snippet not appearing in list
- 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
Arguments not prompting
Arguments not prompting
- 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