Skip to content
CAI
Software that uses CAICheck a score

sharkdp/bat

54.3

Adequate · 14 November 2026

11.5k

lines of production code

Rust

primary language

6

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add PowerShell completion support and update shell completions

Users on Windows can now use tab-completion for bat via a new PowerShell completion script (\_bat.ps1.in), which provides completions for options, themes, languages, and the cache subcommand. The Bash, Fish, and Zsh completion scripts have also been updated to include recently added CLI arguments (such as --unbuffered, --sanitize, --no-custom-assets, and --lessopen) and to fix various completion behaviors, including improved escaping in Bash and corrected language/theme listing in Zsh.

assets/completions · high confidence

Add new syntax highlighting themes and submodule-based theme sources

The theme asset directory now includes several new syntax highlighting themes: Catppuccin, Coldark, DarkNeon, Nord-sublime, TwoDark, 1337-Scheme, and a collection of Sublime Text-style themes (Dracula, GitHub, Gruvbox, OneHalf, Monokai Extended, Snazzy, Zenburn) which are integrated as git submodules. Additionally, new built-in theme files have been added: 'ansi' (replacing the previous ansi-light and ansi-dark themes) which uses 4-bit ANSI codes for base16 support, and 'base16-256' for terminals using 256-color base16 variants. These changes expand the available color schemes for syntax highlighting in the application.

assets/themes · high confidence

Added placeholder directories for macOS and Windows syntax mappings

Created empty .gitkeep files in the src/syntax\_mapping/builtins/macos and src/syntax\_mapping/builtins/windows directories. This establishes the directory structure for platform-specific syntax mapping configurations, allowing future additions of target-specific mapping rules without these directories being ignored by version control.

_src/syntax\_mapping/builtins/macos, src/syntax\mapping/builtins/windows · medium confidence

Automated asset generation and caching infrastructure

The assets directory now includes a new \create.sh\ script that automates the process of building the syntax and theme cache. This script initializes necessary git submodules, applies specific patches to upstream syntax definitions, and runs \bat cache --build\ to generate the final binary assets. It also introduces \.gitattributes\ to mark linguist-vendored files and \.ignore\ files to prevent the syntax and theme source directories from being tracked as regular content, streamlining the maintenance of syntax highlighting and color themes.

assets · high confidence

Expanded syntax highlighting support for Apache, AsciiDoc, Assembly, and CSV formats

This update adds comprehensive syntax highlighting definitions for several new and existing file formats. Apache configuration files (e.g., .htaccess, envvars) now receive detailed keyword and directive highlighting. AsciiDoc documents are supported with proper scoping for attributes, blocks, and inline elements. Assembly code for both ARM and x86\_64 architectures is now highlighted, covering registers, mnemonics, and preprocessor directives. Additionally, CSV files gain robust support for comma, pipe, semicolon, and tab separators, with specific scoping for different field types.

assets/syntaxes · high confidence

Initial repository structure and documentation

This change establishes the foundational structure of the project by adding the initial \CHANGELOG.md\ (documenting the v0.26.1 and v0.26.0 releases), \README.md\ (with installation and usage instructions), \CONTRIBUTING.md\, and license files (\LICENSE-MIT\, \LICENSE-APACHE\, \NOTICE\). It also introduces a comprehensive \.gitmodules\ file to manage external syntax and theme assets, a \flake.nix\ for Nix-based development environments, and configuration files like \.gitignore\ and \rustfmt.toml\.

(repo-wide) · high confidence

New --acknowledgements option to include third-party license texts

The build process now supports a new \--acknowledgements\ flag that generates a consolidated text file containing the project's NOTICE file and the full text of third-party licenses (MIT, BSD, Apache 2.0, and CC BY 4.0) found in the source directory. This allows users to easily distribute legal attribution information alongside the built assets.

_src/assets/build\assets · high confidence

New diagnostic script for bat configuration and environment

