Table of Contents

Create an alias

An alias matches a command you type and replaces it with another command or script. This example makes k goblin send kill goblin.

Build the alias

  1. Open a profile, connected or offline.
  2. Open Automations and choose Create alias.
  3. Set Name to kill-shortcut.
  4. Set Pattern to ^k (.+)$.
  5. In Test against a command, enter k goblin. The tester should report a match.
  6. Leave Behavior on Send as text.
  7. In Script, enter kill $1.
  8. Choose Create alias.

A new text alias with a pattern, matching test command, and kill $1 action

Return to the session, type k goblin, and press Enter. Smudgy sends kill goblin.

What the pattern means

The Pattern field uses a regular expression.

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.

Send more than one command

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.