Raycast Terminal & Script Commands 2026: Run Code from Your Launcher

Published March 3, 2026 • 12 min read

Most developers live in the terminal. Git commits, Docker containers, deploy scripts, npm commands — it's all muscle memory. But switching between Raycast and a terminal window dozens of times a day adds friction you don't need. Raycast Script Commands let you run shell commands, bash scripts, Python code, and more directly from the Raycast launcher — no terminal window required.

In this guide, I'll cover everything about running terminal commands from Raycast in 2026: how Script Commands work, which languages are supported, practical examples you can steal, and how to integrate Raycast with your existing terminal workflows. If you're new to Raycast, start with our Raycast setup guide first, then come back here.

What Are Raycast Script Commands?

Script Commands are standalone script files that Raycast can execute directly from the command palette. Think of them as custom terminal commands with a UI layer on top. You write a script in your preferred language, add a special metadata header, and Raycast turns it into a searchable, launchable command.

Unlike full Raycast extensions (which use React and TypeScript), Script Commands are simple files — no build step, no dependencies, no project scaffolding. This makes them ideal for quick automations and one-off tasks.

Supported Languages

Raycast Script Commands support any language that can run from a shebang line on macOS:

  • Bash / Zsh — the most common choice for system commands and quick automations
  • Python — great for scripts that need HTTP requests, JSON parsing, or data processing
  • Ruby — popular for text manipulation and scripting
  • Swift — access macOS system APIs natively
  • AppleScript — control macOS apps like Finder, Safari, Mail, and System Settings
  • Node.js — use #!/usr/bin/env node for JavaScript-based scripts

If a language has an interpreter installed on your Mac and supports a shebang line, it works with Raycast. Most developers stick with Bash for system commands and Python for anything more complex.

How to Create Your First Script Command

Step 1: Add a Script Directory

Open Raycast, go to Settings (or hit Cmd + ,), navigate to Extensions, and click the + button. Select "Add Script Directory" and point it to a folder where you'll store your scripts. I recommend ~/.raycast-scripts/ or keeping them in a Git repo for version control.

Step 2: Create a Script File

Create a new file in your script directory. Here's a minimal Bash example that shows your current Git branch:

#!/bin/bash

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Current Git Branch
# @raycast.mode inline
# @raycast.packageName Git

# Optional parameters:
# @raycast.icon 🌿
# @raycast.description Show the current Git branch

cd ~/Projects/my-repo && git branch --show-current

The metadata comments at the top tell Raycast how to display and run the command. The key fields are:

  • @raycast.title — the name shown in the Raycast command palette
  • @raycast.mode — how output is displayed: inline (shows in Raycast), compact (brief notification), fullOutput (scrollable output), or silent (no output)
  • @raycast.packageName — groups related scripts together

Step 3: Make It Executable

Don't forget to make your script executable:

chmod +x ~/.raycast-scripts/current-git-branch.sh

Raycast automatically detects new scripts in your configured directories. Open Raycast and type your script's title — it should appear immediately.

Adding User Input with Arguments

Script Commands can accept arguments that Raycast prompts for before execution. This turns simple scripts into interactive tools:

#!/bin/bash

# @raycast.schemaVersion 1
# @raycast.title Git Commit
# @raycast.mode compact
# @raycast.packageName Git
# @raycast.argument1 { "type": "text", "placeholder": "Commit message" }

cd ~/Projects/my-repo && git add -A && git commit -m "$1"

When you run this command, Raycast shows a text field for the commit message. After you type it and press Enter, the script executes with your input as $1. You can define up to three arguments per script.

Best Script Command Examples for Developers

Here's where Script Commands get genuinely useful. These are practical examples you can adapt to your own workflow.

Git Shortcuts

Stop switching to the terminal for routine Git operations:

  • Quick commit — stage all changes and commit with a message argument
  • Pull latestgit pull --rebase origin main in your current project
  • Create branch — takes a branch name argument, creates and checks out the branch
  • Show statusgit status --short displayed inline in Raycast
  • Stash / pop — one-keypress stash and restore
#!/bin/bash

