About this project
bat is a command‑line utility that mimics the behavior of cat while adding syntax highlighting for a wide range of programming and markup languages. It automatically detects the language from file content or shebang, but also allows manual language selection with the -l flag. bat integrates with Git to display modifications in the sidebar, can show non‑printable characters via -A/--show-all, and pages output through less (or a configurable pager) when the content exceeds the terminal height. When used in non‑interactive contexts such as pipes or redirects, bat falls back to plain cat behavior, making it safe to use in scripts. Additional features include line numbers, file headers, grid lines, and configurable themes. bat can be employed as a previewer for fzf, a helper for ripgrep via batgrep, a man page viewer when MANPAGER is set, and a tool for colorizing help messages. Installation is available through package managers on Linux, macOS, and Windows, as well as via Homebrew, Scoop, Chocolatey, WinGet, and from source with Rust. Customization is supported through themes, syntax mappings, style options, and a configuration file.