Skip to main content
1

Create a playbook

Create a file named main.ern in your project:
task "default" {
  description = "Build the project"
  commands    = ["go build ./..."]
}
2

Run the task

errand run
When no task name is given, Errand runs the task named default.
3

Add variables and dependencies

Extend the playbook:
variable "output" {
  description = "Output binary path"
  type        = string
  default     = "bin/app"
}

task "test" {
  description = "Run tests"
  commands    = ["go test ./..."]
}

task "build" {
  description = "Build the binary"
  depends_on  = [task.test]
  commands    = ["go build -o ${var.output} ./cmd/app"]
}

task "default" {
  description = "Test and build"
  depends_on  = [task.build]
  commands    = []
}
Run a specific task:
errand run build
Override a variable:
errand run build --var output=bin/myapp
4

Run tasks in parallel

Use --concurrency to run independent tasks at the same time:
errand run --concurrency 4
Pass 0 for no limit:
errand run --concurrency 0

Next steps

Playbook

Learn all the block types: errand, variable, computed, and task.

Functions

Use built-in functions in expressions and commands.

CLI reference

See all flags for the errand run command.