> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/cli/for-devops-and-administrators/automate/non-interactive.md).

# Run without prompts

Run Devolutions CLI in scripts and pipelines without prompts: fail instead of waiting, answer prompts in advance, and confirm changes with --yes.

A script that waits for an answer nobody gives just hangs until the job times out. Devolutions CLI has two separate safeguards to handle: **prompts**, where it asks a question in the terminal, and **confirmations**, where a command that changes data refuses to run until you add `--yes`. This page shows how to deal with both.

## Pick the right option

<table><thead><tr><th width="260">CHOOSE</th><th>WHAT HAPPENS</th><th>USE IT WHEN</th></tr></thead><tbody><tr><td><code>--non-interactive</code> or <code>DEVO_NON_INTERACTIVE</code></td><td>Devolutions CLI never asks a question. A command that needs an answer it doesn't have fails instead of waiting.</td><td>Always, in pipelines and scheduled scripts.</td></tr><tr><td><code>--answer</code> or <code>DEVO_PROMPT_ANSWERS</code></td><td>Devolutions CLI uses the answers you give, in order, instead of asking.</td><td>You know a command asks a question, and you know the answer.</td></tr><tr><td><code>--yes</code> (also <code>-y</code> or <code>--confirmed</code>)</td><td>Confirms a command that changes data. Without it, the command refuses to run.</td><td>The script creates, changes, or deletes something on purpose.</td></tr></tbody></table>

## Never wait for an answer

Add `--non-interactive` to a command, or set `DEVO_NON_INTERACTIVE` once for the whole job:

{% tabs %}
{% tab title="Bash" %}

```bash
export DEVO_NON_INTERACTIVE=1
```

{% endtab %}

{% tab title="PowerShell" %}

```powershell
$env:DEVO_NON_INTERACTIVE = '1'
```

{% endtab %}
{% endtabs %}

Any value turns it on, except `0`, `false`, and `no`. Devolutions CLI also behaves this way on its own when its standard input is redirected, which is usually the case in a pipeline. Setting it explicitly makes the behavior the same everywhere.

When a question can't be asked, the command fails instead of hanging, and your script can report the error.

## Answer prompts in advance

When you know a command will ask something, give the answer with `--answer`. Repeat it for several prompts. Devolutions CLI uses the answers in the order the questions come:

```bash
devo <command> --answer <first-answer> --answer <second-answer>
```

Or set them once in `DEVO_PROMPT_ANSWERS`, separated by `;` or by line breaks. Answers from `--answer` are used first, then the ones from the variable.

```bash
export DEVO_PROMPT_ANSWERS="<first-answer>;<second-answer>"
```

How each kind of question uses an answer:

<table><thead><tr><th width="220">QUESTION</th><th>WHAT TO ANSWER</th></tr></thead><tbody><tr><td><strong>A choice in a list</strong></td><td>The number of the choice, starting at <code>0</code>, or its label. Labels aren't case-sensitive. An answer that matches no choice cancels the prompt.</td></tr><tr><td><strong>Several fields to fill</strong></td><td>One answer per field, in the order the fields are asked.</td></tr><tr><td><strong>A credential</strong></td><td>The answer is used as the password.</td></tr><tr><td><strong>A message</strong></td><td>Nothing: messages take their default answer and don't use one of yours.</td></tr></tbody></table>

{% hint style="warning" %}
Don't use `--answer` for a password or another secret: it puts the value on the command line. Sign in with options that read the secret from an environment variable or a file instead. See [Sign in from a CI pipeline](/cli/for-devops-and-administrators/automate/ci-sign-in.md).
{% endhint %}

## Confirm changes with --yes

Commands that create, change, or delete data have a `--yes` option, with the aliases `-y` and `--confirmed`. It isn't a prompt: without it, the command doesn't ask anything, it stops with an error (`confirmationRequired` or `mutationConfirmationRequired`) and exit code `2`. `--non-interactive` doesn't confirm anything for you.

For example, to update a password from an environment variable:

```bash
devo secret set password "<entry-name>" --value-env NEW_PASSWORD --yes
```

To know whether a command needs `--yes`, check its options in [Commands](/cli/reference/commands.md).

{% hint style="danger" %}
`--yes` removes the last check before a change. Some commands that accept it delete data. Test your script against a test vault or with read-only commands first.
{% endhint %}

## Good to know

* Prompts and their messages are written to standard error, never to standard output, so they don't mix with JSON results. See [Read results as JSON](/cli/for-devops-and-administrators/automate/json-output.md).
* Device code sign-in waits for a person to approve it, so it doesn't fit a non-interactive job. See [Sign in from a CI pipeline](/cli/for-devops-and-administrators/automate/ci-sign-in.md).
* All global options are listed in [Global options](/cli/reference/global-options.md), and the variables in [Environment variables](/cli/reference/environment-variables.md).

## Next

* [Sign in from a CI pipeline](/cli/for-devops-and-administrators/automate/ci-sign-in.md)
* [Read results as JSON](/cli/for-devops-and-administrators/automate/json-output.md)
* [Update a secret from a script](/cli/guides/secrets/update-a-secret.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/cli/for-devops-and-administrators/automate/non-interactive.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
