Getting Started with Cherri
This guide will walk you through installing Cherri, writing your first Shortcut, and running it on your Apple device.
Table of contents
- Prerequisites
 - Installation
 - Your First Shortcut
 - Adding Variables and Logic
 - Using Standard Library Actions
 - Working with Functions
 - Debugging Tips
 - Signing Options
 - Editor Setup
 - Next Steps
 - Common First-Time Issues
 - Tips for Success
 
Prerequisites
Before you begin, make sure you have:
- A Mac, Linux, or Windows computer for development
 - An Apple device (iPhone, iPad, or Mac) to run the compiled Shortcut
 - Basic familiarity with programming concepts (variables, functions, control flow)
 
While you can compile Shortcuts on any platform, macOS is recommended for the best experience, as it can sign Shortcuts natively without requiring external services.
Installation
macOS (Recommended)
The easiest way to install Cherri on macOS is using Homebrew:
1. Add the Cherri tap:
brew tap electrikmilk/cherri
2. Install Cherri:
brew install electrikmilk/cherri/cherri
3. Verify installation:
cherri --version
Linux / Windows
1. Download the latest release:
Visit the GitHub Releases page and download the appropriate binary for your platform.
2. Make it executable (Linux only):
chmod +x cherri
3. Move to your PATH:
# Linux
sudo mv cherri /usr/local/bin/
# Windows: Move cherri.exe to a directory in your PATH
4. Verify installation:
cherri --version
On non-macOS platforms, Shortcuts will be compiled but not signed. You’ll need to use --hubsign or --signing-server= to sign them. See Signing Options below.
Alternative: Try the Web Playground
If you want to try Cherri without installing anything, visit playground.cherrilang.org to write, compile, and export Shortcuts directly from your browser!
Your First Shortcut
Let’s create a simple “Hello, World!” Shortcut that displays a greeting.
Step 1: Create a Cherri File
Create a new file called hello.cherri:
/* Hello, World! Shortcut
   My first Cherri shortcut
*/
#define glyph smileyFace
#define color yellow
// Display a greeting
const message = "Hello, Cherri!"
alert("{message}", "My First Shortcut")
Let’s break down what this does:
- Comments: 
/* ... */and//let you document your code - Metadata: 
#define glyphand#define colorset the Shortcut’s icon and color - Constant: 
const message = ...creates a constant (magic variable in Shortcuts terminology) - Action: 
alert(...)shows an alert with your message 
Terminology: In Shortcuts, immutable values are called “magic variables.” Cherri uses const for these. Mutable variables use @variable syntax, which creates a “Set Variable” action in Shortcuts. See Variables, Constants & Globals for details.
Step 2: Compile the Shortcut
Open your terminal and navigate to the directory containing hello.cherri, then run:
cherri hello.cherri
If the compilation is successful, you’ll see no output (following Unix conventions). The compiled hello.shortcut file is now ready to transfer to your device!
If there are any errors during compilation or signing, they will be displayed. On macOS, the Shortcut is automatically signed. On other platforms, use cherri hello.cherri --hubsign to sign it using the HubSign service.
Step 3: Transfer to Your Device
There are several ways to transfer the compiled Shortcut to your Apple device:
Option A: AirDrop (macOS only)
- Right-click 
hello.shortcutin Finder - Select Share → AirDrop
 - Choose your iPhone or iPad
 - On your device, tap the notification to open in Shortcuts
 
Option B: iCloud Drive
- Upload 
hello.shortcutto iCloud Drive from your computer - On your device, open the Files app
 - Navigate to iCloud Drive
 - Tap 
hello.shortcutto import it into Shortcuts 
Option C: Email / Messages
- Attach 
hello.shortcutto an email or message - Send it to yourself
 - On your device, open the email/message and tap the attachment
 
Step 4: Run Your Shortcut
- Open the Shortcuts app on your device
 - Find “hello” in your Shortcuts library
 - Tap it to run
 - You should see an alert saying “Hello, Cherri!”
 
🎉 Congratulations! You’ve just created and run your first Cherri Shortcut!
Adding Variables and Logic
Let’s make our Shortcut more interactive by asking for the user’s name.
Create a new file called greeting.cherri:
#define glyph personSpeech
#define color purple
// Ask for the user's name
@name = prompt("What's your name?")
// Create a personalized greeting
if name {
    @greeting = "Hello, {name}! Welcome to Cherri."
} else {
    @greeting = "Hello there! Welcome to Cherri."
}
// Show the greeting
show("{greeting}")
New concepts:
- Variables: 
@namecreates a variable (set variable action in Shortcuts) - Prompt action: 
prompt(...)prompts the user for input - If/else: Conditional logic to check if the user entered a name
 - String interpolation: 
{name}inserts the variable’s value into text - Show action: 
show(...)displays the result as a notification or dialog 
Compile and run:
cherri greeting.cherri
Transfer it to your device and run it. This time, it will ask for your name and greet you personally!
Using Standard Library Actions
Cherri includes a comprehensive standard library of actions. Let’s create a Shortcut that gets device information.
Create device-info.cherri:
#include 'actions/device'
#define glyph phone
#define color lightBlue
// Get device details
const deviceName = getDeviceDetail("Device Name")
const model = getDeviceDetail("Device Model")
const osVersion = getDeviceDetail("System Version")
const battery = getBatteryLevel()
// Format the information
@info = "📱 Device: {deviceName}
Model: {model}
OS: {osVersion}
Battery: {battery}%"
// Display it
show("{info}")
New concepts:
- Includes: 
#include 'actions/device'imports action definitions - Multiple actions: Using several standard library actions
 - Multiline text: Text can span multiple lines
 
