litcat

Crates.iolitcat
lib.rslitcat
version0.1.4
created_at2025-07-17 21:05:25.497355+00
updated_at2025-08-15 08:46:42.136382+00
descriptionA CLI tool for viewing patches with colors
homepagehttps://github.com/shan-shaji/litcat
repository
max_upload_size
id1758120
size13,132
Shan Shaji (shan-shaji)

documentation

README

litcat

litcat is a simple Rust CLI tool for viewing patch and diff files with highlighting. It colors added (+), removed (-), and context lines to make git diffs easier to read in your terminal.

Features

  • Colors added lines in green

  • Colors removed lines in red

  • Colors diff headers and hunk markers

  • Reads from a file or standard input (pipe)

Usage

From a patch file

litcat xxx.patch

Accepting stdin

cat diff.patch | litcat

Example Output

  • Lines starting with + (but not +++) are green

  • Lines starting with - (but not ---) are red

  • Diff headers (+++, ---) are cyan

  • Hunk markers (@@ ... @@) are yellow

  • All other lines are default color

Installation

1. Build from Source

  1. Clone the repo:
    git clone https://github.com/shan-shaji/litcat.git
    cd litcat
    
  2. Build:
    cargo build --release
    
  3. Copy the build to ~/.cargo/bin.
  4. Run as shown above.

2. Install from crates.io

you can install directly using cargo:

cargo install litcat

Dependencies

  • clap for CLI argument parsing

  • colored for colored terminal output

Commit count: 0

cargo fmt