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:

brew install maxludden/tap/rich-gradient-cli

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 --hues 7                  # show the 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.4

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.4
File Size Uploaded Provenance Actions
rich_gradient_cli-0.4.4.tar.gz 22.3 kB Without provenance Details for rich_gradient_cli-0.4.4.tar.gz

Built distribution (wheel)

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

Total release size: 47.6 kB

Release files / rich_gradient_cli-0.4.4.tar.gz

Download URL rich_gradient_cli-0.4.4.tar.gz
Size 22.3 kB
Tags Source
SHA-256 checksum
How to use checksums
96c57fbd300bbadf59e2b1843bed028535e4ea421f032f2fd9252b7afbe8a09f
BLAKE2b-256 checksum
How to use checksums
4b3cab471292d79692d51897b14973c99594f7ff51b3f8d434e2abe6afba77b3
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.4-py3-none-any.whl

Download URL rich_gradient_cli-0.4.4-py3-none-any.whl
Size 25.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5adf7d592416df3558163ffcb885caaf88fa4ff4f20e9f50a3442d474c571f5
BLAKE2b-256 checksum
How to use checksums
23ea489271c6343d01edf3c829ad8c52ad43512f9a71ab40e4463ac44ffe8ebf
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.4

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