fold
Wrap long input lines to a fixed character width by breaking at exact positions. Returns structured JSON output.
Instructions
Wrap long input lines at a fixed character width, breaking at exact positions. Read-only, no side effects. Returns JSON with wrapped text by default; use --raw for plain output. Use for display-constrained formatting or terminal-width adaptation. Not for paragraph-aware reflowing — use 'fmt' to preserve paragraph structure. See also 'fmt'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| break_words | No | Break words longer than the width. | |
| encoding | No | Text encoding. | utf-8 |
| max_lines | No | Maximum JSON lines to emit. | |
| paths | No | Files to fold, or '-' for stdin. Defaults to stdin. | |
| raw | No | Write folded text without a JSON envelope. | |
| width | No | Maximum line width. |