An alias matches a command you type and replaces it with another command or script. This example makes k goblin send kill goblin.
kill-shortcut.^k (.+)$.k goblin. The tester should report a match.kill $1.
Return to the session, type k goblin, and press Enter. Smudgy sends kill goblin.
The Pattern field uses a regular expression.
^ means the start of the command.k matches those literal characters, including the space.(.+) captures one or more characters.$ means the end of the command.
The action's $1 is replaced by the first captured group. Named groups also work: ^k (?<target>.+)$ can send kill $target. Use $$ when the action needs a literal dollar sign.
Anchoring the pattern matters. A pattern of only k could also match unrelated input containing that letter.
Use the command separator in a text action:
stand;get sword;wield sword
These commands re-enter the normal outgoing pipeline in order, so another alias can match one of them. Keep chains short enough to understand when a later alias changes the result.
Switch Behavior to JavaScript for conditions, state, or client-only effects. The body runs as user code and can use the smudgy scripting API. For reusable code or more than a small body, move the work into a module.
Check the editor's tester, the enabled switch, and the folder's enabled state. Then check whether an earlier alias replaced the command first. See Organize and troubleshoot automations.