Listed in editorial order, grouped by use case. Click a column to re-sort the whole list.
Press / to search. Tap a tag to filter. Click any row for details.
Search and filter
Results
| Row number | Tags | |||||
|---|---|---|---|---|---|---|
General 5 projects |
||||||
| 1 | argparse General | Stdlib | 77,436 | General CLI Development CLI & GUI Stdlib | → | |
|
(Python standard library) Command-line option and argument parsing.
|
||||||
| 2 | click General | 815,819,968 | 17,783 | General CLI Development CLI & GUI | → | |
|
A package for creating beautiful command line interfaces in a composable way.
|
||||||
| 3 | typer General | 242,636,570 | 20,049 | General CLI Development CLI & GUI | → | |
|
Modern CLI framework that uses Python type hints. Built on Click.
|
||||||
| 4 | prompt_toolkit General | 183,368,083 | 10,592 | General CLI Development CLI & GUI | → | |
|
A library for building powerful interactive command lines.
|
||||||
| 5 | fire General | 17,794,399 | 28,222 | General CLI Development CLI & GUI | → | |
|
A library for creating command line interfaces from absolutely any Python object.
|
||||||
Terminal Rendering 4 projects |
||||||
| 6 | rich Terminal Rendering | 451,076,735 | 57,471 | Terminal Rendering CLI Development CLI & GUI | → | |
|
Python library for rich text and beautiful formatting in the terminal. Also provides a great
RichHandler log handler. |
||||||
| 7 | tqdm Terminal Rendering | 412,344,075 | 31,350 | Terminal Rendering CLI Development CLI & GUI | → | |
|
Fast, extensible progress bar for loops and CLI.
|
||||||
| 8 | colorama Terminal Rendering | 246,942,020 | 3,795 | Terminal Rendering CLI Development CLI & GUI | → | |
|
Cross-platform colored terminal text.
|
||||||
| 9 | alive-progress Terminal Rendering | 2,558,696 | 6,313 | Terminal Rendering CLI Development CLI & GUI | → | |
|
A new kind of Progress Bar, with real-time throughput, eta and very cool animations.
|
||||||
TUI Frameworks 3 projects |
||||||
| 10 | textual TUI Frameworks | 55,207,626 | 37,390 | TUI Frameworks CLI Development CLI & GUI | → | |
|
A framework for building interactive user interfaces that run in the terminal and the browser.
|
||||||
| 11 | urwid TUI Frameworks | 6,651,927 | 3,020 | TUI Frameworks CLI Development CLI & GUI | → | |
|
A library for creating terminal GUI applications with strong support for widgets, events, rich colors, etc.
|
||||||
| 12 | asciimatics TUI Frameworks | 92,000 | 4,303 | TUI Frameworks CLI Development CLI & GUI | → | |
|
A package to create full-screen text UIs (from interactive forms to ASCII animations).
|
||||||
No projects match your search or filter.
Try a broader term, or .
CLI Development guide
argparse is in the standard library. Python's docs call it the recommended choice when you have no more specific needs, since it gives you the most out of the box for the least code. It writes the help and usage messages and reports invalid arguments for you. For commands written as decorated functions, the same docs point to Click, and for a CLI that works with static type checking, to Typer.
Click builds a CLI from commands declared with decorators. You can nest them to any depth, and Click can load subcommands lazily at runtime. It also reads option values from environment variables and comes with helpers for ANSI colors, terminal size, and launching editors.
Typer builds a CLI from your function signatures: you declare each argument and option once, as a type-hinted function parameter. Write those hints with Annotated, which its tutorial recommends wherever possible. Its docs say you get the best results by pairing it with Rich: Typer structures the commands and options, and Rich displays the output.
prompt_toolkit is for interactive input. It can replace GNU readline or build full-screen apps. For a REPL, use a PromptSession, which keeps the history for the whole session.
Python Fire turns any Python object into a CLI: call fire.Fire() at the end of your program. Its README pitches it for developing and debugging your code, exploring existing code, and turning other people's code into a CLI. It takes each argument's type from the value you pass, not from the function signature.
tqdm adds a progress bar to any loop: wrap the iterable in tqdm(). Import it from tqdm.auto, which picks the console bar or the Jupyter widget for you. alive-progress wraps the loop in an alive_bar context manager instead, with a spinner that speeds up and slows down with your throughput.
Rich writes colored text, tables, Markdown, and syntax-highlighted code to the terminal. Start with its drop-in print, then create one Console at module level for the rest of your app. For colored logs, send the logging module's output through RichHandler.
colorama makes ANSI escape codes work on Windows and does nothing on other platforms. If that's all you need, call just_fix_windows_console().
Textual apps run in the terminal, and the textual serve command from textual-dev serves them in a browser. Build one by subclassing App, and style its widgets with CSS.
Urwid is a console widget construction set rather than a finished UI library. It runs on your choice of event loop: asyncio, or another one you already use. It's licensed under the LGPL, while Textual and asciimatics use permissive licenses.
asciimatics does full-screen text UIs, from interactive forms to ASCII animations: create a Screen, build a Scene from Effect objects, and let the Screen play it.
Ship your CLI as an installable package with a [project.scripts] entry point, not a file users run with python. Click recommends it, and shell completion in Click and Typer works through that entry point. Test your commands in-process: Click and Typer both provide a CliRunner, and Textual's run_test() drives your app as if you were using the keyboard and mouse.
Contribute
Know a project that belongs here?
Tell us what it does and why it stands out.