@lenml/apply_edits
v1.1.5
Published
A CLI tool for batch file editing with SEARCH/REPLACE and MATCH/REPLACE patterns, supporting atomic transactions and cross-platform compatibility. Designed for AI coding assistants like Codex.
Downloads
630
Maintainers
Readme
@lenml/apply_edits
Global CLI tool for batch file editing with SEARCH/REPLACE and MATCH/REPLACE patterns. Atomic transactions, sequential same-file simulation, encoding auto-detection.
Windows PowerShell Note: PowerShell 5 (
powershell.exe) defaults to UTF-16 LE when piping, which breaks encoding. Upgrade to PowerShell 7+ (pwsh.exe). On PS5, pipe from a UTF-8 file instead of using here-strings.
Install
npm install -g @lenml/apply_editsUsage
See SKILL.md for full documentation — command format, MATCH mode, multiple files, error handling, and API.
Tip: Code fences around blocks are optional. The autofixer adds them if missing.
Basic example (PowerShell 7+):
apply-edits --workspace . @'
src/main.py
<<<<<<< SEARCH
print("hello")
=======
print("hello world")
>>>>>>> REPLACE
'@Or via heredoc (Bash):
apply-edits --workspace . << 'EOF'
src/main.py
<<<<<<< SEARCH
print("hello")
=======
print("hello world")
>>>>>>> REPLACE
EOFInstall as Agent Skill
Send this message to your AI coding agent:
install it: https://raw.githubusercontent.com/lenML/apply_edits_tool/refs/heads/main/skill/SKILL.mdOr via CDN:
install it: https://cdn.jsdelivr.net/npm/@lenml/apply_edits/skill/SKILL.mdinstall it: https://unpkg.com/@lenml/apply_edits/skill/SKILL.md