# `Mix.Shell.IO`
[🔗](https://github.com/elixir-lang/elixir/blob/7ff272706afc522e74121493b7166719985cb099/lib/mix/lib/mix/shell/io.ex#L5)

This is Mix's default shell.

It simply prints messages to stdio and stderr.

# `yes_opts`

```elixir
@type yes_opts() :: [{:default, :yes | :no}]
```

Options for `yes?/2`.

# `cmd`

Executes the given command and prints its output
to stdout as it comes.

# `error`

Prints the given ANSI error to the shell followed by a newline.

# `info`

Prints the given ANSI message to the shell followed by a newline.

# `print_app`

Prints the current application to the shell if it
was not printed yet.

# `prompt`

Prints a message and prompts the user for input.

Input will be consumed until Enter is pressed.

# `yes?`

```elixir
@spec yes?(String.t(), yes_opts()) :: boolean()
```

Prints a message and asks the user to confirm if they
want to proceed. The user must type and submit one of
"y", "yes", "Y", "YES" or "Yes".

The user may also press Enter; this can be configured
to either accept or reject the prompt. The latter case
may be useful for a potentially dangerous operation that
should require explicit confirmation from the user.

If the default IO device is stderr, then it will default
to the default value.

## Options

  * `:default` - (:yes or :no) if `:yes` pressing Enter
    accepts the prompt; if `:no` pressing Enter rejects
    the prompt instead. Defaults to `:yes`.

## Examples

    if Mix.shell().yes?("Are you sure?") do
      # do something...
    end

---

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