edit_file
Modify files precisely by replacing specific text content. Specify the file path and define text replacements, with an option to preview changes before applying them.
Instructions
對檔案進行精確的編輯,可以替換特定文字內容
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | 預覽變更而不實際修改檔案 | |
| edits | Yes | ||
| path | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"dryRun": {
"default": false,
"description": "預覽變更而不實際修改檔案",
"type": "boolean"
},
"edits": {
"items": {
"additionalProperties": false,
"properties": {
"newText": {
"description": "替換成的新文字",
"type": "string"
},
"oldText": {
"description": "要搜尋的文字 - 必須完全匹配",
"type": "string"
}
},
"required": [
"oldText",
"newText"
],
"type": "object"
},
"type": "array"
},
"path": {
"type": "string"
}
},
"required": [
"path",
"edits"
],
"type": "object"
}