Skip to main content

Text Expansions

Text expansions let you type short triggers like :date to insert longer text snippets or AI prompts. Similar to TextExpander or Espanso, but built into CommandLane.

Quick Start

In the capture window, type a trigger starting with ::

:date       → 2025-12-04
:time → 14:30
:now → 2025-12-04 14:30
:todo → - [ ]
:meeting → Full meeting notes template

As you type, matching expansions appear in an autocomplete dropdown. Press Enter or click to expand.

Default Expansions

CommandLane includes these built-in expansions:

TriggerTypeExpands To
:dateSnippetCurrent date (YYYY-MM-DD)
:timeSnippetCurrent time (HH:MM)
:nowSnippetDate and time combined
:todoSnippetMarkdown checkbox - [ ]
:meetingSnippetMeeting notes template
:summarizePromptAI summarization prompt
:explainPromptAI explanation prompt

Managing Expansions

Using /snippet Command

/snippet list                                    # List all expansions
/snippet add :sig "Best regards, Matt" # Add snippet
/snippet add :ask "{{selected}}" --prompt # Add AI prompt
/snippet remove :sig # Remove expansion
/snippet help # Show help

Direct File Editing

Expansions are stored in ~/.cmdlane/expansions.json:

{
"version": 1,
"expansions": [
{
"trigger": "sig",
"content": "Best regards,\nMatt",
"description": "Email signature",
"type": "snippet"
},
{
"trigger": "standup",
"content": "## Standup - {{date}}\n\n### Yesterday\n- {{cursor}}\n\n### Today\n-\n\n### Blockers\n- None",
"description": "Daily standup template",
"type": "snippet"
}
]
}

Variables

Use variables in your expansions for dynamic content:

VariableDescriptionExample Output
{{date}}Current date (YYYY-MM-DD)2025-12-04
{{date:FORMAT}}Custom date formatSee below
{{time}}Current time (HH:MM)14:30
{{selected}}Currently selected text(user's selection)
{{clipboard}}Clipboard contents(clipboard text)
{{cursor}}Cursor position marker(cursor placed here)

Date Formatting

Use Python's strftime format codes with {{date:FORMAT}}:

{{date:%Y-%m-%d}}      → 2025-12-04
{{date:%B %d, %Y}} → December 04, 2025
{{date:%A}} → Thursday
{{date:%m/%d/%y}} → 12/04/25
{{date:%Y-W%W}} → 2025-W49

Common format codes:

  • %Y - Year (2025)
  • %m - Month (12)
  • %d - Day (04)
  • %B - Month name (December)
  • %A - Weekday name (Thursday)
  • %H - Hour 24h (14)
  • %M - Minute (30)

Expansion Types

Snippets

Static text with optional variables. Use for templates, signatures, and boilerplate:

{
"trigger": "email-reply",
"content": "Hi,\n\nThank you for your message.\n\n{{cursor}}\n\nBest regards,\nMatt",
"description": "Email reply template",
"type": "snippet"
}

Prompts

AI prompt templates that include {{selected}} for context:

{
"trigger": "review",
"content": "Please review the following code for bugs and improvements:\n\n{{selected}}",
"description": "Code review prompt",
"type": "prompt"
}

When you use a prompt expansion:

  1. Select text in any application
  2. Open CommandLane capture window
  3. Type :review
  4. Your selected text is inserted into the prompt
  5. Submit to send to AI

Example Expansions

Meeting Notes Template

{
"trigger": "meeting",
"content": "## Meeting Notes - {{date:%B %d, %Y}}\n\n**Attendees:** {{cursor}}\n\n**Agenda:**\n1. \n\n**Discussion:**\n\n**Action Items:**\n- [ ] \n\n**Next Meeting:**",
"description": "Meeting notes template",
"type": "snippet"
}

Bug Report Template

{
"trigger": "bug",
"content": "## Bug Report - {{date}}\n\n**Summary:** {{cursor}}\n\n**Steps to Reproduce:**\n1. \n\n**Expected Behavior:**\n\n**Actual Behavior:**\n\n**Environment:**\n- OS: Windows 11\n- Version:",
"description": "Bug report template",
"type": "snippet"
}

Code Review Prompt

{
"trigger": "review",
"content": "Please review this code for:\n- Bugs and edge cases\n- Performance issues\n- Security vulnerabilities\n- Code style and readability\n\n```\n{{selected}}\n```",
"description": "Code review prompt",
"type": "prompt"
}

Explain Code Prompt

{
"trigger": "explain",
"content": "Explain what this code does in simple terms:\n\n{{selected}}",
"description": "Explain code prompt",
"type": "prompt"
}

Weekly Review Header

{
"trigger": "week",
"content": "# Week of {{date:%B %d, %Y}}\n\n## Goals\n- {{cursor}}\n\n## Accomplishments\n-\n\n## Challenges\n-\n\n## Next Week\n-",
"description": "Weekly review template",
"type": "snippet"
}

Project Note

{
"trigger": "proj",
"content": "#project:{{cursor}} ",
"description": "Project tag prefix",
"type": "snippet"
}

Tips & Tricks

Cursor Placement

Use {{cursor}} to position the cursor after expansion:

{
"trigger": "todo",
"content": "- [ ] {{cursor}}",
"type": "snippet"
}

After typing :todo, your cursor is placed right after the checkbox.

Multi-line Content

Use \n for line breaks in JSON:

{
"trigger": "sig",
"content": "Best regards,\n\nMatt\nSoftware Engineer\nCommandLane",
"type": "snippet"
}

Chaining with Clipboard

Copy text, then use {{clipboard}} in your expansion:

{
"trigger": "quote",
"content": "> {{clipboard}}\n\n{{cursor}}",
"description": "Quote clipboard as blockquote",
"type": "snippet"
}

Quick Tags

Create expansions for frequently used tags:

{
"trigger": "urgent",
"content": "#priority:high #status:urgent ",
"type": "snippet"
}

Autocomplete Behavior

  1. Type : to see all available expansions
  2. Continue typing to filter (:me shows :meeting)
  3. Use arrow keys to navigate suggestions
  4. Press Enter to expand selected suggestion
  5. Press Escape to dismiss suggestions

Syncing Expansions

The expansions.json file can be:

  • Synced via cloud storage (Dropbox, OneDrive)
  • Version controlled with your dotfiles
  • Shared across machines

Just ensure the file is at ~/.cmdlane/expansions.json on each machine.

Troubleshooting

Expansion Not Working

  1. Check the trigger starts with :
  2. Verify the expansion exists: /snippet list
  3. Check for typos in expansions.json
  4. Restart CommandLane if you edited the file directly

Variables Not Resolving

  • Ensure variable syntax is correct: {{variable}}
  • Check date format codes are valid
  • {{selected}} only works if text was selected before opening capture window

Autocomplete Not Showing

  • Make sure you're in the capture window input field
  • Type : followed by at least one character
  • Check that expansions are loaded: /snippet list