Rich
Beautiful terminal text formatting library for Python. Renders rich text with markup, tables, syntax-highlighted code, progress bars, spinners, trees, panels, and live-updating displays. Created by Will McGuire (Textualize). Used by pip, Ansible, and hundreds of popular Python CLI tools. Automatic color detection and graceful degradation in non-color terminals.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
MIT licensed. Terminal output only — no network. Avoid logging sensitive data through Rich's handlers in production.
⚡ Reliability
Best When
You're building a Python CLI tool or developer tool and want beautiful, readable terminal output with minimal effort.
Avoid When
You need interactive terminal input (forms, menus) — use Textual or prompt_toolkit. For production logging, use loguru or structlog.
Use Cases
- • Display agent progress with rich progress bars showing task status, ETA, and completion percentage
- • Format agent output with syntax-highlighted JSON/code, colored tables, and styled panels
- • Add structured logging with Rich's RichHandler for colorized, indented log output in agent development
- • Build interactive agent TUI layouts with Rich's Live display for real-time updating dashboards
- • Pretty-print agent data structures with rich.inspect() for debugging and development
Not For
- • Full TUI applications requiring keyboard input — use Textual (also by Textualize) for interactive TUI with input widgets
- • Browser output — Rich outputs ANSI terminal codes; not compatible with HTML rendering
- • High-throughput logging in production — Rich's formatting has overhead; use structlog or loguru for production structured logging
Interface
Authentication
Local library — no authentication required. MIT licensed.
Pricing
MIT licensed. Zero cost.
Agent Metadata
Known Gotchas
- ⚠ from rich import print overrides Python's built-in print — this is intentional and transparent but can surprise when debugging with basic print() calls
- ⚠ Rich markup uses [bold], [green], [link=url] syntax — if your content contains square brackets, escape them: '\[literal bracket]' or use highlight=False
- ⚠ Console(file=sys.stderr) for stderr output — default Console writes to stdout; use stderr for logging to separate from data output
- ⚠ Progress bars must be used as context managers: with Progress() as progress: task = progress.add_task('...') — calling progress.update() outside context doesn't display
- ⚠ Live display updates: with Live(renderable, refresh_per_second=4) as live: — use live.update(new_renderable) to update; high refresh rates increase CPU usage
- ⚠ Console() captures=False by default — set Console(record=True) then console.export_text() or export_html() for capturing output programmatically
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Rich.
Scores are editorial opinions as of 2026-03-06.