Skip to content
KwisatzJimPublic

About

A colorized `cat`, written in Rust — inspired by [ccat](https://github.com/owenthereal/ccat)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rustycat (rcat)

A colorized cat, written in Rust — inspired by ccat.

Prints file contents (or stdin) to your terminal with syntax highlighting, auto-detected from the file extension, using syntect (the same highlighting engine that powers bat and Sublime Text).

Screenshot 2026-07-19 at 2 45 50 PM

Install

Download a binary

Download the archive for your computer from the project's GitHub Releases page. Builds are provided for Linux (x86_64 and ARM64), macOS (Apple Silicon and Intel), and Windows (x86_64). Each release includes a SHA256SUMS file for verifying the downloads.

Extract the archive, then move rcat (rcat.exe on Windows) somewhere listed in your system's PATH.

Install from source

Rustycat requires Rust 1.85 or newer. Install Rust through rustup, then run:

cargo install --git https://github.com/KwisatzJim/rustycat

This installs the rcat command in Cargo's binary directory (normally ~/.cargo/bin).

Build locally

git clone https://github.com/KwisatzJim/rustycat.git
cd rustycat
cargo build --release --locked

The binary is produced at target/release/rcat (rcat.exe on Windows).

Usage

rcat [OPTIONS] [FILES]...

Examples:

rcat main.rs                  # highlight a single file
rcat -n main.rs                # ...with line numbers
rcat main.rs Cargo.toml        # multiple files, each with a ==> filename <== header
cat notes.txt | rcat first.txt - last.txt  # read stdin at `-` between files
cat main.rs | rcat -l rust     # highlight stdin, forcing the "rust" language
rcat -p file.txt                # plain mode, behaves like regular cat
rcat --paging=never large.log   # disable automatic paging
rcat --list-themes              # show available color themes
rcat --list-languages           # show all supported languages/syntaxes
rcat -t "Solarized (dark)" main.rs   # pick a specific theme

Options

Flag Description
-n, --number Number all output lines
-l, --language <LANG> Force a specific language instead of auto-detecting from extension
-t, --theme <THEME> Color theme (default: base16-ocean.dark)
-p, --plain Disable colorization entirely (plain cat behavior)
-f, --force-color Colorize even when stdout isn't a terminal (e.g. when piping to less -R)
--color <WHEN> Choose auto, always, or never
--paging <WHEN> Choose auto, always, or never (default: auto)
--preview Render input as a formatted Markdown preview
--interactive View one Markdown file; press Tab to toggle source/preview
--list-themes List available themes and exit
--list-languages List supported languages and exit

By default, color is automatically disabled when output is piped/redirected (not a TTY) and re-enabled when writing to a real terminal — same convention as tools like ls --color=auto. Automatic mode also disables color when the NO_COLOR environment variable is set or TERM=dumb.

Automatic paging

Try rcat --preview README.md to preview Markdown headings, lists, tables, and code blocks in the terminal. Preview uses the same automatic paging as ordinary output and can also read Markdown from stdin. It cannot be combined with --plain, --number, or --language. This is a terminal preview; images and browser-specific Markdown features are not rendered. Ordinary rcat README.md still displays the source.

Use rcat README.md in a terminal for a keyboard-controlled viewer. Press Tab to switch between source (without syntax coloring) and preview, arrow keys or Page Up/Page Down to scroll, and q to exit. Each view remembers its scroll position. Add --preview to start in preview mode. Interactive mode requires one .md or .markdown file and a terminal; it uses its own viewer rather than less. --paging=never bypasses the automatic viewer. Piped or redirected output, multiple files, and --plain, --number, or --language retain their ordinary output behavior. --interactive remains available to explicitly request the viewer.

When output is going to an interactive terminal, Rustycat automatically sends it through less -RFX. Short output exits the pager immediately, while output larger than one screen remains scrollable. Piped or redirected output never starts a pager automatically. Use --paging=always to force paging or --paging=never to disable it. If less is unavailable, automatic mode safely falls back to direct output.

Integration with other tools

Disable paging when continuously monitoring a file. Specify the syntax when stdin does not provide a filename; this example assumes one JSON object per line:

tail -f application.jsonl | rcat --paging=never --color=always -l json

Combine Rustycat with git show to view an older version of a file with the correct syntax highlighting:

git show v0.1.0:src/main.rs | rcat -l rs

Rustycat can also serve as man's pager. The bundled syntax set does not have a specialized man-page grammar, but this preserves the formatted page and forces terminal color:

export MANPAGER='rcat --color=always -l "Plain Text"'
man 2 select

Notes

The checked-in Cargo.lock pins exact dependency versions so local and release builds use the same dependency set.

About

A colorized `cat`, written in Rust — inspired by [ccat](https://github.com/owenthereal/ccat)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages