Run Apple Shortcuts From Terminal on Mac
Every automation you've built in the Shortcuts app is one Terminal command away: macOS ships a shortcuts command-line tool that lists and runs them by name. That single fact connects two worlds — anything a Shortcut can do (resize images, toggle settings, ping your phone) becomes callable from shell scripts, SSH sessions, and schedulers.
List what you have, run it by name
# every shortcut on this Mac
shortcuts list
# run one (quote names with spaces)
shortcuts run "Morning Report"
The name must match what you see in the Shortcuts app — shortcuts list is the authoritative spelling. Running a shortcut from Terminal is identical to clicking it: the same actions execute, and if the shortcut shows menus or asks questions, those dialogs appear on screen as usual. That last part matters for automation — a shortcut that waits for input will hang a script until someone answers, so keep scripted shortcuts non-interactive.
Nothing here needs undoing by the tool itself: list is read-only, and run only does whatever the shortcut does. If the shortcut changes something, the undo is whatever reverses that shortcut's own actions.
Pass input in, get output back
Shortcuts have an input slot and an output — the CLI exposes both as files:
# feed a file to a shortcut's input
shortcuts run "Resize to 1200px" -i photo.jpg
# capture the shortcut's output to a file
shortcuts run "Daily Summary" -o ~/Desktop/summary.txt
# both at once
shortcuts run "Compress PDF" -i report.pdf -o report-small.pdf
-i (--input-path) supplies the file the shortcut receives as its input; -o (--output-path) writes whatever the shortcut returns. Inside the shortcut, read the input with the "Shortcut Input" variable and end with an action that outputs something — text, a file, an image. Two smaller subcommands round out the tool: shortcuts view "Name" opens the shortcut in the editor, and shortcuts sign packages a shortcut file for sharing outside iCloud.
Where this gets genuinely powerful
- Scheduling. The Shortcuts app on macOS has no time-based triggers of its own — but a LaunchAgent running
shortcuts run "Nightly Tidy"at 22:00 gives it one. That combination is the standard answer to "how do I run a Shortcut every day on a Mac." - Remote triggering. SSH into your Mac and
shortcuts runworks — kick off a job on the office Mac from anywhere. Shortcuts that display UI need someone at the screen, so keep remote ones headless. - Mixing with shell logic. Wrap the command in ordinary scripting: run a shortcut only when a file exists, loop it over a folder, or chain it after a
curldownload.
The pattern to remember: build the Mac-touching part (notifications, app actions, device handoffs) visually in Shortcuts, and drive when and with what from the shell.
If a shortcut won't run from Terminal
- Run
shortcuts listand copy the name exactly — near-matches fail. - Run it once in the Shortcuts app first: many shortcuts request permissions (files, camera, app control) on first run, and it's better to answer those prompts interactively.
- Check the shortcut ends with an output action if you're using
-oand getting empty files.
If two shortcuts share a name, run grabs one of them and you may not like which. shortcuts list --show-identifiers prints each shortcut's UUID alongside its name, and shortcuts run accepts the UUID in place of the name — unambiguous, and immune to renames, which makes identifiers the better choice inside scripts you intend to keep around.
Some things deserve a Shortcut; most settings just need a switch. Mainspring turns 90+ hidden macOS settings into labelled, reversible toggles — one click, no workflow.
Try Mainspring free →Signed & notarized by Apple · 1-day free trial · $29 once
The scheduling half
Pair this with a LaunchAgent and your shortcuts run themselves — even catching up after sleep. The plist recipe is in our guide to scheduling tasks with launchd.