# Tool Bat

> User-invoked skill tool-bat. A human runs it by name.

- Skill: `niksavis/tool-bat` (Agent Skill)
- Install (CLI): `npx skillmds@latest add niksavis/tool-bat`
- Raw SKILL.md: https://api.skillmd.com/api/skills/niksavis/tool-bat/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: niksavis (https://skillmd.com/u/niksavis)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/niksavis/tool-bat

---

<!-- Generated by `basicly skills-build` from skill.yaml. Do not edit; edit the source. -->

# 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

```bash
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=never` in scripts and non-interactive runs.
- Use `--plain` when colored decorations would break parsing.
- Fallback to `batcat` where distro packaging uses that binary name.

## Common Pitfalls

- Forgetting pager behavior in automation contexts.
- Treating bat output as machine-parseable by default.
- Assuming `bat` exists where only `batcat` is installed.

## Output Interpretation

- Default output includes line numbers and style metadata.
- `--plain` minimizes 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 `ValidationError` in the repo."

