Git and Pull Requests
Follow these guidelines to ensure smooth collaboration:Make sure your pull request is focused and easy to review. Fill in the pull request template and avoid combining multiple complex Script Commands in a single PR.
Branch and Commit Guidelines
Use descriptive commit messages
Write clear commit messages with proper spelling. Squash any “fix typo” or minor commits on your end before submitting.
Folder Structure
Organize your scripts in a logical directory structure that makes sense for users.Bundle Related Scripts
Try to bundle scripts that are related in a directory or sub-directory. Avoid having generic folders with lots of different commands.Why this matters: To avoid automatically including scripts that people may not be interested in. For example, if you’re using Spotify scripts, there’s a lower chance you’ll need Apple Music scripts.
Image Organization
Images should go into a dedicatedimages folder within your script directory:
Naming Conventions
English Style Convention
Use American English spelling and style for all command metadata.To verify you’re using the correct spelling, refer to Wikipedia’s comparison or use a British to American English Converter.
File Naming Convention
Use lowercased, dash-case format for script files and directories, with proper file extensions:- AppleScript:
.applescript - Swift:
.swift - Bash:
.sh - Python:
.py - Node.js:
.js
- ✅
spotify-next-track.applescript - ✅
github-notifications.sh - ❌
SpotifyNextTrack.applescript - ❌
github_notifications.sh
Metadata Requirements
Title
Raycast’s UI adopts title-cased strings for all command titles as per Apple’s Human Interface Guidelines. Examples:- ✅ “Toggle Hidden Files”
- ✅ “Check GitHub Notifications”
- ❌ “Toggle hidden files”
- ❌ “check github notifications”
Mode Selection
Choose the appropriate mode for your script:silent- For instant commands (e.g., “Toggle Hidden Files”)compact- For long-running tasks like network requestsfullOutput- For commands that print detailed informationinline- For dashboard items (e.g., “Current Weather”)
Package Name
Scripts Requiring Additional Modification
For scripts that need user configuration before use:Add clear instructions
Include comments at the top explaining how to configure the script (e.g., API tokens, usernames, parameters).
Use template naming
Add
.template. to the filename. This prevents Raycast from automatically parsing the script.github-notifications.template.sh
Dependency Management
When to Use Dependencies
Most scripts should be written in Bash or AppleScript. While Swift and Node runtimes are allowed, always check if there’s a strong need since they don’t come pre-installed on macOS.Guidelines for Dependencies
Can you avoid dependencies?
Can you avoid dependencies?
First, ask yourself if you can build the Script Command without any dependencies. Less or no dependencies make it easier for others to adopt your command and make it more portable.
Deep vs. Shallow dependencies
Deep vs. Shallow dependencies
- Deep dependency: Hides complex functionality behind a simple interface (acceptable)
- Shallow dependency: Adds minimal value for the code required (avoid these)
Consider security implications
Consider security implications
Think about transitive dependencies and security aspects. The npm ecosystem, for instance, has been notorious for pulling in dependencies for trivial tasks, sometimes exposing users to security issues.
If You Need a Dependency
If a dependency is truly necessary, follow these guidelines:Document the dependency
Add a comment section at the top of the file explicitly stating the dependency and how to install it:
Scripts Requiring Apps
Some scripts control applications and require them to be installed. Make sure to document this requirement:Include both the app requirement and installation instructions at the top of your script.
Bash Profiles and Environment Variables
Why This Restriction?
This policy ensures:- Easy portability across different systems
- Explicit injection of information
- Best performance
- No unexpected behavior from user-specific profiles
Path Configuration
Raycast automatically appends/usr/local/bin to the $PATH variable. If you need additional paths, you can extend $PATH at the top of your script:
Raycast has support for environment variables. Track progress in this issue.
Auto-Generated Files
The following files are auto-generated by the Toolkit after each commit:commands/README.mdcommands/extensions.json
Examples to Get Started
Here are some great examples from the repository:Apple Music Play
An AppleScript to start playing music.
commands/media/apple-music/apple-music-play.applescriptSentry Unresolved Issues
A Python script that fetches information from an API and parses the JSON response.
commands/developer-utils/sentry/sentry-unresolved-issues.template.pySlack Set Status
A Bash script that sends a JSON payload with cURL.
commands/communication/slack/set-slack-status.template.sh
