Registry / testing / cli-ui

cli-ui

JSON →
library0.19.0pypypi✓ verified 88d ago

cli-ui is a Python library designed to help developers build aesthetically pleasing and user-friendly command-line interfaces. It provides tools for informative messages, error messages, progress indicators, formatting, and interactive user input (e.g., yes/no questions, choices). The current version is 0.19.0, and the project appears to be actively maintained, with recent updates and continued development on its GitHub repository.

pip install cli-ui
INSTALL
IMPORT
SIG · CLI-UI
C
cli-ui
testingpythonv0.19.0
Install
1.9s avg
Import
—
Disk
19MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
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
musl
py 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.5MB
glibc
py 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.
fix
Configure 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.
fix
Consult 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.

Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
cli-ui — pip install cli-ui · libregistry