View source code in your terminal with colors and line numbers instead of plain text.
Preview files in fzf fuzzy finder with syntax highlighting for faster navigation.
See which lines changed in a file since the last Git commit while reading it.
Display man pages and help text with syntax highlighting for better readability.
bat is a command-line tool for displaying the contents of files in your terminal, serving as an enhanced replacement for the standard Unix cat command. The core problem it solves is that reading source code or configuration files in a terminal with the default cat command is tedious: there is no color, no line numbers, and no way to tell at a glance what changed in a file. bat adds syntax highlighting for a large number of programming and markup languages, line numbers, and Git integration that shows which lines have been modified, added, or deleted since the last commit, all displayed in a scrollable pager so long files don't flood your screen. The tool is designed as a drop-in replacement for cat, meaning you use it the same way. When bat detects that its output is being piped to another command or to a file rather than displayed in a terminal, it automatically removes the decorative formatting and behaves exactly like plain cat, so it works correctly in scripts without any adjustment. Beyond standalone use, bat integrates well with other command-line tools: it can serve as the preview window in fzf, a fuzzy file finder; it can colorize the output of ripgrep search results; it can display man pages with syntax highlighting; and it can colorize help text from other commands. bat supports both reading from files and from standard input, and it can highlight specific programming languages you specify manually. The project is written in Rust, which gives it fast startup time and good performance even on large files. You would use bat whenever you are frequently reading code, config files, or logs in a terminal and want readable, color-coded output with contextual Git information, without leaving the command line.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.