Python library to build pretty command line user prompts with interactive forms and validation
Overall
score
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.
Install with Tessl CLI
npx tessl i tessl/pypi-questionarydocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10