Read file
typst_read_fileRead project files to retrieve Typst text, inline images, or save binaries; use line ranges and optional line numbers for targeted review and comments.
Instructions
Read a file from a project. Text files (.typ, .bib, ...) return their content; images are returned inline; other binaries need save_to. Use start_line/end_line for long files. Use line_numbers=true when you plan comments on line ranges.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative path like 'chapters/intro.typ', or a file ID | |
| save_to | No | Local path to save the file to instead of returning it (needed for large binaries) | |
| end_line | No | Last line to return (inclusive) | |
| project_id | Yes | Project ID from typst_list_projects, e.g. 'pAbC123dEf456gHi789jKl' | |
| start_line | No | First line to return (1-based) | |
| line_numbers | No | Prefix each line with its number |