Snippets & Single-File Actions
Extension AuthoringSnippets & Single-File Actions

Snippets & Single-File Actions

Standalone script files, comment header syntax, and template token placeholders.

Agent Prompt

Copy instruction prompt for Cursor, Claude, Antigravity, or ChatGPT.

You don't always need a full folder package. OpenClip parses single standalone files (.txt, .js, .sh, .applescript) placed directly in ~/.openclip/extensions.

Single-File Header Format

Use # or // comment headers at the top of your file:

markdown-quote.txt
# Title: Blockquote Text
# Icon: symbol(quote.opening)
# Identifier: com.user.blockquote
> {text}

Template Token Placeholders

PlaceholderSourceDescription
{text} or {query}context.selection.textFull selected text (URL-encoded in URLs; raw in snippets).
{matched}context.match.matchedTextMatched regex substring.
{capture1} ... {captureN}context.match.captures[i]Regex capture groups by 1-based index.
{bundleID}context.selection.sourceAppFrontmost macOS application bundle identifier.

Snippet Examples

URL Search Template

github-search.txt
# Title: Search GitHub
# Icon: symbol(globe)
# URL: https://github.com/search?q={query}

Inline Shell Snippet

base64-encode.sh
# Title: Base64 Encode
# Icon: symbol(lock)
# Shell: /bin/zsh
echo -n "$OPENCLIP_TEXT" | base64