# `Juggernaut.CLI.ExitCode`
[🔗](https://github.com/holsee/juggernaut/blob/v0.4.0/lib/juggernaut/cli/exit_code.ex#L1)

Exit codes shared by every `mix juggernaut*` task (see the
[agent output guide](agent-output.md)).

| Code | Meaning |
| --- | --- |
| 0 | Gate passed, or a read-only task succeeded. |
| 1 | Gate failed or incomplete. |
| 2 | Usage or configuration error. Nothing was scored. |
| 3 | Infrastructure or harness error. Never a verdict. |

When several apply the precedence is 2, then 3, then 1, then 0.

# `t`

```elixir
@type t() :: 0..3
```

# `combine`

```elixir
@spec combine([t()]) :: t()
```

Combines several exit codes by precedence (2, then 3, then 1, then 0).

# `halt`

```elixir
@spec halt(t()) :: :ok | no_return()
```

Ends a Mix task with `code`: returns `:ok` for 0, otherwise exits with
`{:shutdown, code}`, which Mix turns into the process exit status.

# `of`

```elixir
@spec of(:ok | :gate_failed | Juggernaut.Error.t()) :: t()
```

The exit code for an outcome: `:ok`, `:gate_failed` or a `Juggernaut.Error`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
