rich-gradient-cli is a CLI for rich-gradient. The tool allows you to create colorful gradients in your terminal output, making it easier to visualize data or simply add some flair to your command-line applications.
You can install rich-gradient-cli from PyPI
uv add rich-gradient-clipip install rich-gradient-cliTo use the rich-gradient-cli, you can run the following command in your terminal:
gradient print --colors 'red,#ff9900,#ffff00' "This is gradient text that starts red, transitions through orange, and ends in yellow\!"Use gradient for the generic rich-gradient renderable, including highlight rules and animation:
gradient gradient --colors 'magenta,cyan' --highlight-word error='bold white on red' "Highlight error text"Inspect generated spectrum colors as a rich table, hex values, names, or CSV:
gradient spectrum --hues 7 --seed 42
gradient spectrum --hues 7 --output hexWrap common Rich renderables in gradients without writing Python:
gradient columns alpha beta gamma --colors 'red,blue'
gradient tree project src/app.py docs/index.md --colors 'lime,cyan'
gradient syntax pyproject.toml --lexer toml --line-numbers --colors 'yellow,magenta'
cat data.csv | gradient table - --colors 'cyan,magenta'You can also create gradient rules using the rule command:
gradient rule --colors 'blue,#00ff00,cyan' "Blue to Green to Cyan Rule"To create a gradient panel, you can use the panel command:
gradient panel --colors "red,#ff9999" -t "Error" --title-style "bold #ffffff" --title-align left 'This is an error message with a red to pink gradient background.'You can also render Markdown with gradients:
echo "# Hello\n\n- This is **bold**.\n- This is *italic*." | gradient markdown -Use view for rich-cli-style file rendering. It auto-detects Markdown, JSON, CSV/TSV, and syntax-highlighted source files; it also accepts - for stdin and http:// or https:// URLs.
gradient view README.md
gradient view pyproject.toml --lexer toml --line-numbers --guides
cat data.json | gradient view - --json --force-terminal
gradient view README.md --export-html readme.htmlBuild and preview the documentation locally with MkDocs:
uv pip install -e ".[docs]"
mkdocs serve