docs/tools/write.mdx
Write content to a file. Creates the file if it doesn't exist, overwrites the whole file if it does. Automatically creates parent directories.
Prefer edit when modifying an existing file - it only sends the text being changed. Use write for new files and complete rewrites.
No extra dependencies, available by default.
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | Yes | File path |
content | string | Yes | Content to write |
A few checks run before writing, and report back in the result:
.py, for example) only warn, and only when this write introduced a new syntax error.~/.cow/.env, which holds API keys, cannot be written through this tool. Use the env_config tool instead.