SpringCuts

AnthoPak

Compatibility: This package is compatible with iOS 14.0 to 14.8.

This package has been downloaded 1280 times.

Run Shortcuts from SpringBoard (Support library and 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:

Usage: springcuts [arguments...]

  • -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

Examples:

  • 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:

  • Choose any trigger of your choice
  • Click "Build Actions" on the upper right corner
  • Select "Run Command" and choose a title
  • Add a command like springcuts "Turn off the lights"

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!

  • Create any new Automation in the Home app
  • When it asks you to select devices, scroll to the bottom and click "Convert to Shortcut"
  • Delete default action and create a new SSH one
  • Add the local IP address of your iPhone
  • Add 22 as the port (warning: SSHing yourself isn't possible on default 22 port, so you'll need either to try this automation on the real life (not using the Play button), or change for a custom port (check r/jailbreak for this).)
  • Add root as the user
  • Add your SSH password (default is alpine but if it's not done yet you should change it to something else)
  • Add a command like 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 :)

Feel free to make a small donation or check out my paid tweaks if you want to support my work!


Downloads

This version
475


Total
1280


Information

Developer
AnthoPak


Version
1.1


Compatibility
iOS 14.0 to 14.8


Section
Tweaks


1.1

  • Add support for input parameter by using -p [INPUT_PARAMETER] option
  • Add -w option 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.
  • Allow multiple shortcuts being run at the same time (concurrently)
  • Several fixes and improvements
  • Improve help message with command examples

1.0

  • Initial release