Run a Shortcut from the Command Line with `shortcuts run`
Launch any saved Shortcuts automation directly from Terminal on macOS 12+.
Run `shortcuts run "Shortcut Name"` in Terminal to execute that shortcut immediately.
01Command
Command
$ shortcuts run "转换 PNG 为 JPG"02What it does
macOS ships a `shortcuts` command-line companion to the Shortcuts app. It executes any shortcut in your library and can receive input via arguments or stdin, which makes shortcuts usable inside shell scripts, launchd jobs, and SSH sessions where the Shortcuts window is impractical.
03Risk
!Warning: The shortcut runs with your full user permissions — never run shortcuts from sources you do not trust. If the name has spaces, quote it exactly as it appears in Shortcuts.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- shortcuts – Run or list shortcuts on macOSEvidence: Documents shortcuts run/list/view, available from macOS 12 Monterey
- Shortcuts User Guide for MacEvidence: Apple documents creating shortcuts that can then be run from the menu bar or command line
Last verified: 2026-09-18 · Category: System & Settings