Install & Compatibility
Where this runs
tested against v0.19.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.5MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 1.9s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
cli_ui
✓ import cli_ui
✗ import ui
This quickstart demonstrates common usage patterns for `cli-ui`, including printing colored messages, showing progress, and gathering user input through yes/no questions and choice selections.
import ui
# Informative messages
ui.info("This is", ui.green, "green", ui.reset, "text.")
ui.info_2("Starting", "Process X...")
# Progress indication
list_of_items = [f"Item {i}" for i in range(1, 6)]
for i, item in enumerate(list_of_items):
ui.info_count(i, len(list_of_items), f"Processing {item}")
# User input
with_confirmation = ui.ask_yes_no("Proceed with action?", default=True)
if with_confirmation:
fruits = ["apple", "orange", "banana"]
selected_fruit = ui.ask_choice("Choose a fruit", choices=fruits)
ui.info(f"You selected: {selected_fruit}")
else:
ui.info("Action cancelled.")
Debug
Known issues
gotchaWhen redirecting output (e.g., to a file or pipe), `cli-ui`'s colorization might still emit ANSI escape codes. This can lead to unreadable output in non-terminal environments if not handled. The library's `color` configuration can be set to 'never' to prevent this.fixConfigure color output using `ui.setup(color='never')` or ensure output is directed to a TTY.
affects: All versions
gotchaThe `cli-ui` library offers `verbose` and `quiet` configuration options. Misunderstanding their precise behavior can lead to unexpected suppression or display of messages. `quiet` typically hides all but warnings, errors, and fatal messages, while `verbose` enables debug messages.fixConsult the official documentation for `ui.setup()` to understand the exact behavior of `verbose` and `quiet` parameters and tailor them to your needs.
affects: All versions
gotchaThere are other projects with similar names, such as the JavaScript `cliui` (yargs/cliui) and `cli2gui`. Ensure you are referring to the correct Python `cli-ui` library to avoid confusion regarding features, installation, and breaking changes.
Upgrade
Version history
0.19.0latest on PyPI · released Mar 29, 2025
Audit
Dependencies
No dependency data recorded yet.