1
0

docs: add batch_edit tool and load/save commands to README

This commit is contained in:
2026-03-06 03:07:56 +01:00
parent 829ba7a7f2
commit 8f2c72b3c5

View File

@@ -98,6 +98,71 @@ The resulting binary is ~12 MB, has no .NET runtime dependency, and starts insta
**Command Execution:** **Command Execution:**
- `execute_command` - Run shell commands (with user approval) - `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/ AnchorCli/
├── Program.cs # Entry point + CLI parsing ├── Program.cs # Entry point + CLI parsing