CITGuru / PyInquirer

A Python module for common interactive command line user interfaces
MIT License
1.94k stars 236 forks source link

autocomplete feature [enhancement] #73

Closed KebabLord closed 5 years ago

KebabLord commented 5 years ago

Js version of Inquirer had autocompletion type, it would be awesome if we had it on PyInquirer too

CITGuru commented 5 years ago

Cool

JMathiszig-Lee commented 5 years ago

PyInquirer passes arguments to prompt-toolkit so you can already to this.

For example with an input type the following code questions = [ { 'type': 'input', 'name': 'things', 'message': 'Enter a thing', 'completer': MyCompleter() } ] answers = PyInquirer.prompt(questions)

will give you autocomplete for that field. See the documentation here for creating a custom completer which suits your needs. prompt-toolkit is one of the PyInquirer dependencies so you will already have it.

KebabLord commented 5 years ago

thanks!

e3rd commented 4 years ago

Would you please be so kind and show me a working example for type = list? I can't make it.

I'd love to have classic PyInquirer list with UP/DOWN moving caret. When I start typing, some of the options pops out.