Use Template syntax and special variables
mainRunprompt uses a subset of Handlebars/Mustache syntax for prompt templates.
Special Variables
{{STDIN}}: Raw stdin content.{{ARGS}}: Command line arguments passed after the prompt file.{{INPUT}}:{{STDIN}}if provided, otherwise{{ARGS}}.{{BEFORE}}: Combined output from allbefore:commands.{{variable_name}}: Individual variables frombefore:commands.
Supported Features
- Interpolation:
{{variableName}},{{object.property}} - Conditionals:
{{#if key}}...{{/if}},{{#unless key}}...{{/unless}} - Iteration:
{{#each items}}...{{/each}}(supports@index,@first,@last,@key) - Sections:
{{#key}}...{{/key}}(renders if truthy) - Inverted Sections:
{{^key}}...{{/key}}(renders if falsy) - Comments:
{{! comment }}