Get started
This guide walks you through installing Chute, creating your first project, and running a compiled shortcut on your Mac.
Prerequisites
- Node.js version 22 or later
- macOS (required for compiling and running shortcuts)
Install Chute
Install the CLI globally with npm:
npm i -g @chutelang/cliVerify the installation:
chute --versionCreate a project
Use chute init to scaffold a new project:
chute init my-shortcut
cd my-shortcutThis creates three files:
chute.json: project configuration (name, source directory, output directory)src/main.chute: your shortcut's source code.gitignore: ignores thebuild/directory
Open src/main.chute and you'll see the starter template:
shortcut {
name: "Hello World",
description: "A shortcut created with Chute",
}
showAlert(text: "Hello from Chute!");Every Chute file starts with an optional shortcut metadata block that sets the shortcut's name and description. After that comes the body. The body is a sequence of statements that become the shortcut's actions.
showAlert is a built-in action from the standard library. In the Shortcuts app, this is the "Show Alert" action. In Chute, you call it like a function.
Build and run
Compile your shortcut:
chute buildThis produces a signed .shortcut file in the build/ directory. To compile and immediately open it in the Shortcuts app:
chute run src/main.chuteThe Shortcuts app will prompt you to add the shortcut. Tap "Add Shortcut" and run it. You.ll see the "Hello from Chute!" alert.
Add some logic
Let's make the shortcut more interesting. Replace the contents of src/main.chute with:
shortcut {
name: "Greeter",
description: "Asks for your name and greets you",
}
const name = ask(prompt: "What's your name?");
showAlert(text: "Hello, ${name}!");This introduces two concepts:
- Variables —
const name = ...binds the result ofask()to a variable. In Shortcuts, this is equivalent to setting a variable from the output of the "Ask for Input" action. - String interpolation —
"Hello, ${name}!"embeds the value ofnameinto the string. This compiles to the same thing as dragging a magic variable into a text field in Shortcuts.
Build and run it again:
chute run src/main.chuteThe shortcut will ask for your name, then show an alert greeting you.
Use control flow
Chute supports if/else, for loops, repeat, and menu, all of which compile to their Shortcuts equivalents. Here's a shortcut that presents a menu based on what's in your clipboard:
shortcut {
name: "Clipboard Actions",
description: "Do something with your clipboard",
}
const text = getClipboard();
menu "What do you want to do?" {
case "Share" {
share(input: text);
}
case "Make Uppercase" {
const upper = changeCase(text: text, case: "UPPERCASE");
setClipboard(value: upper);
showAlert(text: "Copied uppercase text!");
}
}In the Shortcuts app, menu compiles to a "Choose from Menu" action, but you get to write it with real syntax instead of dragging blocks around.
What's next
Now that you've built and run your first shortcuts, explore the rest of the documentation:
- Core Concepts — how Chute maps to Shortcuts under the hood
- Variables & Bindings —
const,let, destructuring, and type annotations - Functions — define reusable logic that compiles to sub-shortcuts
- Standard Library — every built-in action available in Chute