# `WardrikDaemon.CLI.Terminal`

The terminal a command writes to: how wide it is, whether it takes colour, and whether someone
types at it.

It takes colour if standard output is a terminal, `NO_COLOR` isn't set and `TERM` isn't `dumb`.
Otherwise, as through a pipe, it writes plain text 80 columns wide. Someone types at it where
`WARDRIK_INPUT` is `1`, as `bin/wardrik` sets it where standard input is a terminal.

# `t`

```elixir
@type t() :: %WardrikDaemon.CLI.Terminal{
  colour?: boolean(),
  input?: boolean(),
  width: pos_integer()
}
```

# `lines`

```elixir
@spec lines(t(), [Owl.Data.t()]) :: :ok
```

Writes each of `lines`.

# `new`

```elixir
@spec new(%{required(String.t()) =&gt; String.t()}) :: t()
```

Returns the terminal standard output is, with `env`, the environment, saying whether it takes colour and input.

# `puts`

```elixir
@spec puts(t(), Owl.Data.t()) :: :ok
```

Writes `data` and a newline, styled if the terminal takes colour.

# `secret`

```elixir
@spec secret(t(), String.t()) :: String.t() | nil
```

Asks for a line with `prompt`, not showing what's typed where it can. Returns `nil` for none.

---

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