Compatibility: This package is compatible with iOS 14.0 to 15.7.6.
This package has been downloaded 5105 times.
Run Shortcuts from SpringBoard (Support library, Activator actions, CLI command)
SpringCuts allows you to run iOS Shortcuts (aka Siri Shortcuts) from command line (NewTerm, MobileTerminal…), Activator, or SSH. It also serves as a lightweight support library for tweaks that need to run Shortcuts.
Running Shortcuts using SpringCuts can be useful for plenty of reasons, but in my case the main purpose is to improve Activator and HomeKit capabilities.
The reason of SpringCuts existence is that other solutions require to open Shortcuts app, which really isn't ideal (it takes time, and can't be done if your device is locked). SpringCuts runs Shortcuts in full background, without you even noticing it, and can run Shortcuts even if the device is sleeping.
Starting from SpringCuts 1.1, you can now pass input parameter to your shortcut execution! This might give even more possibilities.
Here are the available commands:
-r [SHORTCUT_NAME]: run shortcut named [SHORTCUT_NAME]
-l: list all shortcut names
-s: stop currently running shortcuts
-p [INPUT_PARAMETER]: when running a shortcut, use this option to pass text input to the shortcut. Don't forget to add quotes if you want to use text with spaces.
-w: when running a shortcut, use this option to wait until the end of shortcut execution before returning. Using this option also logs error message when something goes wrong in shortcut execution.
-h: This help message
springcuts -r "Turn off the lights" -> Execute said shortcut.
springcuts -r "Turn off the lights" -w -> Execute said shortcut and wait until it has finished running. Any error will be logged.
springcuts -r "Send notification with parameter" -p "This is a test notification!" -> Execute said shortcut by passing it a text parameter.
springcuts -l -> List all shortcuts available on this device.
springcuts -s -> Stop execution of currently running shortcuts.
Run Shortcuts from Activator:
springcuts -r "Send notification with parameter" -p "A text parameter"
Run Shortcuts from Home Automation:
For those using HomeKit extensively, you may have noticed that Automations in the Home app provide a very tiny list of Shortcuts actions. But thanksfully, it provides an SSH action! Using this and SpringCuts, you'll be able to run complex Shortcuts from Home Automation!
rootas the user
alpinebut if it's not done yet you should change it to something else)
springcuts "Next track"
If you're interested in Home Automation and also depend on other apps than Home app, you should also check NotiCut tweak on my repo, which uses Push Notifications to run Shortcuts. It can be extremely useful since most Automation apps allows to send Push Notifications, but most often not allow running Shortcuts.
As a developer, you can use SpringCuts to run Shortcuts from SpringBoard or from any process in your tweaks. Documentation will come later, you can contact me if you want some information now :)
No settings to configure. Just install and enjoy.
Check out my Twitter @AnthoPak to get live updates about my tweaks :)
-woption parameter that allows CLI to wait until shortcut execution ends before returning. This also allows CLI to report potential errors that happened during shortcut execution.