1. home
  2. automation
  3. raycast-script-commands-five-we-run-every-day

Raycast script commands: five we run every day

Maya Okafor Automation 1 min read 8 comments 241 views

A Raycast script command is just a script with a few metadata comments at the top. If you can write a shell one-liner, you can write one.

Our five

Toggle dark mode, copy the current Git branch, restart the Colima VM, open the Brewfile in Neovim, and flush the DNS cache.

Arguments

Add an argument metadata line and Raycast shows an input field. Our "new branch" command takes a ticket number and does the rest.

Sharing

Keep scripts in your dotfiles repository and point Raycast at the folder. A new Mac gets all of them at once.

  • Use silent mode for scripts with no output.
  • Set a refresh time for inline scripts.
  • Keep scripts in version control.
code
#!/bin/bash
# @raycast.schemaVersion 1
# @raycast.title Toggle Dark Mode
# @raycast.mode silent
osascript -e 'tell application "System Events" to tell appearance preferences to set dark mode to not dark mode'

Real artists ship.

Steve Jobs (1983), as recounted by Andy Hertzfeld in Revolution in the Valley

Scripts run with a minimal PATH. Use absolute paths such as /opt/homebrew/bin/colima.

$ cat /comments 8

C
Chidi Eze Oct 28, 2025 · 8:58 AM

This is exactly the write-up I needed this week. Bookmarked.

E
Elif Kaya Nov 1, 2025 · 10:48 AM

Tried this on an M1 Air and got the same numbers within a few percent.

G
Grace Kim Jan 2, 2026 · 7:50 PM

Any chance you could share the full config in a gist? The snippet is great but I want to see the rest.

M
Maya Okafor author Apr 15, 2026 · 10:34 PM

Glad it helped. Let me know if anything breaks after the next update.

K
Kenji Mori Jun 8, 2026 · 10:25 AM

I have been doing this the hard way for years. Thank you.

J
Jonas Becker Jun 18, 2026 · 10:52 PM

Worth mentioning that this behaves differently on Intel Macs. Took me an hour to figure that out.

K
Kenji Mori Jul 29, 2026 · 6:19 AM

Great post. One small correction: the flag is case-sensitive on older versions.

J
Jonas Becker Aug 20, 2026 · 9:44 PM

Same here, it made a big difference.

$ echo "leave a comment"