file_write
Write complete files using overwrite, append, prepend, or create-new modes. It creates parent directories and preserves existing line-ending style.
Instructions
Write a whole file. mode: overwrite (default) | append | prepend | create_new (fails if it exists). Creates parent directories and keeps the file existing EOL style. For a small change to a big file use file_edit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| eol | No | Line endings. Default keep (detect from the file, else LF). | |
| mode | No | Default overwrite. | |
| path | Yes | File path, absolute or relative to the server cwd. | |
| content | Yes | Full new content (or the chunk to append/prepend). | |
| encoding | No | base64 to write binary content. | |
| create_dirs | No | Create missing parent directories. Default true. | |
| ensure_trailing_newline | No | End the file with a newline. Default true. |