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:
- 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.
- 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
- Press
⌥ Space(or your configured Raycast hotkey) to open the launcher. - Search for Create AI Command and press
Enter. (Alternatively, open Search AI Commands, select an existing built-in command, and press⌘Dto duplicate and modify it). - Complete the command configuration form:
- Name & Icon: Assign a distinct, searchable name (e.g.,
Refactor to TypeScriptorExplain 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, orMaximum). For deterministic tasks like code refactoring or JSON generation, selectNoneorLow. - 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
⌘Jto continue into full AI Chat). - Replace Selection: Overwrites highlighted text directly in the active application.
- Open in Raycast: Displays the formatted result in a dedicated floating Raycast window, preserving conversational options (press
- Highlight Editing Changes: When enabled with Replace Selection, highlights diffs directly in your editor.
- Name & Icon: Assign a distinct, searchable name (e.g.,
- Press
⌘ Enterto 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 Syntax | Functionality | Primary 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:
{clipboard | trim}: Removes leading and trailing whitespace.{selection | lowercase}or{selection | uppercase}: Normalizes casing.{selection | json-stringify}: Escapes quotes and line breaks for programmatic JSON payload generation.{clipboard | raw}: Prevents automatic quote-wrapping.
Practical AI Command Examples
Example A: In-Place Docstring & TypeScript Type Generator
- Output Behavior:
Replace Selection - Creativity:
Low - Prompt:
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
- Output Behavior:
Open in Raycast - Prompt:
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
- Open Settings → AI → Agents (or run
Search Agentsand select Create Agent). - Configure the agent specifications:
- Name & Icon: e.g.,
PostgreSQL Query OptimizerorSenior Code Reviewer. - Model: Assign a dedicated LLM or select
Inheritto 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).
- Name & Icon: e.g.,
- Press
⌘ Enterto save.
Activating Presets and Agents
- Within AI Chat: Type
/in the composer to pull up the quick switcher, or press⌘K → Change Agent. - From Root Search: Search the agent's name directly to launch an isolated conversation initialized with that system prompt.
- Preset Explorer: Import community-tested configurations directly into your Raycast instance via
presets.ray.so.
4. Accelerating Desktop Workflows with Global Hotkeys and Quick Fix
To eliminate friction entirely, map your custom AI utilities to system-level shortcuts:
-
Assigning Dedicated Hotkeys:
- Open Settings → Extensions → AI (or press
⌘K → Configure Commandon any command). - Click the Hotkey field next to your custom command or agent.
- Record a shortcut (e.g.,
⌃⌥Cfor your commit generator, or⌃⌥Rfor code refactoring). - Now, highlighting code in VS Code, Xcode, or JetBrains and pressing
⌃⌥Rexecutes the command immediately without opening Raycast Root Search first.
- Open Settings → Extensions → AI (or press
-
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:
- macOS Settings → Privacy & Security → Accessibility (or Device Control and Data Access on newer macOS versions).
- Grant Raycast permission to read and simulate text inputs in frontmost windows.
Pricing and AI Access
- Raycast Free Tier: Includes core launcher utilities (calculator, snippets, clipboard history, extension store).
- Raycast Pro ($10/month or $96/year): Unlocks Raycast AI with monthly AI Credits, Cloud Sync, custom themes, and AI Commands.
- Pro+ and Max Tiers: Provide larger credit pools for high-volume developers using advanced frontier models.
- Bring Your Own Key (BYOK) & Subscriptions: Subscribers can plug in API keys from OpenAI, Anthropic, Google, and OpenRouter, or link existing ChatGPT/Claude subscriptions directly to bypass credit limits while keeping Raycast's desktop ergonomics.
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.