A new \info.sh\ script has been added to the diagnostics directory to help users troubleshoot issues by collecting and reporting on their system environment and bat configuration. The script detects the correct bat executable (handling both \bat\ and \batcat\ names), identifies custom syntaxes and themes, checks for wrapper scripts or shell functions/aliases, and gathers OS and shell version details. It presents a consent banner before running and outputs the collected data in a markdown-friendly format for easy inclusion in bug reports.

diagnostics · high confidence

Support for ignored-suffix CLI arguments and new default ignored suffixes

Users can now use the new \--ignored-suffix\ CLI argument to specify additional file name suffixes that should be stripped when determining syntax mappings. The default set of ignored suffixes has been expanded to include Debian/Ubuntu package manager backup files (\.dpkg-new\, \.dpkg-tmp\, \.dpkg-dist\, \.dpkg-old\, \.ucf-dist\, \.ucf-new\, \.ucf-old\) and Red Hat package manager backup files (\.rpmnew\, \.rpmorig\, \.rpmsave\), in addition to existing editor and build system backups. This ensures that syntax detection correctly identifies the underlying file type for these common backup variants.

_src/syntax\mapping · high confidence

Architecture

Major restructuring of the internal architecture and module organization

The application's internal codebase has been significantly refactored to improve modularity and maintainability. The monolithic structure has been split into distinct, focused modules: \assets.rs\ now handles syntax and theme loading (including lazy-loading for performance), \config.rs\ centralizes all configuration options, \controller.rs\ manages the high-level execution flow, \decorations.rs\ handles UI elements like line numbers and git markers, \diff.rs\ implements Git integration using the \gix\ library, \error.rs\ standardizes error handling with \thiserror\, \input.rs\ defines the input abstraction, and \less.rs\ manages pager version detection. This reorganization separates concerns, making the codebase easier to navigate and extend.

src · high confidence

bat binary is restructured into a modular src/bin/bat/ layout

The \bat\ executable source has been reorganized from a flat structure into a modular \src/bin/bat/\ directory, introducing dedicated modules for application logic (\app.rs\), CLI argument definition (\clap\_app.rs\), configuration file and environment variable handling (\config.rs\), system directory resolution (\directories.rs\), input abstraction (\input.rs\), and asset management (\assets.rs\). This change separates concerns such as config file generation, argument parsing, and cache directory resolution into their own files, improving maintainability and testability of the binary without altering the user-facing command-line interface.

src/bin · high confidence

Behavioural changes

Assets are now loaded lazily to improve startup time

The asset loading mechanism has been refactored to support lazy initialization. Themes are now stored in a \LazyThemeSet\ that deserializes individual themes on demand rather than loading the entire set at once, and syntax sets are handled via a \SerializedSyntaxSet\ enum that defers deserialization until needed. This change, combined with the new \AssetsMetadata\ structure for version compatibility checks, reduces the initial memory footprint and improves application startup performance.

src/assets · high confidence

Build script refactored into modules with shell completion generation

The build script has been reorganized into separate modules (\application\, \syntax\_mapping\, \util\) to improve maintainability. A new feature allows the build process to automatically generate man pages and shell completions (Bash, Fish, PowerShell, and Zsh) from templates, with the resulting file paths exposed to the compiler via environment variables. The syntax mapping logic has also been updated to support case-sensitive glob matching and brace expansion in matcher patterns.

build · high confidence

Expanded Linux configuration file syntax detection

The application now recognizes syntax for a broader range of Linux system and container configuration files. Users will see correct syntax highlighting for Podman quadlet files (including build, pod, and artifact types), Flatpak references, DNF and Pacman package manager configurations, Paru AUR helper settings, Kubernetes configs, and various systemd unit files. Additionally, container-related .conf files are now mapped to TOML syntax, and OS release files are detected as shell scripts.

_src/syntax\mapping/builtins/linux · high confidence

Expanded syntax detection for common configuration and data files

