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%
Build a command line tool that helps users discover and execute commands through an interactive autocomplete interface.
Create a Python script that provides an interactive command selection interface with autocomplete functionality. The system should help users find and execute commands from a predefined list.
The tool should support these commands:
list files - Lists all files in the current directorylist directories - Lists all directories in the current directorysearch files - Searches for files by name patternshow help - Displays help informationclear screen - Clears the terminal screenprint date - Prints the current dateprint time - Prints the current timeexit program - Exits the toolInteractive Selection: Present an interactive prompt asking "Select a command to execute:"
Autocomplete Behavior:
Command Execution: After selection, the tool should:
Program Flow: After displaying the selection, the program should exit normally
@generates
Create a single Python script that implements this functionality. The script should be executable from the command line.
def get_command_choices():
"""
Returns a list of command strings available for selection.
Returns:
list: A list of command name strings
"""
pass
def get_command_description(command):
"""
Returns the description for a given command.
Args:
command (str): The command name
Returns:
str: The command description
"""
pass
def main():
"""
Main entry point that presents the interactive command selector
and handles the user's selection.
"""
passWhen the user types "list" and selects "list files", the output should contain "You selected: list files" followed by "Lists all files in the current directory" @test
When the user types "time" and selects "print time", the output should contain "You selected: print time" followed by "Prints the current time" @test
The autocomplete should match "files" to both "list files" and "search files" (case-insensitive partial matching) @test
Provides interactive command line prompts with autocomplete functionality.