Skip to main content

rich-gradient-cli

gradient prints text, files, URLs and stdin in your terminal with a color gradient. It is the command-line tool for rich-gradient and works like rich-cli: give it something to show and it picks how to render it.

gradient [OPTIONS] [PATH,TEXT,URL, or '-']
gradient --colors 'red,#ff9900,#ffff00,lime,cyan' -s bold 'Hello gradient'

text

Installation

rich-gradient-cli requires Python 3.11 or newer.

With uv:

uv tool install rich-gradient-cli

With pip:

pip install rich-gradient-cli

With Homebrew, trust the tap first (Homebrew won't load formulae from a third-party tap until you do):

brew tap maxludden/tap
brew trust maxludden/tap
brew install maxludden/tap/rich-gradient-cli

New releases reach the Homebrew tap about a day after PyPI.

Usage

Pass literal text, a file path, an http(s) URL, or - to read stdin:

gradient --colors 'red,#ff9900,#ffff00' "Gradient text that runs red, orange, yellow!"
gradient README.md                       # a file
gradient https://example.com/page.md     # a URL
cat notes.txt | gradient -               # stdin

What gets rendered

The file extension picks the renderable. A mode flag overrides it.

Input Rendered as Flag to force it
Literal text, stdin, .txt Gradient text (Rich markup is parsed) -p, --print
.md, .markdown Markdown -m, --markdown
.rst reStructuredText --rst
.ipynb Jupyter notebook --ipynb
.json Pretty-printed JSON -J, --json
.csv, .tsv Table --csv
Any other file Syntax-highlighted code --syntax

Some modes are only available as flags: --tree (a directory, or lines of text, as a tree), -u/--rule (a rule titled with the text), --columns, --spectrum (the color palette) and --inspect (a Python object).

Examples

gradient pyproject.toml -n -g                 # code with line numbers and indent guides
gradient data.csv --colors cyan,magenta       # CSV as a table
cat doc.rst | gradient - --rst                # reStructuredText from stdin
gradient "Title" --rule --colors blue,cyan    # a gradient rule
gradient "Heads up" --panel rounded --title Notice
gradient --tree src                           # a directory tree
gradient str --inspect                        # inspect a Python object
gradient --spectrum                           # show the full palette
gradient README.md --export-svg readme.svg    # also save as SVG (or -o file.html)

Options at a glance

Options shared with rich-cli keep the same spelling, and gradient options are long-only. Note that -h means --head, so use --help for help.

Group Options
Gradient --colors, --bgcolors, --rainbow, --hues, --repeat-scale, --highlight-word, --highlight-regex, --animate, --duration
Layout -l/-c/-r align the block, -L/-C/-R/-F justify text, -w/-W width, -e expand, -d padding, -a BOX panel, -S panel style, --border-only, --title, --caption
Content -s style, --no-markup, -j emoji, -y hyperlinks, -h/-t head/tail, -x lexer, --theme, -n line numbers, -g guides
Output -o/--export-html, --export-svg, --pager, --force-terminal, -v/--version

Run gradient --help for the full list, or read the options reference.

Upgrading from 0.3

Versions up to 0.3 used subcommands (gradient print, gradient panel, gradient view, ...). These are now flags on the single gradient command. The CHANGELOG maps each old subcommand to its new flag.

Telemetry

Anonymous usage telemetry is off by default. Use gradient --telemetry enable|disable|status to manage it. Events are sent only if telemetry is enabled and AMPLITUDE_API_KEY is set. Each event is a Command Run with the render mode and a random install ID, sent after a command succeeds.

Documentation

The full documentation is at maxludden.github.io/rich-gradient-cli.

To preview it locally with Zensical:

uv pip install -e ".[docs]"
zensical serve

Metadata

Release files for rich-gradient-cli 0.4.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rich-gradient-cli 0.4.9
File Size Uploaded Provenance Actions
rich_gradient_cli-0.4.9.tar.gz 26.6 kB Without provenance Details for rich_gradient_cli-0.4.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rich-gradient-cli 0.4.9
File Interpreter ABI Platform Actions
rich_gradient_cli-0.4.9-py3-none-any.whl Python 3 none any Details for rich_gradient_cli-0.4.9-py3-none-any.whl

Total release size: 51.8 kB

Release files / rich_gradient_cli-0.4.9.tar.gz

Download URL rich_gradient_cli-0.4.9.tar.gz
Size 26.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5344ddd91e4afafe6b2c67a25817b045bb258ee0847233dc8ad8caa87ee860bc
BLAKE2b-256 checksum
How to use checksums
1f032c826404a83fc9f99cb2284906b742ee5685501b2a085ac43152b79814c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / rich_gradient_cli-0.4.9-py3-none-any.whl

Download URL rich_gradient_cli-0.4.9-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
deea621738c3c000491b5221ffde88d37130f0eccf4e543d91ca2fba9f77f1be
BLAKE2b-256 checksum
How to use checksums
faf11f44c856d5e74bca70c48528220d4b1f292c8a6c9c5ab0a594ecda409e1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for rich-gradient-cli 0.4.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page