A really excellent library is cmd which is part of the python standard library. It is cross platform Windows, Linux, Mac. You just have to implement one class and it offers so many great features:

  1. provides list of supported commands(they end up being implemented as methods)
  2. help command that can be called to explain one of your commands
  3. handles the whole entering a command, checking syntax, and calling your method command loop cycle.
  4. users can save the commands they have run in an interactive session and run them as a script. check out the example below.

If you take the turtle shell example and save it as turtleshell.py and save the below turtle script file as circles.txt

circle 20
circle 50
circle 100
bye

then you could run the turtle script with the following command:

cat circles.txt | ./turtleshell.py

so in the simple example shown in the docs the developer has essentially made a simple mini-language that can be used as an easier interface to to the turtle module making it even easier to introduce programming to kids. The examples above have been taken from the python3 docs because they have included a detailed example in their docs which wasn't there in the 2.7 docs, but cmd is available and fully functional in python 2.3 and later.

Answer from Marwan Alsabbagh on Stack Overflow
🌐
Python
docs.python.org › 3 › library › cmdlinelibs.html
Command-line interface libraries — Python 3.15.0 documentation
The Python standard library » · Command-line interface libraries · | Theme · Auto · Light · Dark | The modules described in this chapter assist with implementing command line and terminal interfaces for applications. Here’s an overview: argparse — Parser for command-line options, arguments and subcommands ·
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org › scenarios › cli
Command-line Applications — The Hitchhiker's Guide to Python
Python Fire is a library for automatically generating command-line interfaces from absolutely any Python object.
Discussions

Python command line interaction library? - Stack Overflow
I want to develop a small Python app that interacts with the user via the console/command line. Are there any good libraries I can use to get user input and display the output in a nice-looking way... More on stackoverflow.com
🌐 stackoverflow.com
The best Python CLI library, arguably.
🌐 r/madeinpython
6
14
June 16, 2023
Recommended library for an interactive CLI?
You’re looking for a TUI, a Text User Interface Library. Here are some examples: https://github.com/bczsalba/pytermgui https://github.com/Textualize/textual There are a number of TUI libraries, I expect you can find on that fits your needs if you search for Python TUI. Gooey is an interesting tool that may get you most of the way to what you want. It creates a GUI automatically from the same set of directives you would use to set up a command line utility (argparse). https://github.com/chriskiehl/Gooey More on reddit.com
🌐 r/learnpython
10
8
February 11, 2022
Best library for TUI (Text User Interface) and CLI (Command line Interface)
I'm a huge fan of Typer . I agree with all the advantages listed on the homepage (intuitive, easy, concise, scalable). Give it a try. More on reddit.com
🌐 r/learnpython
5
3
October 20, 2022
🌐
Reddit
reddit.com › r/learnpython › recommended library for an interactive cli?
r/learnpython on Reddit: Recommended library for an interactive CLI?
February 11, 2022 -

I'm trying to build a simple script. I'd like to present a list of options to a user, then allow the user to tab up and down through the list (using arrows and/or j+k) and select an option with enter.

Bonus points if the library can:

  • present follow up options/questions/commands after selecting an option

  • accept one of multiple keystrokes/commands when selecting the option, not just <enter>

  • refresh the view of the list of options (e.g. if there are associated statuses with each option)

Any suggestions?

Thanks!

🌐
GitHub
github.com › shadawck › awesome-cli-frameworks
GitHub - shadawck/awesome-cli-frameworks: Collection of tools to build beautiful command line interface in different languages · GitHub
Python-Fire : Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
🌐
Python
docs.python.org › 3 › library › cmdline.html
Modules command-line interface (CLI) — Python 3.15.0 documentation
The following modules have a command-line interface. ast, asyncio, base64, calendar, code, compileall, cProfile: see profiling.tracing, dis, doctest, encodings.rot_13, ensurepip, filecmp, fileinput...
🌐
Opensource.com
opensource.com › article › 17 › 5 › 4-practical-python-libraries
4 Python libraries for building great command-line user interfaces | Opensource.com
May 9, 2017 - In the second installment of a two-part series on terminal applications with great command-line UIs, we explore Prompt Toolkit, Click, Pygments, and Fuzzy Finder.
🌐
Towards Data Science
towardsdatascience.com › home › latest › typer – probably the simplest to use python command-line interface library
Typer - Probably The Simplest To Use Python Command-Line Interface Library | Towards Data Science
January 22, 2025 - Using Python Argparse To Develop A Command-Line Interfaced Program · The module is indeed easy to use but also has some drawbacks. Therefore, in this article, I’ll introduce a 3rd party library called Typer, which I believe is probably one of the best for developing a Python CLI program.
Find elsewhere
🌐
Python
docs.python.org › 3.15 › library › cmdlinelibs.html
Command-line interface libraries — Python 3.15.0rc1 documentation
The Python Standard Library » · Command-line interface libraries · | Theme · Auto · Light · Dark | The modules described in this chapter assist with implementing command line and terminal interfaces for applications. Here’s an overview: argparse — Parser for command-line options, arguments and subcommands ·
Top answer
1 of 3
12

