ansi-escape-sequences-cli

Crates.ioansi-escape-sequences-cli
lib.rsansi-escape-sequences-cli
version0.2.2
created_at2021-05-02 13:19:56.943929+00
updated_at2025-05-19 13:07:42.042646+00
descriptionCLI tool for generating and applying ANSI escape sequences to colorize and style terminal output — ideal for scripts, prompts, and debugging.
homepagehttps://github.com/phip1611/ansi-escape-sequences-cli
repositoryhttps://github.com/phip1611/ansi-escape-sequences-cli
max_upload_size
id392193
size26,648
Philipp Schuster (phip1611)

documentation

https://docs.rs/ansi-escape-sequences-cli

README

'ansi' - a CLI utility to quickly get ANSI escape codes

ansi-escape-sequences-cli provides an executable called ansi which can be used in a shell or in a shell script to easily colorize and style terminal output.

Usage

  • Add ansi to your PATH
  • Embed it in your shell scripts like this:
    # You need "-e" to let echo replace the escaped ESC symbol
    echo -e "$(ansi yellow bold)WARNING$(ansi reset): There was a problem"
    # Or use echo without "-e":
    echo "$(ansi yellow bold --escape-style=direct)WARNING$(ansi reset): There was a problem"
    
  • Type --help for more guidance!

Install

$ cargo install ansi-escape-sequences-cli (the binary is just called ansi!)

Supported Platforms

  • ✔️ Linux
  • ✔️ MacOS
  • ✔️ Windows

MSRV

Ths MSRV is 1.85.1.

Commit count: 20

cargo fmt