read_lines
Read an exact 1-indexed line range from a file when you have a line number, such as a traceback frame or grep hit, and identify the enclosing function or class.
Instructions
Read an exact line range from a file (1-indexed, inclusive). The tool to reach for when you hold a LINE NUMBER rather than a symbol name: a traceback frame, a grep -n hit, a compiler or linter error. Replaces sed -n '105,150p' file, head, tail and cat + scroll. Names the function/class holding the first line, so "which function is line N in" takes one call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Last line, inclusive. Omit for start+59. | |
| file | No | Alias de `file_path`. Path to an indexed file (relative to project root). | |
| line | No | Alias de `start`. First line, 1-indexed, inclusive. | |
| path | No | Alias de `file_path`. Path to an indexed file (relative to project root). | |
| hints | No | Append the enclosing symbol (default true). | |
| start | No | First line, 1-indexed, inclusive. | |
| numbers | No | Prefix each line with its number (default true). | |
| project | No | Project name/path (default: active). | |
| end_line | No | Alias de `end`. Last line, inclusive. Omit for start+59. | |
| file_path | No | Path to an indexed file (relative to project root). | |
| max_lines | No | Cap on returned lines (default 400, 0=uncapped). | |
| start_line | No | Alias de `start`. First line, 1-indexed, inclusive. |