Files
chatgpt-on-wechat/docs/tools/write.mdx
2026-02-28 14:50:55 +08:00

28 lines
625 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: write - 文件写入
description: 创建或覆盖写入文件
---
写入内容到文件。文件不存在则自动创建,已存在则覆盖。自动创建父目录。
## 依赖
无额外依赖,默认可用。
## 参数
| 参数 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `path` | string | 是 | 文件路径 |
| `content` | string | 是 | 要写入的内容 |
## 使用场景
- 创建新的代码文件或脚本
- 生成配置文件
- 保存处理结果
<Note>
单次写入不应超过 10KB。对于大文件建议先创建骨架再使用 edit 工具分块添加内容。
</Note>