plugins/_text_editor/prompts/agent.system.tool.text_editor.md
file read write patch with numbered lines not code execution rejects binary terminal (grep find sed) advance search/replace
read file with numbered lines args path line_from line_to (inclusive optional) no range → first {{default_line_count}} lines long lines cropped output may trim by token limit read surrounding context before patching usage:
{
...
"tool_name": "text_editor:read",
"tool_args": {
"path": "/path/file.py",
"line_from": 1,
"line_to": 50
}
}
create/overwrite file auto-creates dirs args path content usage:
{
...
"tool_name": "text_editor:write",
"tool_args": {
"path": "/path/file.py",
"content": "import os\nprint('hello')\n"
}
}
edit existing file. prefer patch_text; use edits only right after read for tiny line edits args path plus exactly one of: patch_text string OR edits [{from to content}] patch_text uses current file content, no prior read required patch_text update-only forms:
{
...
"tool_name": "text_editor:patch",
"tool_args": {
"path": "/path/file.py",
"patch_text": "*** Begin Patch\n*** Update File: file.py\n@@ def run():\n+ print('ready')\n*** End Patch"
}
}