tessl install tessl/pypi-questionary@2.1.0Python library to build pretty command line user prompts with interactive forms and validation
Agent Success
Agent success rate when using this tile
96%
Improvement
Agent success rate improvement when using this tile compared to baseline
1x
Baseline
Agent success rate without this tile
96%
A command-line configuration wizard that collects user settings for a new project setup using interactive prompts.
Collects multiple configuration settings from the user through a series of interactive prompts defined in a dictionary-based structure. The configuration flow should handle different prompt types and return all answers as a dictionary.
Shows or hides certain questions based on previous answers using conditional logic.
Transforms user answers before storing them in the final configuration dictionary using filter functions.
@generates
def create_configuration_wizard(questions: list[dict]) -> dict:
"""
Creates and runs a configuration wizard based on a list of question definitions.
Args:
questions: List of question dictionaries, each containing:
- type: The prompt type (e.g., 'text', 'confirm', 'select')
- name: The key for storing the answer
- message: The prompt message to display
- when (optional): Callable that determines if question should be shown
- filter (optional): Callable to transform the answer
- default (optional): Default value for the prompt
- choices (optional): List of choices for select-type prompts
Returns:
Dictionary containing all collected answers with question names as keys
"""
passProvides interactive command-line prompts with dictionary-based configuration support.