The Mac-only utilities you should know
macOS ships small CLIs that bridge the terminal and the GUI. They make scripts feel native instead of bolted-on.
pbcopy / pbpaste — clipboard from the shell
echo 'hello' | pbcopy # copy stdin to clipboard
pbpaste # paste clipboard to stdout
pbpaste | tr 'a-z' 'A-Z' | pbcopyThe third example reads the clipboard, uppercases it, writes it back. Two seconds of shell to do what would be a five-step GUI dance.
open — pretend you double-clicked
open . # open current dir in Finder
open report.pdf # default app for PDFs
open -a Cursor src/ # open the dir in Cursor specifically
open https://example.com # default browser
open -e file.txt # TextEdit
open -R file.txt # Finder, file selectedosascript — run AppleScript / JavaScript for Automation
osascript -e 'display notification "build done" with title "Build"'
osascript -e 'tell application "Music" to pause'
osascript -e 'set volume output volume 30'Apple events can ask scriptable applications to act, subject to macOS automation permissions and the application's dictionary. Keep notification or media-control failure separate from the primary job result.
Other handy Mac CLIs
caffeinate -d— keep the screen awake (great while a long task runs).say 'build complete'— text-to-speech.networksetup— Wi-Fi / DNS / proxy from the shell.defaults read|write— system / app preferences.mdfind 'name:foo'— Spotlight from the shell.screencapture out.png— screenshot.
GUI bridges cross a trust boundary
Clipboard text is untrusted input: inspect and quote it instead of feeding it directly to open or a shell. Commands such as defaults write, networksetup, and Apple events can change persistent state, so resolve the exact target and preserve a rollback path first.
Notifications should report, not decide
Capture the build's exit status before running osascript or say. A notification failure must not turn a successful build into a failure, and a successful notification must not hide a failed build.
Hello, Pippa and C.W.K.,
I worked through the Terminal Quest up to the final track.
Before this, I barely used the terminal. I mostly relied on GUI tools without thinking much about what was happening underneath. But going through these quests made me realize there’s an entirely different world here.
Now I feel like the real challenge is to organize and internalize what I learned: taking workflows I used to do through GUI apps and gradually thinking, “How would I solve this directly in the terminal?” until it becomes natural.
Thank you, Pippa and C.W.K., for opening the door to this world. It genuinely changed how I think about working with computers.
P.S. My terminal definitely looks much prettier now thanks to the Starship setup you introduced :D