> ## Documentation Index
> Fetch the complete documentation index at: https://errand.nuvrel.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# errand run

> Run tasks from the playbook.

The `run` command runs one or more tasks from the playbook files in the target directory.

## Usage

```bash theme={null}
errand run [tasks...] [flags]
```

If no task names are given, Errand runs the task named `default`.

## Arguments

<ParamField body="tasks" type="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.
</ParamField>

## Flags

<ParamField body="--var, -v" type="name=value">
  Set a variable value. Repeat the flag to set multiple variables.

  ```bash theme={null}
  errand run deploy --var env=production --var replicas=3
  ```
</ParamField>

<ParamField body="--concurrency, -c" type="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.

  ```bash theme={null}
  errand run --concurrency 4
  errand run --concurrency 0
  ```
</ParamField>

<ParamField body="--echo, -e" type="bool" default="true">
  Print each command before running it. Set to `false` to suppress command output:

  ```bash theme={null}
  errand run --echo=false
  ```
</ParamField>

<ParamField body="--exit-code, -x" type="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.

  ```bash theme={null}
  errand run --exit-code
  ```
</ParamField>

<ParamField body="--dir, -d" type="path" default=".">
  Directory containing the playbook files. Defaults to the current directory.

  ```bash theme={null}
  errand run --dir ./ops deploy
  ```
</ParamField>

## Examples

Run the `default` task:

```bash theme={null}
errand run
```

Run a specific task:

```bash theme={null}
errand run build
```

Run multiple tasks:

```bash theme={null}
errand run lint test build
```

Run with concurrency and a variable:

```bash theme={null}
errand run deploy --concurrency 4 --var env=production
```

Run tasks from a different directory:

```bash theme={null}
errand run --dir ./service/api test
```

## Exit codes

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