Read a file
read_fileRead a project text file exactly as the editor shows it, optionally windowing large files by line range. Use it before editing so edit quotes match verbatim.
Instructions
Read a text file as the editor shows it right now (open documents are flushed first). Reads cap at ~100 KB — window larger files with from_line/to_line (1-based, inclusive; the result echoes the window it served, to_line clamped to the last line). Read before you edit: edit_file quotes must match this content verbatim. The result carries contentVersion (the branch version — pass it as base_version when you write this file) and fileVersion (the version at which this file itself last changed). Text is decided by content, not extension: a file with binary bytes is refused.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | File path relative to the project root, e.g. "main.tex" or "sections/intro.tex" — no leading "/", no "..", and hidden folders (.git, .aldine-out) are off limits. | |
| branch | No | Branch name (defaults to 'main'). Every result, error results included, echoes {branch, head} — head is the branch's current commit (after a write, the commit that write made). Pass the branch explicitly whenever you are not on main. | |
| project | No | Project id. Optional when the access token is scoped to exactly one project. | |
| to_line | No | ||
| from_line | No |