Skip to main content

llm-tools-patch

PyPI Changelog Tests License

LLM plugin for Simon Willison's llm providing text file manipulation, including reading, writing, and edits.

Installation

Install this plugin in the same environment as LLM. You'll need at least LLM 0.26a1 or later.

llm install llm-tools-patch

From source

git clone https://github.com/dannyob/llm-tools-patch
cd llm-tools-patch
llm install .

⚠️ Security Warning

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

Usage

The plugin provides a single Patch toolbox with five core operations:

Available Tools

  • read - Read complete contents of a text file
  • write - Write new content to a file (overwrites existing)
  • edit - Make a single string replacement
  • multi_edit - Apply multiple string replacements in sequence
  • info - Get file metadata and information

Basic Usage

# 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)

Development

Setup Development Environment

# 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

Testing

make test           # Run all tests
make test-coverage  # Run tests with coverage report
make quick-test     # Fast test run (exits on first failure)

Plugin Testing

After installation, verify the plugin is working:

llm tools  # Should list Patch tools
llm prompt "Read this README.md file" --tool Patch

Credits and Thanks

Inspired by Claude Code's Read, Edit and MultiEdit tools.

Coded with Claude.

Metadata

Release files for llm-tools-patch 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-tools-patch 0.3
File Size Uploaded Provenance
llm_tools_patch-0.3.tar.gz 12.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for llm-tools-patch 0.3
File Interpreter ABI Platform
llm_tools_patch-0.3-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / llm_tools_patch-0.3.tar.gz

Download URL llm_tools_patch-0.3.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
15e2236793bdaa4185889136711beb275fa2ebc2b28c538d3f6cc6644dce037a
BLAKE2b-256 checksum
How to use checksums
c3521159bb2556157d4791769ce20e536747b74402db15b15731b274b782ead6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.10

Release files / llm_tools_patch-0.3-py3-none-any.whl

Download URL llm_tools_patch-0.3-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c0253f9045dae28442e2f59f1741afe60f6f508df7d011b048dbfcd3b2baaeaf
BLAKE2b-256 checksum
How to use checksums
a05c77956b6af7e3d46fd4e9b8339a248b57cd35ac9d27ce0192a6428cf5bbd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.10

Security for llm-tools-patch 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page