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 '-']
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 # 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.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rich_gradient_cli-0.4.6.tar.gz | 22.4 kB | Without provenance | Details for rich_gradient_cli-0.4.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rich_gradient_cli-0.4.6-py3-none-any.whl | Python 3 | none | any | Details for rich_gradient_cli-0.4.6-py3-none-any.whl |
Total release size: 47.9 kB
Release files / rich_gradient_cli-0.4.6.tar.gz
| Download URL | rich_gradient_cli-0.4.6.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3ecb1ab942da7fe70be74509d3ef88565c3410a177238de298615151435fe295
|
|
BLAKE2b-256 checksum How to use checksums |
0ddca677b2ef1c614ee80233e78b202ab16f6b8dbb2e6ebec8d23b4ac8505ab2
|
| 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.6-py3-none-any.whl
| Download URL | rich_gradient_cli-0.4.6-py3-none-any.whl |
|---|---|
| Size | 25.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43d6fea4546ffd6fa9f5816dbf6a8a85abc38f97ff77ac1a59a4adcfd1f567d3
|
|
BLAKE2b-256 checksum How to use checksums |
60933346a09def1b7f5970dee77c36473b5bf2ef909e2164b662ce103ecc1289
|
| 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.6
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.