Some links in this article are affiliate links. We earn a commission at no extra cost to you when you purchase through them. Full disclosure.
Every time you context-switch — from editor to browser to ChatGPT to editor — you lose momentum. What if AI was one keystroke away, no matter what app you’re in? Copy code, hit a shortcut, get an explanation. Select text, trigger a command, get a rewrite. No browser tabs, no waiting for ChatGPT to load.
That’s Raycast with AI commands. It’s become the backbone of my daily workflow, and I’ll show you exactly how to set it up.
What Is Raycast?
Raycast is a macOS launcher (think Spotlight on steroids). It replaces Spotlight, Alfred, and a dozen other tools. The AI features turn it into an always-available AI assistant that works with whatever’s on your screen.
For how it fits into a broader setup, see my AI development workflow.
Getting Started
You need Raycast Pro for unlimited AI commands ($8/month). The free tier gives you limited AI usage, but Pro is where the real productivity gains are:
Pro includes:
- Unlimited AI commands
- GPT-4, Claude, and other models
- Custom AI commands with your own prompts
- AI chat with context from your clipboard
Step 1: Install Raycast
brew install --cask raycast
Or download from raycast.com. On first launch, Raycast asks to replace Spotlight. Say yes — it does everything Spotlight does, plus more.
Set your hotkey (I use ⌥ Space) in Raycast Preferences → General.
Step 2: Enable AI Features
- Open Raycast Preferences (⌘ + ,)
- Go to AI tab
- Sign in with your Raycast account
- Select your preferred model (Claude 3.5 Sonnet is my default)
You now have access to AI Chat (conversational) and AI Commands (quick actions).
Step 3: Set Up Essential AI Commands
Raycast comes with built-in AI commands, but the real power is custom commands. Here are the ones I use daily:
Explain Code
- Open Raycast → search “Create AI Command”
- Name: Explain Code
- Prompt:
Explain this code clearly and concisely. Cover what it does, any non-obvious logic, and potential issues. Keep it brief.
{selection}
- Input: Selection (uses whatever text you have selected)
- Creativity: Low
- Hotkey:
⌃⌥E
Now: select code in any app → hit ⌃⌥E → instant explanation.
Write Tests
- Create AI Command
- Name: Write Tests
- Prompt:
Write comprehensive unit tests for this code. Use the same language and testing framework conventions visible in the code. Include edge cases. Output only the test code.
{selection}
- Input: Selection
- Creativity: Low
- Hotkey:
⌃⌥T
Refactor
- Create AI Command
- Name: Refactor
- Prompt:
Refactor this code for clarity and maintainability. Keep the same functionality. Explain what you changed and why in a brief comment above the code.
{selection}
- Input: Selection
- Creativity: Medium
- Hotkey:
⌃⌥R
Summarize
- Create AI Command
- Name: Summarize
- Prompt:
Summarize this in 3-5 bullet points. Focus on key takeaways and action items.
{clipboard}
- Input: Clipboard
- Creativity: Low
- Hotkey:
⌃⌥S
Fix Grammar
- Create AI Command
- Name: Fix Grammar
- Prompt:
Fix grammar, spelling, and punctuation in this text. Keep the original tone and meaning. Output only the corrected text, no explanations.
{selection}
- Input: Selection
- Output: Replace selection (directly replaces the text)
- Hotkey:
⌃⌥G
Step 4: Configure Clipboard Integration
One of Raycast’s killer features: clipboard history with AI. Enable it:
- Preferences → Extensions → Clipboard History
- Set history size to 100+ items
- Hotkey:
⌘⇧V
Now you can:
- Copy multiple code snippets
- Open clipboard history
- Select one and run an AI command on it
This means you can copy code from your editor, switch to your terminal, and run an explain/refactor command without going back to the editor.
Step 5: Set Up AI Chat
For longer conversations, use Raycast AI Chat:
- Open Raycast → type “AI Chat” (or set a hotkey)
- Start a conversation with context
- Use
@mentions to include clipboard content
I keep AI Chat on ⌥C for quick access. It’s faster than opening a browser tab to ChatGPT and supports the same models.
Pro tip: Create preset conversations for common tasks:
- “Code Review” — paste PRs for review
- “Architecture” — discuss design decisions
- “Debug” — paste error logs for analysis
Step 6: Snippets + AI
Combine Raycast snippets with AI for templated workflows:
- Create a snippet:
;;commit→ expands to a commit message template - Fill in the template
- Select it → run your “Improve Writing” AI command
- Get a polished commit message
Other useful snippet + AI combos:
;;pr→ PR description template → AI polish;;email→ email template → AI tone adjustment;;doc→ documentation template → AI fill-in
Step 7: Window Management + AI (Bonus)
Raycast includes window management. My setup:
- Left half: Editor
- Right half: Terminal
⌥C: AI Chat floating window
This means I never leave my coding environment. AI is always one shortcut away, overlaid on whatever I’m doing.
My Daily Workflow
Here’s how it all comes together in a typical coding session:
- Read unfamiliar code → Select →
⌃⌥E(Explain) → understand in seconds - Write a function → Select →
⌃⌥T(Write Tests) → paste tests into test file - Clean up code → Select →
⌃⌥R(Refactor) → review and apply - Write commit message →
⌥C(AI Chat) → “Write a commit message for these changes: {paste diff}” - Reply to Slack → Select message →
⌃⌥S(Summarize) → draft response
Total time switching contexts: ~2 seconds each time. Compare to: open browser → navigate to ChatGPT → paste → wait → copy → switch back (~15 seconds minimum).
Over a full workday, that’s 30-60 minutes saved.
For more tools that compound these gains, check developer tools I can’t live without and best productivity tools for developers.
Cost: Is Pro Worth $8/Month?
At $8/month, Raycast Pro costs less than one ChatGPT Plus subscription ($20/month) and gives you:
- Unlimited AI commands with fast models
- No browser context switching
- Custom commands tailored to your workflow
- Works system-wide, not just in one app
If you save even 15 minutes/day from fewer context switches, that’s ~7.5 hours/month. At any developer hourly rate, $8 is nothing.
FAQ
Does Raycast work on Windows or Linux?
No, Raycast is macOS only. For Windows/Linux, look at alternatives like Warp (terminal with AI) or set up custom scripts with your OS’s launcher. Nothing quite matches Raycast’s integration though.
Can I use my own API keys instead of Pro?
Raycast Pro uses their own API connections (faster, no setup). You can’t BYO keys for the built-in AI. However, you can create extensions that call your own endpoints if you want full control.
Which AI model should I pick?
For code tasks: Claude 3.5 Sonnet (best at code). For writing/summarizing: GPT-4o (more natural language). You can set different models per AI command, so use the best tool for each job.
Does it work with my IDE?
Raycast works with any app — it operates at the OS level. Select text in VS Code, IntelliJ, Vim (in a terminal), or even a PDF, and AI commands work. It reads your selection regardless of the source app.