Rewrite selected text from anywhere on macOS with one Raycast command.
RayWrite is a Raycast extension for fast rewriting. Select text in any app, run Rewrite Selection, and RayWrite improves the structure, flow, coherence, and wording while preserving your meaning, tone, and formatting.
The default flow is intentionally simple:
select text -> run Raycast command -> rewritten text is pasted backUse it when a paragraph is technically fine but reads a little clunky, scattered, or too rough around the edges.
- Rewrite selected text without opening a separate editor.
- Paste the improved result over the current selection.
- Copy the improved result instead, if preferred.
- Use Raycast AI by default.
- Optionally use an OpenAI-compatible
/chat/completionsendpoint. - Improve structure, flow, transitions, rhythm, and wording.
- Preserve meaning, tone, line breaks, Markdown, and code fences.
- Avoid adding new facts or turning your writing into generic AI phrasing.
- Fail clearly when selected-text access is blocked by the active app.
- Select text in any macOS app.
- Open Raycast.
- Run
Rewrite Selection. - RayWrite replaces the selected text with the rewritten version.
| Preference | Values | Notes |
|---|---|---|
AI Provider |
Raycast AI, OpenAI Compatible |
Raycast AI is the default. |
Output Mode |
Paste Over Selection, Copy to Clipboard |
Paste is the fastest workflow. |
OpenAI-Compatible Base URL |
URL | Example: https://api.openai.com/v1 or http://127.0.0.1:8000/v1. |
OpenAI-Compatible API Key |
secret | Required only for the OpenAI-compatible provider. |
OpenAI-Compatible Model |
model name | Example: gpt-4.1-mini. |
npm install
npm run build
npm run lint
npm run dev-
Run
npm run dev. -
Open TextEdit, Notes, Mail, or a browser text field.
-
Type a rough paragraph, for example:
this is the idea i want it clearer but dont change what i mean and maybe the order is weird
-
Select the text.
-
Run
Rewrite Selectionin Raycast. -
Confirm the selected text is replaced with rewritten text.
src/
rewrite-selection.tsx
lib/
prompt.ts
rewrite.ts
selected-text.ts
providers/
raycast-ai.ts
openai-compatible.tsRayWrite uses Raycast's selected-text API. Some apps may block or fail selected-text access; when that happens, RayWrite shows a direct error instead of silently using clipboard contents.
Raycast Store metadata validation requires the author field to match a real Raycast Store username. Local development and GitHub usage do not require store validation.
MIT