tool-bat
When To Use
- Preview file contents with line numbers and syntax highlighting.
- Show focused line ranges during debugging and review.
- Improve readability of piped terminal output.
Trusted Commands
bat file.py
bat --plain file.py
bat -r 10:40 file.py
bat -l json file.txt
command | bat -l json
bat --paging=never file.py
Safe Defaults
- Use
--paging=neverin scripts and non-interactive runs. - Use
--plainwhen colored decorations would break parsing. - Fallback to
batcatwhere distro packaging uses that binary name.
Common Pitfalls
- Forgetting pager behavior in automation contexts.
- Treating bat output as machine-parseable by default.
- Assuming
batexists where onlybatcatis installed.
Output Interpretation
- Default output includes line numbers and style metadata.
--plainminimizes formatting for simple text workflows.
Why It Matters For Agents
- Rapidly improves human readability of code and config output.
- Language forcing (
-l) keeps piped content understandable.
Repo Conventions
- Use bat for visual inspection, not search operations.
- Keep examples aligned with WSL aliasing (
bat -> batcat).
Trigger Examples
- Should trigger: "Show this config file with line numbers and syntax color."
- Should trigger: "Preview a script quickly before editing it."
- Should not trigger: "Find every occurrence of
ValidationErrorin the repo."