# @raycast.schemaVersion 1
# @raycast.title Git Pull Rebase
# @raycast.mode compact
# @raycast.packageName Git
# @raycast.icon 🔄

cd ~/Projects/my-repo && git pull --rebase origin main
echo "Pulled and rebased on main"

Docker Commands

Manage containers without leaving your flow:

  • List running containersdocker ps --format "table {{.Names}}\t{{.Status}}" with fullOutput mode
  • Stop all containersdocker stop $(docker ps -q)
  • Rebuild and restartdocker-compose down && docker-compose up -d --build
  • Prune unused imagesdocker system prune -af to reclaim disk space

npm and Package Manager Scripts

Run project scripts from anywhere:

#!/bin/bash

# @raycast.schemaVersion 1
# @raycast.title NPM Dev Server
# @raycast.mode silent
# @raycast.packageName Node.js
# @raycast.icon 📦

cd ~/Projects/my-app && open -a Terminal && osascript -e 'tell app "Terminal" to do script "cd ~/Projects/my-app && npm run dev"'

This one opens a Terminal window and starts the dev server. For scripts that need a persistent terminal session, launching a new window is often the best approach.

System Maintenance

  • Flush DNSsudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
  • Clear Homebrew cachebrew cleanup --prune=all
  • Show disk usagedf -h / | tail -1 for a quick disk space check
  • Kill process by name — takes a process name argument: pkill -f "$1"
  • Empty trashrm -rf ~/.Trash/* with a confirmation step

Deploy Scripts

Trigger deployments without opening a terminal or a browser:

#!/bin/bash

# @raycast.schemaVersion 1
# @raycast.title Deploy to Production
# @raycast.mode compact
# @raycast.packageName Deploy
# @raycast.icon 🚀
# @raycast.description Push main branch and trigger deploy

cd ~/Projects/my-app && git push origin main
echo "Pushed to main. Deploy triggered."

Python Script Example

For anything beyond basic shell commands, Python is a solid choice. Here's a script that fetches your public IP:

#!/usr/bin/env python3

# @raycast.schemaVersion 1
# @raycast.title My Public IP
# @raycast.mode inline
# @raycast.packageName Network
# @raycast.icon 🌐

import urllib.request
ip = urllib.request.urlopen('https://api.ipify.org').read().decode()
print(ip)

The Run Script Extension

Beyond Script Commands, Raycast also has extensions in the Store that bring terminal functionality into the launcher. The Terminal extension lets you search and open terminal profiles directly. Several community extensions provide quick access to shell history, SSH connections, and common CLI tools.

Browse the best Raycast extensions list for more tools that complement terminal workflows. Extensions like the Brew extension let you search, install, and manage Homebrew packages entirely within Raycast — no terminal needed.

Integrating Raycast with VS Code and Your Terminal

Raycast and your terminal don't have to be separate worlds. Here are ways to connect them:

Open Projects in VS Code

Create a Script Command that opens a specific project (or takes a path argument) in VS Code:

#!/bin/bash

# @raycast.schemaVersion 1
# @raycast.title Open in VS Code
# @raycast.mode silent
# @raycast.packageName Dev
# @raycast.argument1 { "type": "text", "placeholder": "Project folder name" }

code ~/Projects/$1

Quicklinks for Terminal Workflows

Raycast Quicklinks can open terminal commands instantly. Create a Quicklink with a terminal:// URL scheme or an iterm:// scheme if you use iTerm2. This is even faster than Script Commands for simple, frequently used commands.

Combining Script Commands with Raycast AI

If you're on Raycast Pro, you can use AI Commands alongside Script Commands for powerful workflows. Ask Raycast AI to generate a bash one-liner, then run it with a Script Command. Or use AI to explain error output from a failed script. It's a natural pairing — AI for thinking, Script Commands for doing.

Not on Pro yet? Try Raycast Pro with 80% off and a free trial to unlock AI features alongside your script workflows.

Script Commands vs. Extensions: When to Use Which

Both Script Commands and full extensions can run code, but they serve different purposes:

  • Use Script Commands when: you need a quick automation, the task is a one-liner or short script, you don't need a rich UI, or you want to use Bash/Python instead of TypeScript
  • Use Extensions when: you need interactive lists, forms, or detail views, the tool requires complex state management, you want to publish to the Raycast Store, or you need real-time updates and loading states

In practice, most developers use both. Script Commands handle the quick-and-dirty terminal tasks. Extensions handle the tools you interact with daily and want a polished experience for. If you're interested in building full extensions, check out the Raycast API developer guide.

Tips for Writing Better Script Commands

Use fullOutput Mode for Long Output

If your script returns more than a line or two, use @raycast.mode fullOutput so the result is scrollable inside Raycast. The inline mode truncates long output.

Handle Errors Gracefully

Add error checking so your scripts don't fail silently. A quick pattern in Bash:

#!/bin/bash
# ... raycast metadata ...

if ! command -v docker &> /dev/null; then
  echo "Error: Docker is not installed"
  exit 1
fi

docker ps --format "table {{.Names}}\t{{.Status}}"

Use Environment Variables

For scripts that need API keys or tokens, store them in environment variables rather than hardcoding them. Raycast inherits your shell environment, so anything in your .zshrc or .bash_profile is accessible.

Version Control Your Scripts

Keep your Script Commands directory as a Git repository. This lets you sync scripts across machines, track changes, and share with teammates. The Raycast community script-commands repo on GitHub has hundreds of examples worth browsing for inspiration.

Combine with Raycast Snippets

For commands you type frequently in the terminal itself, consider using Raycast Snippets instead. Snippets expand text anywhere on your Mac — type a keyword and it replaces with a longer command. Use Script Commands for execution, Snippets for text expansion.

Getting the Most Out of Raycast for Terminal Workflows

Script Commands are just one piece of the puzzle. A complete Raycast terminal workflow might include:

  • Script Commands for running shell scripts and automations
  • Quicklinks for jumping to project directories or opening terminal profiles
  • Snippets for expanding frequently typed commands
  • Clipboard History for grabbing previously copied terminal output
  • AI Commands (Pro) for generating scripts and debugging errors
  • Extensions for Brew, GitHub, Docker, and other developer tools

If you haven't set up Raycast yet, the Raycast Pro discount page has the current best deal. And our guide to what Raycast is covers the fundamentals before you dive into power-user features like Script Commands.

Frequently Asked Questions

What languages can I use for Raycast Script Commands?

Raycast supports Bash, Python, Ruby, Swift, and AppleScript out of the box. Any language with a valid shebang line that runs on macOS will work — including Node.js, PHP, Perl, and others. Bash and Python are by far the most popular choices. Just make sure the interpreter is installed on your system and the script file is executable.

What is the difference between Script Commands and Raycast Extensions?

Script Commands are standalone script files (Bash, Python, etc.) that run directly from Raycast with no build step or dependencies. They're perfect for quick terminal automations. Extensions are full React/TypeScript applications with rich UI components — lists, forms, detail views, action panels. Use Script Commands for simple tasks that produce text output. Use extensions when you need an interactive interface.

Can Raycast Script Commands accept user input?

Yes. You can define up to three arguments in the script's metadata header using the @raycast.argument1, @raycast.argument2, and @raycast.argument3 fields. Each argument specifies a type and placeholder text. When you run the command, Raycast shows input fields for each argument. Values are passed to your script as positional parameters ($1, $2, $3 in Bash) or environment variables.

Do I need Raycast Pro to use Script Commands?

No. Script Commands are available on the free Raycast plan with no limitations. You can create, import, and run unlimited Script Commands without a paid subscription. That said, Raycast Pro adds features like AI Commands and Cloud Sync that pair well with script-based workflows — especially AI for generating and debugging scripts. Get the current Pro deal here.

How do I share Script Commands with my team?

Script Commands are plain files on disk, so sharing is straightforward. The best approach is to keep your scripts in a shared Git repository that team members clone and point Raycast to. The Raycast community also maintains an open-source script-commands repository on GitHub with hundreds of community-contributed scripts. To import a script, place it in any directory configured as a Script Commands folder in Raycast.

Get 80% Off Raycast Pro

Free 14-day trial. No coupon code needed. Discount applies automatically.

Claim Your Discount →

Related Articles