The syntax mapping system now recognizes a wider variety of file types, improving how they are displayed and highlighted. New mappings include JSON variants (JSON Lines, JSONC, JSON-LD, GeoJSON, ndjson, and VS Code workspaces) as JSON, .NET project files (including the new .slnx extension) as XML, and Bazel BUILD files as Python (Starling). Configuration files such as AWS credentials, GCloud CLI configs, SSH configs (including subdirectories), and Git config/ignore/attribute files are now correctly identified. Additional support covers Justfiles as Makefiles, Mill build files as Scala, CITATION.cff as YAML, nix flake.lock as JSON, SARIF files as JSON, Rusty Object Notation (.ron) as Rust, Nmap scripts as Lua, PAC files as JavaScript, and .mkd files as Markdown. The system also handles ambiguous extensions like .conf by defaulting to unknown, and maps ignore files to Git Ignore syntax.

_src/syntax\mapping/builtins/common · high confidence

Expanded syntax highlighting for Unix system files and configurations

This update adds specific syntax mappings for a variety of Unix-family system files and configuration formats, ensuring correct highlighting in the editor. Key additions include mappings for Apache and Nginx configuration files, Certbot renewal configurations, and Wireguard settings, all treated as INI or their respective syntaxes. Shell configuration files (such as .bashrc, .zshrc, .kshrc, and profile scripts) are now explicitly mapped to Bash or KornShell syntax. Additional mappings cover Ghostty terminal configurations, Fish shell history files, system logs like dmesg (Syslog), and mail spool files (Email).

_src/syntax\mapping/builtins/unix-family · high confidence

Syntax highlighting and theme patches for improved code and log readability

This update applies patches to syntax definitions and color themes to enhance code highlighting and visual clarity. New syntax support includes Rust code blocks in Markdown, Puppet syntax in Markdown, MediaWiki, Groff (with updated file extensions), and XAML files. Shell script detection is expanded to recognize shebangs for bun, uv, dash, ksh, tclsh, wish, and expect, while ebuild and eclass files are now highlighted using shell syntax. Several themes (1337, Monokai Extended, OneHalfDark, TwoDark) are patched to improve the appearance of JSON keys, Man page syntax, and error/warning lines, and specific syntax fixes address C\# tuple parsing, JavaDoc comment detection, and TodoTxt attribute scopes.

assets/patches · high confidence

Updated library usage examples to reflect new PrettyPrinter API

The examples in the \examples/\ directory have been rewritten to demonstrate the library's new builder-based API. Simple scripts like \simple.rs\ and \cat.rs\ now use the \PrettyPrinter\ fluent interface for configuration, while more complex scenarios such as \advanced.rs\ showcase features like syntax highlighting, custom themes, and paging modes. New examples like \inputs.rs\ and \yaml.rs\ illustrate how to handle multiple input sources and embedded data using the updated \Input\ API, and \list\_syntaxes\_and\_themes.rs\ provides a way to inspect available syntaxes and themes via the printer instance.

examples · high confidence

Updated manual page with new options and documentation fixes

The man page for bat has been updated to reflect recent command-line changes. It now documents the new --wrap mode (including word wrapping), the --nonprintable-notation option, and the --file-name flag. The --paging option documentation was corrected to use the proper --paging=never syntax instead of the previous --pager=never. Additionally, the manual now includes details on the --builtin pager option, clarifies that 'full' is the default style, and adds sections for custom languages and themes.

assets/manual · high confidence

Test coverage

