Skip to main content

Highlight text within input.

Project description

Highlight CLI

@readwithai - X - blog - machine-aided reading - 📖⚡️🖋️

Highlight strings within streams of text.

Motivation

It can be useful to highlight text in output to make it easier to find. There are tools that can do this like grep and supercat but these aren't trivial to use. I wanted a tool that is trivial to use and install on machines.

Alternatives and prior work

It is surprising that there aren't tool that do this. Some tools come close:

  • xpo provides similar functionality but I could not install it
  • hhighligher does this - but it is written in shell and I did not find it easyer to install.
  • grep supports highlighting. The settings for coloring is complete but difficult to understand and additional regular expressions need to be added to match all lines.

Installation

You can install hlcli using pipx:

pipx install hlcli

Usage

Highlight the sring one

echo "hello one three\ntwo\nthree\nfour\nfive\nsix" | hlcli 'one'

Match various expressions with different colors:

echo "hello one three\ntwo\nthree\nfour\nfive\nsix" | hlcli one --green two --yellow three four --red six

Here we highlight one in red (the default color), two in green, three and four in yellow and six in red

About me

I am @readwithai. I create tools for reading, research and agency sometimes using the markdown editor Obsidian.

I also create a stream of tools that are related to carrying out my work.

I write about lots of things - including tools like this - on X. My blog is more about reading and research and agency.

@readwithai logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

highlight-cli-1.1.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file highlight-cli-1.1.0.tar.gz.

File metadata

  • Download URL: highlight-cli-1.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for highlight-cli-1.1.0.tar.gz
Algorithm Hash digest
SHA256 68bbfed9532a85574898931971c9134dd28930eb3d94a966e543d94d7d97558c
MD5 4cf5e589503934584214613b6fd75281
BLAKE2b-256 7340edf26caa48e8a57f14f1a23d2d7669bce95cd2fe8564fb76d8306806dcc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page