← All open source projects

bat

sharkdp/bat

bat is a command-line cat replacement with syntax highlighting, Git integration, and readable file output.

Forks 1,576
Author sharkdp
Language Rust
License Apache-2.0
Synced 2026-06-27

What it is

bat is a command-line file viewer often described as `cat` with wings. It adds syntax highlighting, line numbers, Git integration, non-printable character display, and automatic paging.

It helps because file viewing in the terminal is constant: configs, code, search results, and diffs become easier to read.

How it is used

bat can be called directly or combined with tools such as `ripgrep`, `fzf`, `git diff`, `tail`, and `find`.

Git integration is useful because changed lines can be visible while reading a file.

Search result viewing

This example combines `rg` and `bat`: search first, then open the file with highlighting and line numbers.

Language: Bash
rg -n "OpenSourceProject" app resources
bat --style=numbers,changes app/Modules/OpenSource/Models/OpenSourceProject.php

What is inside

The repository contains Rust code, documentation, highlighting themes, installation instructions, and many integration examples.

bat is a good example of a small tool that improves one daily operation without changing the whole workflow.

Practical context

bat usually works best as part of a chain: `rg` searches, `bat` displays, and `fzf` selects. The terminal becomes easier without opening a heavy IDE for every file view.

Strengths and limits

The main strength is immediate usefulness. Even without configuration, bat makes terminal code reading better.

The limit is scope. It is a viewer, not an editor or static analysis tool.