1 commit adding/updating tests in tests/syntax-tests/highlighted/CUE, tests/syntax-tests/source/CUE; 2 commits adding/updating tests in tests/syntax-tests/source/PowerShell; Add Lean syntax highlighting test coverage; Add NAnt Build File syntax tests; Add Perl syntax test suite; Add Tcl syntax highlighting regression tests; Add Vue component syntax tests; Add syntax highlighting tests for Svelte files; Added AWK quicksort syntax test; Added ActionScript 3 syntax test coverage; Added Ada syntax test suite; Added Bash syntax highlighting tests; Added Batch syntax test and build script; Added C syntax highlighting test suite; Added C++ syntax highlighting test file; Added Common Lisp syntax highlighting test; Added Common Lisp syntax highlighting test files; Added Crystal syntax test file; Added Elm syntax regression test; Added Fortran Modern syntax tests for stdlib\_io savetxt and loadtxt; Added Fortran Namelist syntax test; Added GDScript syntax highlighting test file; Added Go syntax highlighting test; Added LLVM syntax highlighting regression tests; Added Lean syntax highlighting tests and license documentation; Added Literate Haskell syntax tests; Added Nix syntax test case; Added Protocol Buffer syntax tests for Vyconf; Added Puppet syntax tests for large exported classes and nodes; Added QML syntax tests for the Bat application UI; Added R syntax test suite; Added Rego syntax tests for Kubernetes procMount policy; Added Robot Framework syntax tests for AWS S3 recipe; Added Ruby syntax highlighting test for RepeatedSubstring class; Added SQL syntax highlighting tests; Added Salt State (SLS) syntax tests; Added Svelte syntax regression tests; Added Tcl syntax regression tests for shebang and core language features; Added Terraform syntax highlighting test case; Added TypeScript syntax test fixtures; Added Varlink certification syntax tests; Added Verilog syntax tests for pipelined division module; Added XAML syntax tests for ItemPage; Added XML syntax test fixtures for .NET project files; Added benchmark source files for syntax highlighting speed tests; Added benchmark suite for startup and syntax highlighting performance; Added plaintext syntax test fixtures and documentation; Added regression test for custom assets color behavior; Added regression tests for syntax detection edge cases; Added snapshot testing infrastructure for bat output; Added syntax highlighting regression test for Ruby Haml; Added syntax highlighting regression tests for Manpage format; Added syntax highlighting test cases for log files; Added syntax highlighting test file for hosts format; Added syntax highlighting test for AWK quicksort; Added syntax highlighting test for Batch build scripts; Added syntax highlighting test for Scala ConcurrentEffectLaws; Added syntax highlighting test for Syslog logs; Added syntax highlighting test for email headers; Added syntax highlighting test for fish history files; Added syntax highlighting tests for .NET XML-based project files; Added syntax highlighting tests for /etc/fstab; Added syntax highlighting tests for /etc/group files; Added syntax highlighting tests for ASP, AppleScript, Fish, Objective-C, Regular Expressions, Ruby on Rails, and Textile; Added syntax highlighting tests for Apache httpd.conf; Added syntax highlighting tests for CSV files; Added syntax highlighting tests for Cabal, Go, Python, XML, and Nim files; Added syntax highlighting tests for Debian sources.list files; Added syntax highlighting tests for Idris 2; Added syntax highlighting tests for JSON and NDJSON formats; Added syntax highlighting tests for MediaWiki markup; Added syntax highlighting tests for NSIS scripts; Added syntax highlighting tests for Ninja build files; Added syntax highlighting tests for Org mode; Added syntax highlighting tests for Solidity ERC721 contracts; Added syntax highlighting tests for Stylus gradients; Added syntax highlighting tests for TypeScript React components; Added syntax highlighting tests for bat command help output; Added syntax highlighting tests for complex Nginx configurations; Added syntax highlighting tests for ignored filename suffixes; Added syntax highlighting tests for the D programming language; Added syntax highlighting tests for the Diff file format; Added syntax highlighting tests for the Zig language; Added syntax regression and custom assets test suite; Added syntax regression tests for SSH Config highlighting; Added syntax test for Vyper crowdsale contract; Added syntax test for bat command help output; Added syntax test for email message parsing; Added syntax tests for /etc/passwd file highlighting; Added syntax tests for JSON and NDJSON formats; Added syntax tests for Java Server Pages (JSP); Added syntax tests for Jsonnet standard library documentation generation; Added syntax tests for Less files; Added syntax tests for Scala ConcurrentEffectLaws; Added syntax tests for Solidity ERC721 implementation; Added syntax tests for Strace output highlighting; Added syntax tests for dash shell script highlighting; Added syntax tests for the Odin programming language; Added syntax-highlighting tests for /proc/cpuinfo and /proc/meminfo; Added syslog syntax highlighting test fixture; Added test data for fish\_history syntax parsing; Added test fixtures for integration testing; Added test fixtures for startup-time benchmarking; Added test infrastructure and fixtures for CI and integration testing; Added test scripts for performance profiling and license compliance; Added test utilities for command execution and mocked pagers; Added x86-64 NASM syntax highlighting tests; Initial syntax regression tests for Rust paging logic; Snapshot testing infrastructure for visual regression; Updated SCSS syntax highlighting test suite; Updated SCSS syntax test with unlicensed example.

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 55 → 54 (-0.7)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.4) — scores are not directly comparable.

