ptx
Build a permuted index from text input, displaying each word with surrounding context to create cross-reference indices.
Instructions
Build a permuted (keyword-in-context) index from input text, showing each word in its surrounding context. Read-only, no side effects. Returns JSON with the index by default; use --raw for plain output. Use to create searchable cross-reference indices. Not for sorting or deduplication — use 'sort' and 'uniq'. See also 'sort'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| raw | No | Write index rows without a JSON envelope. | |
| only | No | Only include this keyword. Repeatable. | |
| paths | No | Files to index, or '-' for stdin. Defaults to stdin. | |
| ignore | No | Ignore a keyword. Repeatable. | |
| context | No | Words of left/right context. | |
| encoding | No | Text encoding (default: utf-8). Use 'auto' for BOM/autodetection. | utf-8 |
| max_lines | No | Maximum JSON records to emit. | |
| ignore_case | No | Compare filters case-insensitively. | |
| 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. |