-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraycast.gist
More file actions
102 lines (75 loc) · 12.3 KB
/
Copy pathraycast.gist
File metadata and controls
102 lines (75 loc) · 12.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# AI Chat in Launcher — Raycast
> A programmable launcher for macOS that replaces your clipboard manager, window manager, snippet expander, and AI chat with a single keyboard-driven interface. For developers and power users who live in their keyboard.
Generated by gist • March 2026
---
## Product Overview
- What it is: A keyboard-first launcher that is also a development platform — extensions are React components (JSX/TSX), not plugins or scripts. Ships with built-in clipboard history, window management, snippets, and AI chat. Replaces 4-5 standalone utilities.
- Who it's for: Developers, designers, and power users on macOS who prefer keyboard over mouse and want one tool instead of five (Alfred + Paste + Rectangle + TextExpander + ChatGPT)
- AI approach: AI is embedded inside the launcher context — not a separate app, not a sidebar, not a browser tab. AI chat inherits the same invocation model, keyboard shortcuts, and result actions as every other Raycast command.
---
## AI Chat in Launcher
### Intent
- Goal: Let users ask AI questions and get answers without leaving their current workflow context — invoke with a keystroke, get a response, act on it (copy, paste, open URL, run command), and dismiss. The entire interaction should feel like using any other Raycast command, not like switching to a chat app.
- User: Developers and power users who already use Raycast as their launcher. Comfortable with AI but won't tolerate context-switching to a separate window. They think in terms of "invoke, act, dismiss" — not "open app, start conversation, copy result, switch back."
- Core anxiety: "Will this pull me out of what I'm doing?" Secondary anxiety: "Will I lose my place in my current task?"
- Not trying to: Be a full-featured AI workspace. Deep multi-turn research sessions, file uploads, canvas/artifact editing, and persistent project contexts belong in dedicated AI apps like Claude or ChatGPT desktop.
- Not trying to: Replace the terminal. Raycast AI can explain a command or draft a script, but it does not execute code, manage environments, or maintain shell state.
### Interaction Model
**Primary flow:**
1. User is working in any app (VS Code, Figma, browser, terminal). They hit the Raycast hotkey to open the launcher. They type "AI" or use a direct hotkey bound to AI Chat. The launcher transforms into a chat interface — same window, same position, same dismiss behavior.
2. User types a question in natural language. The input field is the same command bar they use for everything else in Raycast. No mode switch, no new UI paradigm. They can also paste context from clipboard or reference selected text.
3. AI streams a response inline. The response renders as markdown with syntax highlighting for code blocks. The response appears in the same results area where file search results or clipboard items would appear.
4. User acts on the response using the same action system as any Raycast result: Cmd+C to copy the full response, Cmd+Shift+C to copy just a code block, Enter to paste directly into the frontmost app, Cmd+K to open the action panel for more options.
5. User dismisses with Escape. They're back in their original app, exactly where they left off. No window management needed. If they invoke Raycast again, the conversation is still there — but it doesn't demand attention.
**Key interactions:**
- Invocation: Same hotkey as the launcher itself, then a command — chosen because adding a separate global hotkey for AI would violate the principle that everything lives inside one invocation model. AI chat is a command, not a mode.
- Response actions: Raycast's universal action panel (Cmd+K) — chosen because users already know this pattern from every other Raycast command. Copy, paste-to-frontmost-app, continue-conversation, and open-in-browser are all action panel items, not custom UI.
- Conversation persistence: Conversations survive dismiss but don't reopen automatically — chosen because the launcher should always start fresh. Returning to a previous conversation is an explicit action (search "AI Chat History"), not a default state.
- Model selector: Dropdown at the top of the chat view, not in settings — chosen because model choice is per-question, not per-session. Users switch between fast (GPT-4o-mini, Haiku) for quick lookups and capable (GPT-4o, Sonnet) for complex questions.
- Quick AI commands: Pre-built actions like "Fix Grammar," "Explain Code," "Make Shorter" that take selected text as input and return a result — chosen to make the most common AI interactions zero-prompt. Select text, invoke command, get result, paste back.
**When things go wrong:**
- AI response is too long for the launcher view: A "Continue in Chat" action opens a dedicated (but still Raycast-native) window for the full response. The launcher isn't forced to accommodate essay-length output.
- AI hallucinates code that won't work: The response renders with syntax highlighting but no "run" button. Raycast deliberately does not execute AI-generated code. The user copies it into their editor where they have linting, type checking, and version control.
- AI is slow (>4 seconds): A streaming indicator shows partial content immediately. If the model is unavailable, the action panel offers "Try with [fallback model]" as the first option — not an error page, an alternative.
- User wants to reference what's on screen: "Use Selected Text" action grabs the current selection from the frontmost app and injects it as context. No screenshot, no paste — the launcher reaches into the active app.
### Design Decisions
**AI as a command, not a mode**
- Chose: AI Chat is a Raycast command invoked the same way as "Search Files" or "Clipboard History" — through the command bar
- Over: Dedicated AI button in the launcher UI, separate AI window, persistent AI sidebar, or a floating AI overlay
- Because: Raycast's core design principle is that everything is a command. Making AI a special mode would teach users that AI is different from other functionality. Keeping it as a command means it inherits all existing muscle memory — invocation, action panel, dismiss behavior. Users don't learn a new interaction model.
**Result actions over chat UX**
- Chose: AI responses use Raycast's universal action system (Cmd+K opens actions: copy, paste to app, continue, share)
- Over: Chat-style interface with copy buttons on each message, thumbs up/down, regenerate button, or edit-and-resubmit
- Because: Chat UX is optimized for conversation. Launcher UX is optimized for action. Users don't come to Raycast to have a discussion — they come to get an answer and do something with it. The action panel puts "paste this into my editor" one keystroke away, which is what developers actually want.
**Conversation persistence without conversation prominence**
- Chose: Conversations are saved and searchable but the AI command always opens to a fresh prompt
- Over: Reopening the last conversation, showing recent conversations as a list, or treating AI Chat like a persistent sidebar
- Because: Launchers are transient by nature. You invoke, act, dismiss. If AI Chat reopened to a previous conversation, it would feel like a sticky app instead of a fast tool. The 80% use case is a new question; the 20% case (continuing a thread) is one search away.
**Selected text as implicit context**
- Chose: When the user has text selected in another app and invokes an AI command, that text automatically becomes the input context
- Over: Requiring the user to paste, upload a file, or describe what they're looking at
- Because: The launcher sits between all apps. It can read the current selection. This turns a 4-step flow (select, copy, switch to AI, paste, ask) into a 2-step flow (select, invoke AI command). Quick AI commands like "Explain This" and "Fix Grammar" exist entirely because of this capability.
**No code execution**
- Chose: AI-generated code is always presented as text to copy, never executed
- Over: Inline code execution, "Run in Terminal" button, or sandboxed script runner
- Because: Executing AI-generated code from a launcher is a security and trust problem Raycast chose not to solve. The user's editor and terminal already have the right context (project files, environment variables, linting). Raycast's job is to get the code there fast, not to run it.
### Patterns Used
- Contextual Invocation: AI chat is triggered within the user's existing workflow context — selected text, current app, clipboard contents all flow into the AI interaction without explicit transfer steps. → https://aiuxdesign.guide/patterns/contextual-invocation
- Progressive Disclosure: Basic AI use (ask a question, get an answer) requires zero configuration. Model selection, conversation history, Quick AI commands, and custom AI commands reveal themselves as the user explores. → https://aiuxdesign.guide/patterns/progressive-disclosure
- Human-in-the-Loop: AI-generated code and text are always presented for the user to review and place — never auto-executed or auto-inserted. The user explicitly chooses to copy or paste. → https://aiuxdesign.guide/patterns/human-in-the-loop
- Graceful Degradation: If the selected model is slow or unavailable, the action panel offers fallback models instead of showing an error state. The user always has a next step. → https://aiuxdesign.guide/patterns/graceful-degradation
### Constraints
- Technical: The launcher window has a fixed width (~680px) and variable height. AI responses must render well in this narrow, vertical format. This ruled out side-by-side comparisons, wide tables, and multi-pane layouts. Long responses overflow into a scrollable area, with a "Continue in Chat" escape hatch for truly long output.
- Platform: macOS only. The "selected text from frontmost app" capability relies on macOS accessibility APIs. This feature cannot be replicated on the web or on other operating systems, which is why Raycast AI is not a cross-platform feature.
- Performance: The launcher must open in under 100ms. AI Chat initialization cannot block the launcher's ready state. The model list, conversation history, and API connection are loaded lazily after the chat view renders.
- Business: Raycast AI is a paid feature (Raycast Pro). Free users can see the AI command but get a paywall on use. This means the AI experience must justify a subscription — it can't feel like a wrapper around a chat API.
### Not This
- This is not Spotlight or Alfred with an AI add-on. Spotlight and Alfred are search-and-launch tools. Raycast is a development platform where extensions (including AI) are full React components with their own UI, state, and actions. The AI is a native citizen, not a bolted-on feature.
- This is not a standalone AI chat app (like ChatGPT desktop or Claude desktop). Those apps are built for deep, multi-turn conversations with file uploads, artifacts, and persistent context. Raycast AI is built for fast, contextual, act-and-dismiss interactions. If your question takes more than 3 exchanges to answer, you probably want a dedicated AI app.
- This is not a terminal AI assistant (like GitHub Copilot CLI or Warp AI). Raycast AI does not have shell context, cannot see your command history, and does not execute commands. It can draft a command for you to copy into your terminal.
- This does not execute AI-generated code. Unlike Cursor's inline edits or Copilot's tab completion, Raycast never writes to your files or runs scripts. It produces text that you move to where it belongs.
- Unlike Alfred workflows (written in bash/Python/AppleScript), Raycast extensions are React components (JSX/TSX) with a full component library, hooks, and state management. AI-powered extensions use the same framework — there is no separate "AI extension" API.
### Open Questions
- Whether AI Chat should learn from the user's past queries and clipboard patterns to offer proactive suggestions ("You usually ask about git commands around this time — want to see your recent git questions?") — or if proactivity violates the launcher's transient nature.
- How to handle multi-file context for coding questions. Currently the user can paste code or use selected text, but there's no way to say "look at my whole project." Integrating with the Extensions API to read project files is technically possible but raises scope and privacy questions.
- Whether Quick AI commands (Fix Grammar, Explain Code, etc.) should be user-customizable with custom system prompts, or if that level of configuration belongs in dedicated AI tools rather than a launcher.