Raycast
Back to Productivity
RaycastBeginner10 min

Raycast Script Commands Tutorial: Automate macOS Workflows with Shell Scripts

What Are Script Commands?

Raycast Script Commands let you run shell scripts from the Raycast launcher. You can fuzzy-search your codebase, convert formats, manage Docker, or trigger any CLI tool — all from a single hotkey.

Unlike full extensions (which need TypeScript and React), script commands are just shell scripts with a special header. If you can write a bash script, you can build a Raycast command.

Raycast Setup & Permissions

Install Raycast from raycast.com (it's free). Script commands need no additional setup — Raycast reads them from a configured directory.

Tip: In Raycast → Extensions → Script Commands, add your script directory. Any executable script with the right header becomes a command.

Writing Your First Shell Script

Each script starts with special header comments that Raycast parses as metadata:

#!/bin/bash
# @raycast.title Clean Git Branches
# @raycast.author Your Name
# @raycast.authorURL https://example.com
# @raycast.description Delete local branches that have been merged to main
# @raycast.icon 🧹
# @raycast.mode fullOutput
git branch --merged main | grep -v "main" | xargs git branch -d
echo "Cleaned merged branches!"

Key header fields:

Real-World Script Recipes

Here are real-world scripts that save time every day:

Pro tip: Use @raycast.argument to accept input from the search bar. Raycast shows an input field when the command runs.

Arguments example:

#!/bin/bash
# @raycast.title DNS Lookup
# @raycast.argument1 {"type":"text","placeholder":"domain.com"}
# @raycast.mode fullOutput
dig +short "

Real-World Script Recipes

" | head -5

Arguments, Output & Dynamic Data

Take script commands further with these advanced techniques:

Script Debugging & Fixes

Script debugging tips:

Publishing to the Store

Script commands are just the beginning. Explore more:

← PreviousObsidian Zettelkasten Setup Guide: Build a Connected Knowledge BaseNext →Neovim Lua Configuration Guide 2026: Setup from Scratch with lazy.nvim