https://github.com/shan-shaji/litcat
Simple Rust CLI tool for viewing patch and diff files with highlighting.
https://github.com/shan-shaji/litcat
cat developer-tools development git-email git-patch linux patch rust
Last synced: 2 months ago
JSON representation
Simple Rust CLI tool for viewing patch and diff files with highlighting.
- Host: GitHub
- URL: https://github.com/shan-shaji/litcat
- Owner: shan-shaji
- License: bsd-3-clause
- Created: 2025-07-11T20:47:16.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-07-22T19:42:03.000Z (8 months ago)
- Last Synced: 2025-07-22T21:20:59.253Z (8 months ago)
- Topics: cat, developer-tools, development, git-email, git-patch, linux, patch, rust
- Language: Rust
- Homepage: https://crates.io/crates/litcat
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```sh
litcat xxx.patch
```
### Accepting stdin
```sh
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:
```sh
git clone https://github.com/shan-shaji/litcat.git
cd litcat
```
2. Build:
```sh
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:
```sh
cargo install litcat
```
## Dependencies
- [clap](https://crates.io/crates/clap) for CLI argument parsing
- [colored](https://crates.io/crates/colored) for colored terminal output