The run Step
The run step allows you to execute arbitrary shell commands directly within your task. This allows you to integrate with existing command-line tools, scripts, or performing system-level operations that don't require the intelligence of an AI agent.
Key characteristics of a run step:
- Direct Execution: The command specified in
runis executed as if you were typing it into a terminal. - Output Capture: The standard output (stdout) of a
runcommand can be captured and used as input for subsequent steps, often via theoutputs.<step_index>variable. - Simplicity: Ideal for straightforward operations that don't require complex decision-making or code generation.
Examples from task
Here are two examples of run steps from an example task:
1. Getting a list of files:
- name: List project files
run: ls -1 src/components/
In this example:
- The
runstep executes thels -1 src/components/command, which lists all files in thesrc/components/directory, one per line. - The output of this command (a list of file paths) can then be used by subsequent steps, such as a
for_eachloop.
2. Installing a command-line tool:
- name: Install CLI tool
run: npm install -g my-cli-tool@latest
In this example:
- The
runstep executes annpm installcommand to install a generic command-line tool. - This ensures that
my-cli-toolis available for use in later steps of the task, such as when an agent is instructed to use it for a specific task.
The run step provides a flexible way to incorporate any command-line operation into your Bosun tasks, bridging the gap between AI-driven automation and traditional scripting.
Error handling
By default a run step halts the task if the command fails. Set continue_on_error: true to record the failure and keep going—the runtime stores the error details in both the step output and the shared errors collection so later steps can inspect them. See Error handling for examples and templating tips.