A really excellent library is cmd which is part of the python standard library. It is cross platform Windows, Linux, Mac. You just have to implement one class and it offers so many great features:

  1. provides list of supported commands(they end up being implemented as methods)
  2. help command that can be called to explain one of your commands
  3. handles the whole entering a command, checking syntax, and calling your method command loop cycle.
  4. users can save the commands they have run in an interactive session and run them as a script. check out the example below.

If you take the turtle shell example and save it as turtleshell.py and save the below turtle script file as circles.txt

circle 20
circle 50
circle 100
bye

then you could run the turtle script with the following command:

cat circles.txt | ./turtleshell.py

so in the simple example shown in the docs the developer has essentially made a simple mini-language that can be used as an easier interface to to the turtle module making it even easier to introduce programming to kids. The examples above have been taken from the python3 docs because they have included a detailed example in their docs which wasn't there in the 2.7 docs, but cmd is available and fully functional in python 2.3 and later.

2 of 3
6

You can control the Unix terminal with the curses library. The library essentially lets you build a simple terminal GUI.

If you need more, take a look at Urwid as well. Urwid offers more complex GUI widgets for the discerning terminal GUI developer. :-)

🌐
Click Documentation
click.palletsprojects.com
Welcome to Click — Click Documentation (8.5.x)
Click is a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary.
🌐
Python
docs.python.org › 3 › library › cmd.html
cmd — Support for line-oriented command interpreters
The Python standard library » ... · Light · Dark | Source code: Lib/cmd.py · The Cmd class provides a simple framework for writing line-oriented command interpreters....
🌐
Real Python
realpython.com › ref › glossary › command-line-interface
command-line interface (CLI) | Python Glossary – Real Python
In this step-by-step Python tutorial, you'll learn how to take your command-line Python scripts to the next level by adding a convenient command-line interface (CLI) that you can write with the argparse module from the standard library.
🌐
ThemeSelection
themeselection.com › home › collections › 9 must have python cli library for developers in 2025
10+ Best Python CLI Library for Developers - ThemeSelection
August 11, 2026 - Python Fire is a versatile Python CLI library designed to simplify the process of creating command-line interfaces from existing Python code. Besides, with Python Fire, developers can automatically generate command-line interfaces for their programs.
🌐
Real Python
realpython.com › python-click
Click and Python: Build Extensible and Composable CLI Apps – Real Python
March 18, 2026 - You can use the Click library to quickly provide your Python automation and tooling scripts with an extensible, composable, and user-friendly command-line interface (CLI).
🌐
Stack Abuse
stackabuse.com › generating-command-line-interfaces-cli-with-fire-in-python
Generating Command-Line Interfaces (CLI) with Fire in Python
September 20, 2023 - Google's Python Fire library is a quick and easy way to generate command line interfaces (CLIs) for nearly any Python object.
🌐
Medium
medium.com › @wilson79 › 10-best-python-cli-libraries-for-developers-picking-the-right-one-for-your-project-cefb0bd41df1
10+ Best Python CLI Libraries for Developers: Picking the Right One for Your Project | by Wilson | Medium
February 3, 2026 - Shows multiple CLI libraries (Rich, TQDM, Typer) exactly as discussed in your article. It’s 11:24 PM on a Thursday. You’ve been staring at your terminal for the past hour, trying to figure out why your Python script keeps throwing cryptic errors when users enter the wrong input. Your CS professor wants a “user-friendly command-line ...
🌐
Qodo
qodo.ai › blog › code integrity › building user-friendly python command-line interfaces with click
Building User-Friendly Python Command-Line Interfaces with Click
February 17, 2025 - Among the various Python libraries available for CLI development, Click stands out as a powerful and user-friendly choice. Click is a Python package created by Armin Ronacher that streamlines the process of constructing robust and user-friendly command-line interfaces.
🌐
DEV Community
dev.to › usooldatascience › mastering-command-line-interfaces-cli-in-python-a-comprehensive-guide-10bc
Mastering Command-Line Interfaces (CLI) in Python: A Comprehensive Guide - DEV Community
September 15, 2024 - click is a more advanced library for creating command-line interfaces. It provides a decorator-based approach to defining commands, subcommands, and options. Better readability: A more Pythonic, decorator-based syntax.
🌐
GitHub
github.com › treykeown › arguably
GitHub - treykeown/arguably: The best Python CLI library, arguably. · GitHub
The best Python CLI library, arguably. arguably turns functions and docstrings into command line interfaces (CLIs). arguably has a tiny API and is extremely easy to integrate.