Skip to main content
The run command runs one or more tasks from the playbook files in the target directory.

Usage

errand run [tasks...] [flags]
If no task names are given, Errand runs the task named default.

Arguments

tasks
string[]
One or more task names to run. Each name must match a task block declared in the playbook. Errand resolves all required tasks in the correct order.

Flags

--var, -v
name=value
Set a variable value. Repeat the flag to set multiple variables.
errand run deploy --var env=production --var replicas=3
--concurrency, -c
number
default:"1"
Maximum number of tasks to run at the same time.
  • 1 (default) runs tasks sequentially.
  • Any positive number limits concurrent execution to that count.
  • 0 runs all independent tasks at the same time with no limit.
errand run --concurrency 4
errand run --concurrency 0
--echo, -e
bool
default:"true"
Print each command before running it. Set to false to suppress command output:
errand run --echo=false
--exit-code, -x
bool
default:"false"
Forward the exit code of failed tasks. When enabled, errand run exits with the same code as the first failed task. By default it exits with 1 for any failure.
errand run --exit-code
--dir, -d
path
default:"."
Directory containing the playbook files. Defaults to the current directory.
errand run --dir ./ops deploy

Examples

Run the default task:
errand run
Run a specific task:
errand run build
Run multiple tasks:
errand run lint test build
Run with concurrency and a variable:
errand run deploy --concurrency 4 --var env=production
Run tasks from a different directory:
errand run --dir ./service/api test

Exit codes

CodeMeaning
0All tasks succeeded or were skipped
1One or more tasks failed (default)
<n>Exit code of the failed task (with --exit-code)