LLM plugin for Simon Willison's llm
providing text file manipulation, including reading, writing, and edits.
Install this plugin in the same environment as LLM. You'll need at least LLM 0.26a1 or later.
llm install llm-tools-patch
git clone https://github.com/dannyob/llm-tools-patch
cd llm-tools-patch
llm install .
This plugin provides AI agents with direct file system access. The tools can read, write, and modify files within your current working directory. Before enabling this plugin:
- File access is restricted to the working directory where you run the
llm
command - Only use with trusted AI models and prompts
- Use
--ta
(tool approval) mode - review all file operations carefully - Consider the potential impact if an AI agent modifies important files
The plugin provides a single Patch
toolbox with five core operations:
read
- Read complete contents of a text filewrite
- Write new content to a file (overwrites existing)edit
- Make a single string replacementmulti_edit
- Apply multiple string replacements in sequenceinfo
- Get file metadata and information
# Make a single edit
llm prompt -m gpt-4o-mini "Change port 8080 to 3000 in config.txt" --tool Patch --ta
# Make multiple edits
llm prompt -m gpt-4o-mini "Add a smiley face to the first heading in README.md, then a thank you emoji to the last heading" --tool Patch --ta --chain-limit 0
For interactive use, combine these flags:
--ta
- Requires user confirmation before executing functions (safety)--chain-limit 0
- Allows unlimited tool calls in one session (default is 5)
# Clone and set up development environment
git clone https://github.com/dannyob/llm-tools-patch
cd llm-tools-patch
make dev-setup
source .venv/bin/activate
make test # Run all tests
make test-coverage # Run tests with coverage report
make quick-test # Fast test run (exits on first failure)
After installation, verify the plugin is working:
llm tools # Should list Patch tools
llm prompt "Read this README.md file" --tool Patch
Inspired by Claude Code's Read, Edit and MultiEdit tools.
Coded with Claude.