What is bat?
bat displays files with syntax highlighting and optional Git integration.
Homebrew installs bat as a formula: a package definition for command-line software and its dependencies. If Homebrew is not installed yet, follow the official installation guide before continuing.
Install and check the formula
Refresh Homebrew’s package definitions, then install bat. Use brew info to inspect the current package and its dependencies; the actual installed version can change over time.
brew update
brew install bat
brew info batTry it
Run the second command in a directory containing README.md to inspect that file.
bat --version
bat README.mdBefore you rely on it
Avoid printing credentials or private configuration into shared terminals and logs.
cat is a portable choice for scripts; bat is designed for more readable interactive output.
Update or remove it
Run brew outdated to see if a newer version is available, and brew upgrade bat to upgrade this formula. Before removing it, preview the changes; other packages may depend on it.
brew outdated
brew upgrade bat
brew uninstall --dry-run bat