From 8f2c72b3c572b63cc655080a3db732bd8b554357 Mon Sep 17 00:00:00 2001 From: Tomi Eckert Date: Fri, 6 Mar 2026 03:07:56 +0100 Subject: [PATCH] docs: add batch_edit tool and load/save commands to README --- README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/README.md b/README.md index 6216248..c4d68ca 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,71 @@ The resulting binary is ~12 MB, has no .NET runtime dependency, and starts insta **Command Execution:** - `execute_command` - Run shell commands (with user approval) +``` +AnchorCli/ +├── Program.cs # Entry point + CLI parsing +├── ReplLoop.cs # Main REPL loop with streaming, spinners, and cancellation +├── ChatSession.cs # AI chat client wrapper with message history +├── ToolRegistry.cs # Centralized tool registration and dispatch +├── AnchorConfig.cs # JSON file-based configuration (~APPDATA~/anchor/config.json) +├── ContextCompactor.cs # Conversation history compression +├── AppJsonContext.cs # Source-generated JSON context (AOT) +├── SetupTui.cs # Interactive setup TUI +├── Hashline/ +│ ├── HashlineEncoder.cs # Adler-8 + position-seed hashing +│ └── HashlineValidator.cs # Anchor resolution + validation +├── Tools/ +│ ├── FileTools.cs # read_file, grep_file, grep_recursive, find_files, get_file_info +│ ├── EditTools.cs # replace_lines, insert_after, delete_range, create/delete/rename/copy/append +│ ├── DirTools.cs # list_dir, create_dir, rename_dir, delete_dir +│ └── CommandTool.cs # execute_command +├── Commands/ +│ ├── ICommand.cs # Command interface +│ ├── CommandRegistry.cs # Command registration +│ ├── CommandDispatcher.cs # Command dispatch logic +│ ├── ExitCommand.cs # /exit command +│ ├── HelpCommand.cs # /help command +│ ├── ClearCommand.cs # /clear command +│ ├── StatusCommand.cs # /status command +│ ├── CompactCommand.cs # /compact command +│ ├── CompactCommand.cs # /compact command +│ ├── LoadCommand.cs # /load command +│ ├── SaveCommand.cs # /save command +│ └── ResetCommand.cs # /reset command +- `append_to_file` - Append lines to the end of a file +- `batch_edit` - Apply multiple edits atomically in a single operation +`/compact` | Manually trigger context compaction | +/load` | Load a previous chat session from file | +`/save` | Save current chat session to file | +`/reset` | Clear session and reset token tracker | +## Available Tools + +**File Operations:** +- `read_file` - Read a file (or a window) with Hashline-tagged lines +- `grep_file` - Search a file by regex — results are pre-tagged for immediate editing +- `grep_recursive` - Search for a regex pattern across all files in a directory tree +- `find_files` - Search for files matching glob patterns +- `get_file_info` - Get detailed file information (size, permissions, etc.) + +**Edit Operations:** +- `replace_lines` - Replace a range identified by `line:hash` anchors +- `insert_after` - Insert lines after an anchor +- `delete_range` - Delete a range between two anchors +- `create_file` - Create a new file with optional initial content +- `delete_file` - Delete a file permanently +- `rename_file` - Rename or move a file +- `copy_file` - Copy a file to a new location +- `append_to_file` - Append lines to the end of a file + +**Directory Operations:** +- `list_dir` - List directory contents +- `create_dir` - Create a new directory (with parent directories) +- `rename_dir` - Rename or move a directory +- `delete_dir` - Delete a directory and all its contents + +**Command Execution:** +- `execute_command` - Run shell commands (with user approval) + ``` AnchorCli/ ├── Program.cs # Entry point + CLI parsing