Interactive Mode
Learn how to use Conjure's interactive mode to generate templates with guided prompts.
This tutorial will walk you through the default interactive mode for Conjure.
Before you begin, ensure you have:
- Command-line access on your machine
- Basic familiarity with your terminal
Note
This tutorial can be completed in under 10 minutes.
Note
This tutorial picks up where getting started finished and assumes the template hello-world exists in a local repository.
While experienced users can pass all variables via command line, Conjure provides an interactive mode that guides you through the template generation process. This is especially useful when you're unfamiliar with a template or want to explore what variables it accepts.
Interactive mode is helpful when:
- You're using a template for the first time
- You want to discover what variables a template accepts
- You prefer a guided experience over memorizing command flags
- You're sharing templates with team members who may be less familiar with the CLI
To run a template in interactive mode, simply omit the variables from the command:
conjure template hello-world -o greeting.txt
Conjure will detect that no variables were provided and automatically prompt you for each required value:
? Enter value for 'name': DevOps Engineer
? Enter value for 'team': Platform Engineering
✓ Generated greeting.txt from hello-world template
When a template requires variables, Conjure will:
- Analyze the template to discover all variable placeholders
- Prompt for each variable one at a time
- Display helpful context if the template includes descriptions
- Validate input based on template requirements
- Generate the artifact with your provided values
To make your templates work well in interactive mode, use descriptive variable names and include metadata:
- Learn more about template metadata requirements
Create a template metadata file templates/my-template/1.0.0/conjure.json:
{
"schema_version": "v1",
"template_name": "my-template.yaml",
"template_description": "Creates a configuration file for my application",
"template_type": "kubernetes",
"variables": [
{
"name": "app_name",
"description": "The name of your application",
"type": "string",
"default": ""
},
{
"name": "environment",
"description": "Deployment environment (dev, staging, prod)",
"type": "string",
"default": "dev"
},
{
"name": "replicas",
"description": "Number of application replicas",
"type": "int",
"default": "3"
}
]
}
With this metadata, Conjure will display:
? Enter value for 'app_name' (The name of your application): my-api
? Enter value for 'environment' (Deployment environment - dev, staging, prod) [dev]: prod
? Enter value for 'replicas' (Number of application replicas) [3]: 5
Using interactive mode is an "all or nothing" approach. --var nad -f cannot be combined with it using the -i flag.
Important
Interactive mode is not available when running Conjure in non-interactive environments. Always use
--varor values files for automation.
Now that you understand interactive mode, learn how to use values files for more complex scenarios: