Build Interactive CLI Tools in Python
Bored of traditional CLIs? Develop interactive command lines with PyInquirer
Note:For non-members, this article is also available at https://dineshkumarkb.com/tech/how-to-build-interactive-command-line-tools-in-python/
Introduction:
Command-line interfaces are quick and efficient tools to accomplish tasks. Not only that, but it’s also cool to have a command-line interface for any web application you develop to avoid having the end-user getting lost in the vast UI sitemap.
That’s why despite having a feature-rich console, aws has an amazing cli backed by its botocore
module doesn’t it?
Motivation:
- Are you bored of the traditional cli’s?
- Are you bored of documenting the commands for every single feature in the cli?
If yes, then you should definitely read further.
We can build interactive and immersive command-line interfaces in python using PyInquirer
and other libraries.
For my example, I am picking click
and PyInquirer
.