Lenses

  • Code Health 88 → 79 (-9.2)
  • Architecture 99 → 99 (-0.1)
  • Maturity 40 → 40 (+0.7)
  • Readiness 57 → 56 (-0.1)
  • Security 71 → 69 (-1.8)

Resolved (6)

  • End-of-life runtime: .NET net9.0 (tests/syntax-tests/source/XML/console.csproj)
  • Off-boarding risk: anonymized user #1
  • Orphaned file (src/controller.rs)
  • Orphaned file (src/pager.rs)
  • Orphaned file (src/syntax_mapping.rs)
  • Orphaned file (src/syntax_mapping/ignored_suffixes.rs)

New (8)

  • Edited copy of a member (46 corresponding lines) (src/vscreen.rs)
  • Hotspot: src/bin/bat/main.rs (src/bin/bat/main.rs)
  • Hotspot: src/printer.rs (src/printer.rs)
  • Medium advisory (unmaintained): RUSTSEC-2024-0320 (Cargo.lock)
  • Medium advisory (unsound): RUSTSEC-2026-0486 (Cargo.lock)
  • Off-boarding risk: anonymized user #1
  • Outdated: globset
  • Outdated: unicode-width

Changes since last survey

  • 71 commits — 45 feature/other, 26 fixes

By area

  • (repo) — 46 commits
  • (root) — 20 commits
  • src/syntax_mapping.rs — 2 commits
  • .github/workflows — 1 commit
  • src/bin — 1 commit
  • tests/integration_tests.rs — 1 commit

Notable commits

  • fix: Add changelog reference for emoji wrapping fix
  • fix: Merge branch 'master' into fix-highlight-line-color-never
  • fix: Merge branch 'master' into fix-map-syntax-glob-colon
  • fix: Merge branch 'master' into fix/cache-auto-build-4017
  • fix: Merge branch 'master' into fix/config-option-terminator
  • fix: Merge branch 'master' into fix/emoji-character-wrapping
  • fix: Merge branch 'master' into fix/no-color-error-prefix
  • fix: Merge branch 'master' into fix/wrapped-line-background-underflow
  • fix: Merge master after UTF-16 alignment fix
  • fix: Merge pull request #3801 from xfocus3/fix/help-language-submodule-note
  • fix: Merge pull request #4038 from mmustafasenoglu/fix/cache-auto-build-4017
  • fix: Merge pull request #4048 from qodelicious/fix/no-color-error-prefix
  • fix: Merge pull request #4098 from feafel/fix/wrapped-line-background-underflow
  • fix: Merge pull request #4100 from DeviousCardi/fix-highlight-line-color-never
  • fix: Merge pull request #4102 from Huang-404-Q/fix/repeatable-valued-options
  • fix: Merge pull request #4108 from Marve10s/fix/emoji-character-wrapping
  • fix: Merge pull request #4110 from Marve10s/fix/utf16-line-alignment
  • fix: Merge pull request #4111 from Marve10s/fix/syntax-mapping-suffix-path
  • fix: Merge pull request #4112 from Marve10s/fix/config-option-terminator
  • fix: Merge pull request #4113 from b84330808/fix-map-syntax-glob-colon
  • …and 51 more

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

sharkdp/bat was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 14 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 8cf33bdde9a6e4c11d0f866415b1fc867df0cd40 — the exact code this score is about.
  • Scored under rubric-2026.11.4 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.65+preprod-36d4cd83012f.