Build Interactive CLI Tools in Python

Bored of traditional CLIs? Develop interactive command lines with PyInquirer

Dinesh Kumar K B
Geek Culture

--

Photo by Sigmund on Unsplash

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:

  1. Are you bored of the traditional cli’s?
  2. 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.

A quick introduction to Click:

--

--

Dinesh Kumar K B
Geek Culture

Python Back-End Developer, CKAD |AWS | Django | Flask | Fastapi |Azure | www.linkedin.com/in/dineshkumarkb