Macros (BEFORE/AFTER)
Macros let you attach steps to run before or after any command. They work the same from the CLI and the Dashboard.
Enable
User/Scripts/Macros/macros.yml
enable_macros: true
default_timeout_ms: 15000
before_command: {}
after_command: {}
Step Types
- cli — one CLI invocation (list or shlex string)
- chs — run a
.chsscript via the console pipeline - setvar — set a variable in the shared store
- noop — placeholder
Context & Expansion
@cmd,@args0,@args1, …- Each property as
@<prop>(e.g.,@priority) - AFTER summary:
@result_ok(true/false)
Example
enable_macros: true
default_timeout_ms: 12000
before_command:
new:
- setvar: { name: weekday, value: "@{date.weekday}" }
- cli: ["echo", "Creating @args0 '@args1'"]
after_command:
delete:
- cli: ["echo", "Deleted: @args1"]
Safety
- Timeout per step
- Recursion guard — macro sub-steps don’t re-trigger macros
- Bypass per call:
no_macros:true
