For the complete documentation index, see llms.txt. This page is also available as Markdown.

Run without prompts

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

CHOOSE
WHAT HAPPENS
USE IT WHEN

--non-interactive or DEVO_NON_INTERACTIVE

Devolutions CLI never asks a question. A command that needs an answer it doesn't have fails instead of waiting.

Always, in pipelines and scheduled scripts.

--answer or DEVO_PROMPT_ANSWERS

Devolutions CLI uses the answers you give, in order, instead of asking.

You know a command asks a question, and you know the answer.

--yes (also -y or --confirmed)

Confirms a command that changes data. Without it, the command refuses to run.

The script creates, changes, or deletes something on purpose.

Never wait for an answer

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

export DEVO_NON_INTERACTIVE=1
$env:DEVO_NON_INTERACTIVE = '1'

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:

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.

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

How each kind of question uses an answer:

QUESTION
WHAT TO ANSWER

A choice in a list

The number of the choice, starting at 0, or its label. Labels aren't case-sensitive. An answer that matches no choice cancels the prompt.

Several fields to fill

One answer per field, in the order the fields are asked.

A credential

The answer is used as the password.

A message

Nothing: messages take their default answer and don't use one of yours.

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:

To know whether a command needs --yes, check its options in Commands.

Good to know

Next

Last updated

Was this helpful?