See the Standard Library documentation for all available actions.
Working with Functions
Functions let you reuse code and organize complex Shortcuts.
Create calculator.cherri:
#include 'actions/scripting'
#define glyph calculator
#define color green
// Define a function to add two numbers
function add(number a, number b): number {
    const s = a + b
    output("{s}")
}
// Define a function to multiply
function multiply(number a, number b): number {
    const p = a * b
    output("{p}")
}
// Use the functions
const sum = add(5, 3)
const product = multiply(4, 7)
show("5 + 3 = {sum}\n4 × 7 = {product}")
New concepts:
- Function definition: 
function name(type param): returnType { ... } - Output: 
output(...)returns a value from a function - Type annotations: Ensures type safety
 
Functions are actions run within a Run Shortcut action by injecting code at the top of your Shortcut during a pre-processing step.
Debugging Tips
When your Shortcut doesn’t work as expected, try these debugging techniques:
Use Debug Mode
Compile with the --debug or -d flag to see detailed information:
cherri hello.cherri --debug
This will:
- Print stack traces for errors
 - Show verbose compilation information
 - Output a 
.plistfile you can inspect 
Add Show Actions
Insert show(...) actions to display variable values:
@number = 42
show("Debug: number = {number}")  // Check the value
Check Variable Types
If you get type errors, declare variable types explicitly:
@myVar: text  // Declare as text type
// Now adding to the variable will append text
@myVar += "test"
Use Nothing Actions
If you’re experiencing memory issues, add nothing() after actions that produce unused output:
someAction()
nothing()  // Clears the output
Read Compiler Errors Carefully
Cherri provides helpful error messages. For example:
Undefined reference 'name'
----- hello.cherri:5:3
This tells you exactly where the problem is.
Signing Options
macOS (Automatic)
On macOS, Shortcuts are signed automatically using the system’s signing capabilities. No additional configuration needed!
Non-macOS Platforms
On Linux or Windows, you have two options:
Option 1: HubSign (Recommended)
Use the free HubSign service provided by RoutineHub:
cherri hello.cherri --hubsign
Option 2: Custom Signing Server
Run your own signing server using shortcut-signing-server, then use:
cherri hello.cherri --signing-server=http://your-server:port
Editor Setup
VS Code (Recommended)
Install the Cherri VSCode Extension for:
- Syntax highlighting
 - File icons
 - Code snippets (coming soon)
 
Install from VS Code:
- Open VS Code
 - Go to Extensions (Cmd+Shift+X / Ctrl+Shift+X)
 - Search for “Cherri”
 - Click Install
 
macOS App
Download the Cherri macOS app for a native GUI experience with:
- Built-in editor
 - One-click compilation
 - File type integration
 - Project management
 
Next Steps
Now that you’ve created your first Shortcuts, here’s what to explore next:
Learn More Language Features
- Variables, Constants & Globals - Master variable management
 - Control Flow - If statements, loops, and menus
 - Functions - Organize code into reusable functions
 - Types - Understanding Cherri’s type system
 - Includes - Organize large projects across multiple files
 
Explore Standard Actions
- Standard Library Overview - All available action categories
 - Basic Actions - Core actions like alerts, menus, text
 - Network Actions - HTTP requests, downloads, APIs
 - Scripting Actions - Advanced control flow and logic
 
Advanced Topics
- Action Definitions - Define your own actions
 - Copy-Paste Macros - Automate repetitive code
 - Raw Actions - Use any Shortcuts action directly
 - Best Practices - Write efficient, maintainable Shortcuts
 
Migrate Existing Shortcuts
If you have existing Shortcuts you want to convert to Cherri, check out the Migration Guide.
Get Help
- FAQ - Common questions answered
 - GitHub Issues - Report bugs or request features
 - Playground - Experiment with code online
 
Common First-Time Issues
“Command not found: cherri”
The cherri binary is not in your PATH. Make sure you’ve followed the installation steps correctly, or use the full path to the binary.
“Shortcut won’t import on my device”
The Shortcut may not be signed. On non-macOS platforms, use --hubsign when compiling.
“Undefined action error”
You may have forgotten to include the necessary action definitions. Add the appropriate #include at the top of your file. For example:
#include 'actions/network'  // For web requests
“Type mismatch error”
Check that your variable types match what the action expects. You can explicitly declare types:
@myNumber: number
@myText: text
Tips for Success
- Start small - Begin with simple Shortcuts and gradually add complexity
 - Use constants - Prefer 
constover@variablewhen values don’t change (smaller Shortcuts, better performance) - Check the docs - The standard library has actions for most common tasks
 - Experiment in the playground - Try ideas quickly without installing anything
 - Read error messages - They usually tell you exactly what’s wrong
 - Use debug mode - When stuck, compile with 
--debugto see what’s happening 
Happy coding! 🍒
If you run into issues or have questions, don’t hesitate to open an issue on GitHub or check the FAQ.