Run a Shortcut from the Command Line with `shortcuts run`

Launch any saved Shortcuts automation directly from Terminal on macOS 12+.

macOSshortcutsautomationproductivityLow risk
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

RiskLow risk
RequirementsmacOS Monterey (12) or later; the shortcut must exist in the Shortcuts app.
!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

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions