raycast-extension
Building a Raycast extension
A Raycast extension is TypeScript + React on @raycast/api: each command is a file in src/ that default-exports a React component (List, Form, Detail) or a plain async function. Source lives in integrations/raycast-extension/ as an isolated package that consumes your product's SDK / public REST API like any external consumer. package.json is the manifest — commands, preferences, categories, author, icon all live there, not in code. Read this before the first file; the command-level playbook is scripts/raycast-extension/README.md in the sibling scripts repo. Docs: developers.raycast.com.
When to use
- Triggers: 'build a Raycast extension', 'Raycast command', '@raycast/api', 'ray develop', 'ray build fails', 'publish to the Raycast Store', 'Raycast preferences API key', 'raycast/extensions PR rejected'.
- package.json is the manifest: a command name must equal its src/ filename. author must be a registered Raycast username. API keys go in password preferences. raycast-env.d.ts is generated.
- Submission is a PR into the raycast/extensions monorepo, not npm publish. Siblings: browser-extension, figma-plugin, canva-app, connector-directory-submission.
The trap that wastes a day: package.json IS the manifest
A command exists only if the commands[] entry's name equals its filename: "name": "new-post" requires src/new-post.tsx default-exporting the command. Rename the file without touching package.json and the command silently vanishes from Raycast; add a file without a manifest entry and it never loads. ray build/ray lint catch some mismatches — not all.
Corollaries: