Macros: one key, a whole sequence.
A macro types into the pane you're in, the way you would, and waits for each menu before the next step. Switch an agent's model, restart a dev server, run the same three commands: write it once, press one key from then on.
What a macro looks like
A macro is what you would do by hand, written down: one action per line, run from top to bottom. This one switches Claude Code to another model. Each line, and what it does:
That's all a macro is. Shepi does each line in turn, in the pane you're in, as if you were typing.
The shape of a line
Every line is a command word, then what it acts on. There are only four command words. Pick the one for what you want to do:
| Type some text | type "/model opus" |
| Press a key, or a few | press down down enter |
| Wait until something appears | wait for "Select model" |
| Just wait a moment | pause 300 |
The command word never changes. What follows it is yours:
- Text you type or wait for goes in "double quotes".
- Keys are names, not symbols:
enter,esc,up,ctrl+c. The full list is short. - Numbers are plain numbers:
pause 300is 300 milliseconds. - A line that starts with
#is a note for yourself, and empty lines are fine.
Write your own
Say you want one key that restarts the dev server running in a shell pane.
1. Do it once by hand, and notice each thing you do
Then write each one down as a line:
| Press ⌃C to stop the server | press ctrl+c |
| Give it a moment to stop | pause 300 |
| Type the command | type "bun run dev" |
| Press Return | press enter |
2. Wherever you waited, decide how
If you waited for something you could see, a menu, a prompt, a word, use wait for with that text. It waits exactly as long as needed, so the next key never lands too early. Use pause only when nothing visible changes, like the server stopping above.
- Pick text that only appears once the thing is ready, like a menu's title, not a word already on the screen.
- Keep it short:
"Select model"survives small changes better than a whole sentence. Case doesn't matter. - It waits up to 5 seconds. For something slow, add
up to 20 s(at most 30).
3. Put it in Shepi and try it
- Open Settings › Macros and click New macro. Type its name over “New macro” at the top.
- Write the lines in the Steps box. As you type, Shepi suggests the command words and key names: tab takes one. Each line is checked as you type; a problem shows in red right under its line.
- Click Try: it runs in the pane you were last in, and each line lights up while it runs. If it stops, that line turns red and says why. Adjust until it does what you did by hand.
- Give it a key if you like, like ⌃B m or ⌥⌘1. Without one, run it from ⌃B ?.
The starter examples in Settings › Macros are written the same way: open one, read it, press Try.
Recipes
Copy one into a new macro and adjust it. Agents change between versions, so check each one with Try.
Switch Claude Code's model by name
type "/model opus" press enter
Pick from an agent's menu
# open the menu, wait for it, choose type "/model" press enter wait for "model" press down enter
Start fresh in Claude Code
type "/clear" press enter
Run the tests and wait for the result
type "bun test" press enter wait for "pass" up to 30 s
The four commands, exactly
That is the whole language: these four lines and notes. Words in <angle brackets> are what you fill in; [ … ] is optional. Anything else is marked in red in the editor, with the reason.
type "<text>" | Types the text, as if you typed it (not pasted), so slash menus open. Inside the quotes, write \" for a quote and \\ for a backslash. |
press <key> [<key> …] | Presses one or more keys in order, each a key name. |
wait for "<text>" [up to <seconds> s] | Waits until the text is on the pane's screen, in any case. 5 seconds unless you say otherwise; 1 to 30. |
pause <milliseconds> | Waits that long; 1 to 10000. |
# … | A note; ignored. |
A macro has at most 50 lines and runs for at most a minute.
Key names
The names press accepts, the same ones Herdr uses. This is the complete list; any other word is marked in red.
| Special keys | enter tab esc backspace up down left right |
| Letters and digits | a to z, 0 to 9 |
| Punctuation | minus plus backtick |
| Function keys | f1 to f12 |
| With a modifier | ctrl+<key> alt+<key> shift+<key>, like ctrl+c, alt+x, shift+tab |
To type ordinary text, use type rather than pressing letters one by one.
Running a macro
A macro types into the pane that is focused when it starts, on this Mac or another machine, and stays on that pane even if you move. While it runs, the status line says "Running …", your own typing into that pane waits, and esc stops it. When it finishes, nothing is announced: the pane shows the result. It never types into a read-only pane or into a machine that is offline.
Keys and Only for
- Keys: any key after the prefix, like ⌃B m, or a shortcut with ⌘, like ⌥⌘1. Shepi refuses a key that Herdr, Shepi or macOS already uses, or another macro has. If Herdr later starts using a macro's key, Herdr wins and the macro tells you to pick another.
- Only for: limit a macro to one agent, like Claude Code, or to a plain shell. In other panes its key does nothing but say so.
When a macro stops
| "… didn't appear" | A wait for timed out: the menu took longer, or its text is different. Check the text by hand; add up to 10 s if it is just slow. |
| "stopped with Esc" | You pressed esc. Nothing more was typed. |
| "the pane is read only" | Another client has the input; take it over with ⌃B i. |
| "… is offline" | The machine is not connected; reconnect it from the sidebar. |
| "is for Claude Code" | The macro is limited to another kind of pane (Only for). |
A line in red in the editor says what is wrong with it; nothing runs until every line is valid.
In Herdr's terminal UI too
If you also use Herdr's own terminal UI, Copy for Herdr's config under Try copies the macro as a Herdr custom command. Paste it into your Herdr config yourself; Shepi never edits that file.