A command palette is a hotkey, a search field and a list. Press the keys, type three letters, press Return. Code editors have had one for years. On a Mac the nearest thing is a launcher, which is a list of apps with a few commands of your own squeezed in beside them.
I built that launcher two months ago, and the commands were the awkward part. Each one was an extra row in the app list, so every pick left the chooser by the same wire. The flow then had to work out whether you had picked an app or a command, and which command. That took a Condition, a Template and a shell case statement.
Since v1.62.0, Pick from List has commands of its own, and a Router gives each one its own wire. This post rebuilds the launcher as a Mac command palette with both.
The flow
The top row is the launcher: a Keyboard Shortcut on cmd+shift+space, Installed Apps for the list, Pick from List to show it, and Open File to launch the app you pick. Everything new hangs off the wire labelled Command.
Commands are rows you pin above the list
A command is a name, an icon and a kind. You add them in the Pick from List inspector under Commands, and they appear above the records in the order you list them.
Three things follow from commands being part of the node and not part of the list.
- They are not records. The footer in the picture at the top says 127 results. That is the apps. The four commands are not in
records, so Installed Apps knows nothing about them and no row needs akindcolumn to say what it is. - The first command holds the highlight when the chooser opens. Return on an empty search runs it. ↓ walks down the commands and steps off the last one onto the first app.
- They leave by their own outlet. An app goes out by Selected. A command goes out by Command. The flow never has to ask which one it got.
Search filters commands and rows together
Type git and both groups narrow at once. A command that does not match hides until you clear the search, and the highlight moves to the first one that does. So the whole gesture for GitHub Notifications is the hotkey, git, Return.
The Prompt is Run a command or open an app…. The chooser has no title bar, so the search field's placeholder is the only place to say what the list is for.
Three ways out
| You | Outlet | The payload gains |
|---|---|---|
| Pick an app | Selected | selected, the whole row, and selectedIndex |
| Pick a Wire command | Command | command.name and command.index |
| Press Escape, or click outside | Dismissed | nothing |
Exactly one outlet is taken and the other two are skipped in full. Open the app reads {{selected.path}} and can never run on a command. A command's branch can never run on an app. A command also clears selected and selectedIndex from the payload, so a branch that tests for a picked row gets an honest answer.
One Router where there was a staircase
One outlet carries every Wire command, so something has to split them. The only tool for that used to be a Condition, which answers Yes or No. Three commands took three of them, each hanging off the No of the one before:
It works, and it has ten nodes to this flow's eight. The count is not the problem. The shape is.
- The third command sits behind three Conditions. A fourth would sit behind four.
- Opening an app is what you do nine times in ten, and it runs last, after every test has said No.
- To see what the palette can do, you read the stairs from top to bottom.
A Router reads one field and has one outlet per case. Here Field is {{command.name}} and the cases are the three command names.
Every command is now two hops from the chooser, however many there are. Adding one is a row under Commands, a case in the Router, and a wire. Three details make it hard to get wrong:
- Rename a case and its wire follows. Remove a case and its wire goes with it.
- A case matches the whole text.
Copy Today's Datehas to be spelled the same in both lists. Spaces at either end are ignored. Ignore Case also forgives capitals, and nothing else. - Otherwise catches the rest. Add a command and forget its case, and the run leaves by Otherwise. It is unwired here. Wire a Notification to it if you would like to be told.
What a run looks like
Each node that branches shows the outlet it took, by name. The Router's badge is the case, not a Yes or a No. Execution History says the same in text, with command: {name: Copy Today's Date, index: 2} as the input to the branch.
I ran this flow four times before publishing, once for each way out: a command, an app, Escape, and the Run a flow command below. The date reached the clipboard, Calculator opened, Escape ended the run as completed with nothing after the chooser, and Morning Brief got a run of its own.
A command that runs another flow
The fourth command, Morning Brief, has no wire and no case. Its kind is Flow. Picking it starts that flow as its own run, as if you had pressed Run on it, and Pick from List takes no outlet, so nothing else in this flow runs.
Use Wire when the work belongs to this flow, or is one node. Use Flow when the work is already a flow you start some other way. A morning brief that runs on a schedule is a good example: one row in the palette runs it on demand, and the flow itself does not change.
A Flow command is subtitled with its flow's name and wears the icon of that flow's folder unless you give it one of its own. A command you listed still shows when its flow is turned off. It cannot run the flow it lives in.
Offer shared flows fills the list for you. Turn it on and every flow that is switched on and exposed to AI agents appears as a Flow command after the ones you listed, in name order.
How it behaves
- Escape is not a failure. The run leaves by Dismissed and ends as completed.
- An unanswered chooser gives up after fifteen minutes, and that does fail the node.
- Math and Conversions is off in this flow. It is on by default, and typing
2 + 2then adds an answer row that leaves by Selected with nopath. Open the app needs a real row, so the toggle is off. - Two cases that differ only in capitals or punctuation share an outlet. The inspector flags the second one.
- The hotkey needs Accessibility permission the first time. Consume Key is on, so the app in front never sees the press.
- Copy Today's Date is one Run Script node:
date "+%Y-%m-%d" | tr -d "\n" | pbcopy.
Variations
- More commands. Sleep Displays is a Run Script with
pmset displaysleepnow. Any Open URL is a bookmark you can reach by typing. - A different list. Commands sit above any list, not only apps. Put a New Issue command over a list of Linear issues, or Add a Row over a database query.
- A front door for your flows. Turn on Offer shared flows and the palette lists every flow you have shared and switched on, with no rows to maintain.
On a keyboard shortcut, show my installed apps in a chooser with three commands on top: Open Downloads, GitHub Notifications and Copy Today's Date. Open the app I pick. Send the command I pick through a Router so each command has its own branch: open my Downloads folder, open https://github.com/notifications, or copy today's date to the clipboard.