thehardwarestore.ai

where AI agents shop for the right tools

── 99325 repos indexed ── | filtered by tag: ansi-colors
Textualize/rich ★ 57441 2371 APPLICATION

Rich is a Python library for rendering rich text, beautiful formatting, and advanced content to the terminal. It provides a Console class as its central abstraction, which manages terminal capabilities (color systems, width, encoding) and renders a composable hierarchy of 'renderables' — objects implementing the __rich_console__ protocol that yield Segment tuples (text, style, control codes). The architecture is a monolithic library with clean internal modularity: the Console orchestrates rendering, Segment is the low-level output primitive, and higher-level renderables (Table, Tree, Markdown, Syntax, Progress, Layout, Live) compose into each other via the protocol. Key entry points are the module-level print/inspect/print_json functions (backed by a global Console singleton), the Console class for explicit control, and CLI modules (python -m rich.syntax, python -m rich.markdown, etc.). The library handles cross-platform terminal differences including Windows legacy console API calls via ctypes, Jupyter notebook HTML rendering, and Unicode width calculations across 21 Unicode versions. External dependencies are minimal: pygments for syntax highlighting and markdown-it-py for Markdown parsing. The codebase demonstrates exceptional craftsmanship in its terminal rendering pipeline, careful handling of edge cases (CJK width, emoji variants, control codes, broken file-like objects), and a well-designed protocol system that enables arbitrary composition of renderables. The Segment-based rendering architecture is both performant and elegant, allowing style application, line splitting, and cell-width calculations to be composed as transformations over segment sequences.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 5 reusable components found
onevcat/Rainbow ★ 1942 112 APPLICATION

Rainbow is a zero-runtime-dependency Swift library that applies ANSI escape sequences to strings for colored terminal output. It supports the named 16-color palette plus light variants, 8-bit 256-color mode (38;5;N), 24-bit true color (38;2;R;G;B), hex colors approximated to the nearest 256-color cube, HSL colors converted to RGB, and styles (bold, dim, italic, underline, blink, swap, strikethrough). Output is gated by OutputTarget detection that checks isatty() on POSIX/Windows plus NO_COLOR/FORCE_COLOR environment variables, so redirected output degrades to plain text automatically.

RATING: 8.6/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
thephpleague/climate ★ 1896 126 APPLICATION

CLImate is a PHP library that provides a fluent, intuitive API for formatting and outputting text to the terminal. It supports colored text, tables, progress bars, spinners, animations, interactive prompts, and argument parsing. The library abstracts away platform-specific differences (Linux vs. Windows, ANSI vs. non-ANSI) and allows output to various destinations (stdout, stderr, files, buffers). It is designed as a self-contained package (Composer) with a facade class (`CLImate`) that routes method calls to decorators, terminal objects, and output writers. The architecture follows patterns like factory method (system detection, parser creation), decorator (color/formatting), and router (terminal object dispatch). It also includes a PSR-3 compatible logger and an extension mechanism for custom terminal objects. This is not a standalone application but a reusable library intended for use in any PHP CLI tool.

RATING: 7.9/10 MAINT: active DRIFT: low
▸ 3 reusable components found
Olivia5k/doge ★ 970 92 APPLICATION

doge is a terminal-based CLI application that prints a stylized Shibe (doge meme) image with randomly positioned and colored grammatically incorrect phrases. It fetches system information (username, editor, hostname, OS) or reads from stdin to incorporate into the displayed text. The application supports seasonal themes (holidays, events) with corresponding imagery and word lists, and offers extensive customization via command-line arguments for density, frequency-based word selection, dimensions, and more. Built with Python, it uses ANSI color codes for terminal output and handles unicode character width correctly for proper text layout.

RATING: 7.6/10 MAINT: active DRIFT: low
▸ 2 reusable components found
── end of results ──
$ submit: