Skip to main content

prompts

Parameters

List of prompts to be asked before running the operations and suggesting anything during a call to omni up.

Each prompt configuration can use templates, including the already-asked prompts. This can be used to ask a prompt only if another prompt has been answered in a certain way for example.

ParameterTypeDescription
idstringRequired. The identifier of the prompt, must be unique as will be used to identify the answer to this prompt, or if that prompt has already been answered before.
promptstringRequired. The prompt to be asked.
scopestringThe scope of the prompt, can be repo or org (default: repo). If the scope is repo, it means that the answer to this prompt will only be considered for this repository. If the scope is org, the prompts from other repositories of the same org will be considered. This allows to load already-answered prompts instead of asking again.
typeprompt typeThe type of the prompt, can be boolean, string, number, password or list (default: boolean).
ifstringThe condition to ask the prompt. The condition is a template that must resolve to true, yes, on or 1. If it resolves to anything else, the prompt will not be asked.
defaultstringThe default value of the prompt.
choiceslist(choice) or stringRequired for choice and multichoice prompts. The list of choices for the prompt. Can be provided as a string template of a list to dynamically add options.

Prompt types

Prompt typeTemplate typeDescription
textstringA string prompt, the answer can be any string.
passwordstringA password prompt, the answer can be any string. The typed characters will be hidden. Note that the prompt result will be stored in clear in the cache file.
confirmbooleanA confirmation prompt, the answer can be yes or no.
choicestringA list prompt, the answer can be any of the items in the list.
multichoicelistA multiple choice prompt, the answer can be any of the items in the list.
intintAn integer prompt, the answer can be any integer.
floatfloatA float prompt, the answer can be any float.

Choice

Choice for a choice or multichoice prompt.

Can be provided as a string or an object with the following parameters:

ParameterTypeDescription
idstringThe identifier of the choice. The identifier is used in templates when reading the prompt value. If not provided, the value of the choice will be used as the identifier.
choicestringThe choice to be displayed to the user. If not provided, the identifier will be displayed.

Example

prompts:
- id: team
prompt: What is your team?
scope: org
type: choice
choices:
- id: team1
choice: team 1
- team 2
- team 3
- id: subteam
prompt: What are your subteams in {{ prompts.team }}?
scope: org
type: multichoice
choices: |
- subteam 1
- subteam 2
{{% if prompts.team == "team1" %}}- subteam 3{{% endif %}}
if: '{{ prompts.team == "team1" or prompts.team == "team 2" }}'