canido.dev
Projects/sharkdp / bat

bat

A cat clone with syntax highlighting and Git integration

Get it on GitHub
Unclaimed

Built by @sharkdp on GitHub. This page was written by @iluxav from public sources, last updated for v0.26.1 (2025-12-02), and may lag behind new releases.

Maintain bat? Claim it
v0.26.1 / 2025-12-029 things you can do8 changes to know before upgradingFollow (Atom feed)

Print files in the terminal with syntax highlighting, line numbers and Git change markers, paged automatically, and plain like cat when piped.

What you can do with it

Print files in the terminal with syntax highlighting for a large number of languages.

Present at v0.18.3

See which lines were added, removed or modified relative to the Git index, in the left margin.

Good to know

Needs the file to be inside a Git repository.

Present at v0.18.3

Show and highlight non-printable characters such as tabs, spaces and line endings with `-A`/`--show-all`.

Present at v0.18.3

Page long output through a pager automatically, and print plain contents like `cat` when output is piped.

Good to know

Uses an external pager such as less.

Present at v0.18.3

Print only selected line ranges of a file with `--line-range`.

Present at v0.18.3

Choose a color theme and which decorations (line numbers, Git changes, header, grid) to show.

Present at v0.18.3

Set default options in a configuration file instead of on every command line.

Present at v0.18.3

Collapse runs of empty lines with `-s`/`--squeeze-blank`, optionally keeping up to N with `--squeeze-limit`.

Since v0.25.0

Print shell completions for your shell with `bat --completion <shell>`.

Since v0.25.0

Before you upgrade

Newest first
v0.26.02025-10-19

Error messages now go to stderr by default, and `-n` line numbers are printed when output is piped.

Behavior changed
Read the evidence
Show 5 older
v0.23.02023-03-25

Environment variables such as `BAT_THEME` now override the config file (command-line arguments still win); unset variables you do not want to take precedence.

Action requiredAffects: Users who set the same option in the environment and in the config file
Read the evidence
Release history 10
v0.26.12025-12-02

Read `bat --help` in the pager.

Details

`-h` and `--help` are paged; when piping in auto decorations mode, only line numbers asked for on the command line are applied, for `cat` compatibility.

v0.26.1.

Behavior changed: Page long output through a pager automatically, and…

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.26.02025-10-19

Page output without installing less, using bat's built-in pager.

Details

`--pager=builtin` uses a built-in pager; line ranges accept negative relative ranges (`-r :-10`) and context (`-r 30::5`); `--list-themes` pages. Errors go to stderr by default, and `-n` line numbers now print when output is piped.

v0.26.0; Windows ARM64 builds are new.

Improved: Page long output through a pager automatically, and…Improved: Print only selected line ranges of a file with `--l…Behavior changed: Page long output through a pager automatically, and…

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.25.02025-01-07

Get a light or dark theme picked automatically from your terminal's color scheme.

Details

The theme follows the terminal's light or dark scheme; `-s`/`--squeeze-blank` and `--squeeze-limit` collapse empty lines; `--strip-ansi` removes escape sequences from input; `--style=+numbers` adds or removes single style components; `--binary=as-text` prints binary content; `--completion <shell>` prints shell completions.

Also: The terminal title shows the file names while paging.

v0.25.0; building from source needs Rust 1.74.

Improved: Choose a color theme and which decorations (line nu…Added: Collapse runs of empty lines with `-s`/`--squeeze-b…Improved: Show and highlight non-printable characters such as…Added: Print shell completions for your shell with `bat --…Action required

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.24.02023-10-11

Control paging from the environment with `BAT_PAGING`.

Details

New `BAT_PAGING` environment variable; `--map-syntax` matches case-insensitively by default; optional `LESSOPEN`/`LESSCLOSE` support when built with `--features lessopen`.

v0.24.0; building from source needs Rust 1.70.

Improved: Page long output through a pager automatically, and…Behavior changed: Print files in the terminal with syntax highlightin…Action required

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.23.02023-03-25

Show non-printable characters in caret notation such as `^I`.

Details

`--nonprintable-notation=caret`; `-S`/`--chop-long-lines` as aliases for `--wrap=never`. Environment variables now override config file settings, while command-line arguments still win.

v0.23.0; building from source needs Rust 1.62.

Improved: Show and highlight non-printable characters such as…Action required: Set default options in a configuration file instead…Action required

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.22.12022-09-10

Keep shared settings in a system-wide config file and personal ones in your own.

Details

bat reads a system config file and a user config file. On macOS the default theme follows Dark Mode. Groups v0.22.0 and v0.22.1.

v0.22.1.

Improved: Set default options in a configuration file instead…Behavior changed: Choose a color theme and which decorations (line nu…

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.21.02022-05-12

Get a less cluttered default output without configuring styles.

Details

`--style=default` is added and is now the default, less verbose than `full`. File extensions match case-insensitively; lines over 16,384 characters are not highlighted; startup is faster through lazy-loaded syntaxes.

Also: BusyBox less works as a pager.

v0.21.0.

Behavior changed: Choose a color theme and which decorations (line nu…Behavior changed: Print files in the terminal with syntax highlightin…

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.20.02022-02-27

Show the size of the file in the header.

Details

New style component `header-filesize`; line highlighting uses an underline with the ANSI theme.

v0.20.0.

Improved: Choose a color theme and which decorations (line nu…

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.19.02022-01-08

Show a window around a line with relative ranges such as `20:+10`.

Details

Line ranges accept `x:+delta` and `x:-delta`; `--ignored-suffix` ignores backup suffixes for syntax detection; `$BAT_CONFIG_DIR` sets the config directory. Startup is faster in loop-through mode.

Also: `--acknowledgements` credits theme and syntax authors; the requirements.txt syntax was removed for licensing reasons.

v0.19.0; building from source needs Rust 1.51.

Improved: Print only selected line ranges of a file with `--l…Improved: Set default options in a configuration file instead…Improved: Print files in the terminal with syntax highlightin…Action required

Seeded by @iluxav with Claude Code (canido)

Read the evidence
v0.18.32021-08-22
Starting point

Read files in the terminal with syntax highlighting and Git change markers.

Details

State before the covered window: `bat <file>` highlights many languages, marks Git changes in the margin, pages long output, and behaves like `cat` when piped; `--theme`, `--style`, `--line-range` and a configuration file control the output.

v0.18.3 and earlier; packaged by most distributions (as `batcat` on Debian/Ubuntu).

Added: Print files in the terminal with syntax highlightin…Added: See which lines were added, removed or modified rel…Added: Show and highlight non-printable characters such as…Added: Page long output through a pager automatically, and…Added: Print only selected line ranges of a file with `--l…Added: Choose a color theme and which decorations (line nu…Added: Set default options in a configuration file instead…

Seeded by @iluxav with Claude Code (canido)

Read the evidence