The variables
command lists all variables specified in the manifest. It takes the template name as an argument.
To view the variables defined for a template run:
archetype variables
You will be presented with an interactive list of template names to choose from:
Please choose manifest (Press ↑/↓/←/→ arrow to move and Enter to select)
‣ go_module
bash_script
rails_mono_app_module
rails_mono_app_client
rails_mono_app
rails_mono_app_ui_engine
Pick the template you want to view and then press ENTER
.
As an example, assume the bash_script
option from above is defined with the following manifest:
{
"name": "bash_script",
"version": "1.0.0",
"metadata": {
"app_archetype": {
"version": "1.0.1"
}
},
"variables": {
"script_name": {
"type": "string",
"description": "Name of script"
},
"script_description": {
"type": "string",
"description": "Short sentence describing purpose of the script"
}
}
}
You should observe a table with variable definition information much like this:
NAME DESCRIPTION DEFAULT
script_description Short sentence describing purpose of the script
script_name Name of script
This is a good way of viewing at a glance what variables you’ll need to have handy before you render a template.
You can skip the template selection step by specifying the exact name of the template in the optional --name
flag:
archetype variables --name bash_script
If the given name does not match the template name exactly then an error message like this will be provided back:
✖ ERROR: Unable to find manifest yolo