Edit file
typst_edit_fileReplace exact text in Typst project files with ordered, atomic find-and-replace edits, preserving concurrent collaborator changes by sending only modified spans.
Instructions
Replace exact text in a text file, like a find-and-replace that must match precisely (whitespace included). Each old_string must occur exactly once unless replace_all=true. Edits apply in order; if one fails, nothing is saved. Only the changed span is sent, so concurrent edits by collaborators are preserved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Project-relative path like 'chapters/intro.typ', or a file ID | |
| edits | Yes | ||
| project_id | Yes | Project ID from typst_list_projects, e.g. 'pAbC123dEf456gHi789jKl' |