delete_from_file
Remove specific text or lines from files using path and selector options. Supports exact text, line ranges, or mark tags. Preview changes with dry run before applying.
Instructions
從檔案中刪除特定內容
Input Schema
Name | Required | Description | Default |
---|---|---|---|
dryRun | No | 預覽變更而不實際修改檔案 | |
path | Yes | ||
selector | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"dryRun": {
"default": false,
"description": "預覽變更而不實際修改檔案",
"type": "boolean"
},
"path": {
"type": "string"
},
"selector": {
"anyOf": [
{
"description": "要刪除的確切文字",
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"endLine": {
"description": "結束行號,如果省略則只刪除單行",
"type": "number"
},
"startLine": {
"description": "開始行號 (從1開始)",
"type": "number"
}
},
"required": [
"startLine"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"end": {
"description": "結束標記文字",
"type": "string"
},
"start": {
"description": "開始標記文字",
"type": "string"
}
},
"required": [
"start",
"end"
],
"type": "object"
}
]
}
},
"required": [
"path",
"selector"
],
"type": "object"
}