typst_write_file
Create or overwrite text files in Typst projects, syncing Yjs CRDT updates via WebSocket and REST.
Instructions
Create or overwrite a text file (.typ, .bib, .toml, etc.) in a https://typst.app project, synchronizing the Yjs CRDT update via WebSocket (/editing/v3) and REST (/v1/files/:projectId/:fileId/yjs).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | Yes | Full UTF-8 text content to write | |
| filePath | Yes | File path/name (e.g. 'main.typ') or file ID | |
| projectId | Yes | The Typst project ID | |
| preferWebSocket | No | Also push real-time TextUpdate over /editing/v3 WebSocket before REST persistence (default: true) |