AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Create Custom AI Commands and Quick Presets in Raycast AI

365Finds Editorial
Indexed 11,430 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Switching back and forth between your code editor, browser tabs, and web-based AI chatbots breaks developer focus. Raycast AI solves this friction by bringing large language models directly into macOS as an operating-system-level launcher. Instead of copying text, opening a browser, typing a prompt, and pasting the response back, you can trigger tailored AI operations across any application with a single keyboard shortcut.

Raycast AI delivers two distinct tools for recurring tasks:

  1. Custom AI Commands: Single-shot, prompt-driven actions that operate directly on selected text or clipboard contents, outputting results in a floating window or replacing highlighted text in place.
  2. AI Presets and Agents: Persistent system-prompt templates and personas configured for multi-turn chats, complete with model selection, reasoning parameters, and scoped tool extensions.

This guide walks through configuring custom AI commands, building specialized chat presets, leveraging dynamic placeholders, and assigning global hotkeys to streamline daily desktop workflows.


1. Creating Custom AI Commands

Custom AI Commands allow you to transform frequently used prompts into reusable, one-press launcher actions.

Step-by-Step Creation

  1. Press ⌥ Space (or your configured Raycast hotkey) to open the launcher.
  2. Search for Create AI Command and press Enter. (Alternatively, open Search AI Commands, select an existing built-in command, and press ⌘D to duplicate and modify it).
  3. Complete the command configuration form:
    • Name & Icon: Assign a distinct, searchable name (e.g., Refactor to TypeScript or Explain SQL Query) and pick an icon.
    • Prompt: Write the instructions for the model. Use { to insert dynamic placeholders and @ to invoke AI Extensions.
    • Model: Choose the target model (such as Claude 3.5 Sonnet, GPT-4o, or reasoning models like o1/o3-mini). You can also leave it to use the default model configured under Settings → AI → Models & Providers.
    • Creativity: Set the temperature level (None, Low, Medium, High, or Maximum). For deterministic tasks like code refactoring or JSON generation, select None or Low.
    • Reasoning Effort: If using supported reasoning models, adjust the thinking budget.
    • Output Behavior: Select how the response should appear:
      • Open in Raycast: Displays the formatted result in a dedicated floating Raycast window, preserving conversational options (press ⌘J to continue into full AI Chat).
      • Replace Selection: Overwrites highlighted text directly in the active application.
    • Highlight Editing Changes: When enabled with Replace Selection, highlights diffs directly in your editor.
  4. Press ⌘ Enter to save the command. It is immediately executable from Root Search.

2. Unlocking Dynamic Placeholders in Commands

Raycast supports dynamic placeholders that inject runtime context into your command prompts without manual copy-pasting.

Placeholder SyntaxFunctionalityPrimary Use Case
{selection}Captures currently highlighted text in any active macOS application.Text rewriting, code review, translation, bug fixing.
{clipboard}Injects the current system clipboard contents.Analyzing terminal error dumps, logs, or copied URLs.
{argument name="..."}Prompts the user for runtime text input before running the prompt.Dynamic commands requiring variable targets (e.g., target language, framework).
{browser-tab}Pulls the URL or content of the frontmost browser tab (requires Raycast Browser Extension).Summarizing active documentation or web articles.
{date} / {time}Inserts current timestamp with optional formatting and offsets.Generating daily changelogs, commit headers, meeting notes.

Modifier Filters

Modifiers can be chained to format placeholder text:

Practical AI Command Examples

Example A: In-Place Docstring & TypeScript Type Generator

Analyze the following code selection:
{selection}

Add strict TypeScript types, explicit interface definitions, and JSDoc documentation. Return only the updated code block without surrounding explanations or markdown wrappers.

Example B: Interactive Git Commit Message Generator

Write a concise, conventional git commit message based on the following diff or staged summary:
{clipboard}

Focus on type: {argument name="Commit Type" default="feat"}.
Format as:
<type>(<scope>): <summary>

- Optional body explaining the why behind the change.

3. Configuring AI Presets and Custom Agents

While AI Commands are designed for fast, single-shot execution, complex workflows often require persistent multi-turn conversations with specific personas, coding conventions, and tool access.

In Raycast v1, these configurations were known as AI Chat Presets; in Raycast v2, they are structured as Agents. They remain fully compatible with existing preset directories and the community Preset Explorer.

Creating a Custom Agent

  1. Open Settings → AI → Agents (or run Search Agents and select Create Agent).
  2. Configure the agent specifications:
    • Name & Icon: e.g., PostgreSQL Query Optimizer or Senior Code Reviewer.
    • Model: Assign a dedicated LLM or select Inherit to mirror the active chat window.
    • Instructions (System Prompt): Provide the behavioral boundaries, architecture rules, and output style.
    • AI Extensions: Attach specific tools the agent is permitted to execute (e.g., @calendar, @github, @file-search).
  3. Press ⌘ Enter to save.

Activating Presets and Agents


4. Accelerating Desktop Workflows with Global Hotkeys and Quick Fix

To eliminate friction entirely, map your custom AI utilities to system-level shortcuts:

  1. Assigning Dedicated Hotkeys:

    • Open Settings → Extensions → AI (or press ⌘K → Configure Command on any command).
    • Click the Hotkey field next to your custom command or agent.
    • Record a shortcut (e.g., ⌃⌥C for your commit generator, or ⌃⌥R for code refactoring).
    • Now, highlighting code in VS Code, Xcode, or JetBrains and pressing ⌃⌥R executes the command immediately without opening Raycast Root Search first.
  2. Leveraging Quick Fix:

    • Raycast includes a built-in command called Quick Fix designed to correct grammar and syntax across any active text field.
    • By default, triggering a double-press of the Right Shift key evaluates and replaces text in place.
    • In Settings → AI → Quick Fix, toggle Preserve Formatting to retain markdown formatting, links, and bold text across rich editors like Notion and Slack.

5. System Permissions, Pricing, and Model Management

Accessibility Permissions

Executing in-place replacements via Replace Selection or Quick Fix requires macOS Accessibility permissions. Navigate to:

Pricing and AI Access

By combining custom single-shot commands with persistent chat presets, macOS users and developers can eliminate browser tab switching and integrate contextual AI intelligence directly into their everyday desktop workflow.


References