Cherri

Cherri (pronounced cherry) is a Shortcuts programming language that compiles directly to a valid runnable Shortcut.
The primary goal is to make it practical to create large Shortcut projects (within the limitations of Shortcuts) and maintain them long term.

🌟 Top Features
- 🎓 Easy to learn and syntax similar to other languages
- ➗ Inline expressions, variables, action and function calls anywhere you can add a value
- 🔢 Type system and type inference
- 🥾 Half-bootstrapped: Most standard actions and types are written in the language
- 💻 Import actions from your Mac
- 🪄 No magic variables syntax, they’re constants instead
- 🪶 Optimized to create as small as possible Shortcuts and reduce memory usage at runtime
- ❓ Define import questions
- 🔀 Convert Shortcuts from an iCloud link or file with the
--import= option
- 🔏 Signs using macOS, falls back on HubSign (requires a RoutineHub API key,
--routinehub-api-key=) or another server that uses scaxyz/shortcut-signing-server
Maintainability
- 🖥️ Laptop/Desktop-based development (CLI, VSCode extension, macOS app)
- 🐞 Natural translation to Shortcut actions as much as possible to make debugging easier
- #️⃣ Include files within others for large Shortcut projects
- 🔄 Define functions to run within their own scope at the top of your Shortcut to reduce duplicate actions
- 📋 Copy-paste actions automatically
- 📇 Built-in action that generates VCards for menus
- 📄 Embed local files in base64
3rd Party support
- 🔧 Define actions with type checking, enums, optionals, default values, identifiers, intents, and parameter keys
- 📦 Package manager: Remote Git repo-based package manager built in, allowing for automatic inclusion and updates
- 🥩 Enter action identifier and parameters manually using Raw Actions.
Resources
Installation
You can install Cherri by downloading the latest release or via the Homebrew or Nix package managers:
Install via Homebrew
If you have Homebrew installed, you can run:
Add Tap:
brew tap electrikmilk/cherri
Install:
brew install electrikmilk/cherri/cherri
Install via Nix
If you have Nix installed, you can run:
nix profile install github:electrikmilk/cherri
Alternatively, you can use nix-direnv to get an isolated, effortless dev environment where cherri is available based on which directory you’re in. Then you would use_flake and add Cherri to flake.nix:
{
inputs.cherri.url = "github:electrikmilk/cherri";
{ # outputs.packages.${system}.default = pkgs.mkShell etc - omitted for brevity
buildInputs = [
inputs.cherri.packages.${system}.cherri
]
}
}
Then run direnv allow in the directory with the flake.nix file.
Usage
cherri file.cherri
Run cherri without any arguments to see all options and usage. For development, use the --debug (or -d) option to print
stack traces, debug information, and output a .plist file.
Why another Shortcuts language?
Because it’s fun :)
Some languages have been abandoned, don’t work well, or no longer work. I don’t want Shortcuts languages to die.
There should be more, not less.
Plus, some stability comes with this project being on macOS and not iOS, and I’m not aware of another Shortcuts language with macOS as its platform other than Buttermilk.
Credits
Reference
Inspiration
The original Workflow app assigned a code name to each release. Cherri is named after the second-to-last
update “Cherries” (also cherry is one of my favorite flavors).
This project started on October 5, 2022.
评论