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 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.8

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.8
File Size Uploaded Provenance Actions
rich_gradient_cli-0.4.8.tar.gz 26.5 kB Without provenance Details for rich_gradient_cli-0.4.8.tar.gz

Built distribution (wheel)

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

Total release size: 51.7 kB

Release files / rich_gradient_cli-0.4.8.tar.gz

Download URL rich_gradient_cli-0.4.8.tar.gz
Size 26.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4eff7f454c03fbf98e4dc19142305ba99e744229fc6683ab3c09e14e521bd0a5
BLAKE2b-256 checksum
How to use checksums
fef2c6f31814ba3e4fdce4dddd2912ffe9c54df89d7699daa99706484164a4f8
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.8-py3-none-any.whl

Download URL rich_gradient_cli-0.4.8-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa611659e49c8606aad92be3048bd2de6f8a8259041f02589c5e6631a2affd19
BLAKE2b-256 checksum
How to use checksums
74b995cfd9d0ac1c2bb119655d37000fc23de5fc413493323ad96b943ebb2b7d
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.8

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