cat
Read file contents with support for byte offsets, length limits, and encoding. Returns JSON or raw text for agent workflows.
Instructions
Read and output file contents. Read-only, no side effects. Returns JSON by default with bounded content; use --raw for full plain-text output. Supports byte-offset and length for partial reads. Use to inspect file contents in agent workflows. Not for binary inspection — use 'od' for hex/octal dumps. See also 'head', 'tail', 'od'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write raw bytes to stdout without a JSON envelope. | |
| path | Yes | File to read. | |
| offset | No | Byte offset to start reading from. | |
| encoding | No | Text encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| max_bytes | No | Maximum bytes to return. | |
| show_encoding | No | Include encoding detection metadata in JSON result. | |
| encoding_errors | No | How to handle encoding errors (default: replace). | replace |
| encoding_profile | No | Locale-aware encoding fallback profile for auto-detection. |