bat
$ bat Community Low Riskbat reads local files with line numbers, git-diff markers, and syntax highlighting. When piped (or given --paging=never --style=plain), it streams clean text without invoking a pager, while -r START:END lets agents inspect bounded line slices.
brew install bat Local file slicing with bat -r or sed/head has zero RPC overhead; no MCP server is needed.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Auto-degrades to plain output on non-TTY pipes and supports --paging=never, --color=never, and -r line ranges, though no --json.
- Supports
--paging=never,--color=never, and--style=plain
Strictly read-only local file viewer with zero network or write side effects.
- Pure read-only file inspection
Single Rust binary distributed across brew, cargo, apt (batcat), and Windows.
- Cross-platform static binary
Convenient -r range slicing and line numbers, though plain sed -n or nl is leaner for agents.
-r START:ENDavoids reading entire large files
Maintained under sharkdp/bat with rock-solid stability.
- Widely adopted OSS project under MIT / Apache-2.0
Clear README, man page, and --help.
- Well-documented CLI flags and style options
Security, Auth & Guardrails
None required; reads local files only.
100% free, offline, and open-source (MIT / Apache-2.0).
# bat Agent Rules - Always pass `--paging=never --color=never` (and `-r START:END` on large files) to prevent pager hangs or ANSI noise. - Use `--style=plain` or `--style=numbers` to avoid decorative box-drawing tokens.
Agent-Ready Command Recipes
Safe Read-Only Queries
bat --paging=never --style=numbers --color=never -r 1:120 src/index.ts
Prints lines 1–120 with plain line numbers and zero interactive pager risk.
Strengths for Agents
- + Strictly read-only with bounded
-rline-range slicing and automatic non-TTY plain fallback. - + Cross-platform Rust binary available on virtually every dev machine.
Caveats & Pitfalls
- ! Default grid/header decorations waste tokens unless
--style=plainor--style=numbersis passed. - ! Installed as
batcaton Debian/Ubuntu.