write
Create or replace files with content. Supports append, preview, auto-formatting, and showing diff for updates.
Instructions
Create or replace a file. Prefer edit/batch_edit for localized changes.
Overwrites the whole file, or appends with append=true. Reports status
created for a new path or updated for an existing one; an update also
returns a unified diff against the previous content.
Args:
path: File path to create or replace.
content: Full content to write, or appended content when
append=true.
create_parents: Create missing parent directories when needed.
dry_run: Preview without writing.
auto_format: Run formatter after write.
show_diff: Return the diff explicitly even for deterministic writes.
append: Append instead of overwrite.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| content | Yes | ||
| create_parents | No | ||
| dry_run | No | ||
| auto_format | No | ||
| show_diff | No | ||
| append | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| truncated | No | ||
| status | No | ||
| path | No | ||
| diff | No | ||
| diff_state | No | ||
| diff_omitted | No | ||
| created | No | ||
| dry_run | No | ||
| tokens_saved | No | ||
| bytes_written | No | ||
| tokens_written | No | ||
| diff_stats | No | ||
| content_hash | No | ||
| from_cache | No |