@@ -122,11 +122,10 @@ extension “.orig”. If directory paths are provided, it applies replacements
122122to all files in the supplied paths that are not in the exclude pattern.
123123If no arguments are supplied, it reads from stdin and writes to stdout.
124124
125- ## Alternatives
125+ ## Comparison to Alternatives
126126
127- There are many tools for search/replace and refactoring. Here's how repren compares:
128-
129- ### Comparison
127+ There are many tools for search/replace and refactoring.
128+ Here’s how repren compares:
130129
131130| Feature | repren | [ sed/awk/perl] ( http://stackoverflow.com/questions/11392478/how-to-replace-a-string-in-multiple-files-in-linux-command-line/29191549 ) | [ sd] ( https://github.com/chmln/sd ) | [ fastmod] ( https://github.com/facebookincubator/fastmod ) | [ ast-grep] ( https://ast-grep.github.io/ ) | [ comby] ( https://comby.dev/ ) | [ rnr] ( https://github.com/ismaelgv/rnr ) |
132131| --- | --- | --- | --- | --- | --- | --- | --- |
@@ -140,23 +139,26 @@ There are many tools for search/replace and refactoring. Here's how repren compa
140139
141140** When to use each:**
142141
143- - ** repren** : Bulk renames with file/directory renaming, case preservation, or simultaneous
144- swaps. Works on any text file with full backup/undo support.
145- - ** sed/awk/perl** : Classic approaches for quick one-liners. See
142+ - ** repren** : Bulk renames with file/directory renaming, case preservation, or
143+ simultaneous swaps. Works on any text file with full backup/undo support.
144+ - ** sed/awk/perl** : Classic approaches for quick one-liners.
145+ See
146146 [ classic approaches] ( http://stackoverflow.com/questions/11392478/how-to-replace-a-string-in-multiple-files-in-linux-command-line/29191549 ) .
147147 Often error-prone for complex patterns and lack dry-run mode, simultaneous swaps, or
148148 cross-platform consistency.
149- - ** sd** : Fast sed replacement (2-11x faster than sed), but limited to simple find/replace
150- without file renaming, case preservation, or multi-pattern swaps.
151- - ** fastmod** : Good for interactive human review of changes, but lacks case preservation,
152- simultaneous swaps, and file/directory renaming.
149+ - ** sd** : Fast sed replacement (2-11x faster than sed), but limited to simple
150+ find/replace without file renaming, case preservation, or multi-pattern swaps.
151+ - ** fastmod** : Good for interactive human review of changes, but lacks case
152+ preservation, simultaneous swaps, and file/directory renaming.
153153- ** ast-grep** : Language-aware refactoring where you need to match code structure (e.g.,
154- function calls, not just text). Use when semantic understanding matters more than speed.
155- - ** comby** : Structural matching across languages without learning AST syntax. Useful when
156- you need to match code patterns like balanced braces, but overkill for simple text
157- refactoring.
158- - ** rnr** : File/directory renaming only (no content replacement). Has dry-run by default,
159- backup option, and undo via dump files. Use repren if you also need content replacement.
154+ function calls, not just text).
155+ Use when semantic understanding matters more than speed.
156+ - ** comby** : Structural matching across languages without learning AST syntax.
157+ Useful when you need to match code patterns like balanced braces, but overkill for
158+ simple text refactoring.
159+ - ** rnr** : File/directory renaming only (no content replacement).
160+ Has dry-run by default, backup option, and undo via dump files.
161+ Use repren if you also need content replacement.
160162
161163## Installation
162164
@@ -177,36 +179,13 @@ script somewhere convenient and make it executable.
177179
178180## Agent Use
179181
180- ### Why Agents Should Use repren
181-
182- repren is designed for use by AI coding agents (Claude Code, Codex, etc.)
183- as well as humans.
184-
185- AST-based tools (ast-grep, Semgrep, ts-morph) can be better for focused, language-aware
186- semantic refactoring.
187- But repren is ideal for fast, large code or doc text refactoring, file/directory
188- renaming, or any serious larger-scale renaming effort:
189-
190- | Feature | repren | AST tools | Built-in Edit |
191- | --- | --- | --- | --- |
192- | Simultaneous renames and swaps (foo↔bar) | ✅ | ❌ | ❌ |
193- | File/directory renaming | ✅ | Some | ❌ |
194- | Case-preserving variants | ✅ | ❌ | ❌ |
195- | Works on any text file | ✅ | ❌ | ✅ |
196- | Dry runs, backups, undo system | ✅ | ❌ | ❌ |
197-
198- ### JSON Output
199-
200- Use ` --format=json ` for machine-parseable output:
201-
202- ``` bash
203- repren --format=json --from=foo --to=bar --full src/
204- ```
205-
206- ### Claude Code Skill
182+ repren is ideal for use by AI coding agents (Claude Code, Codex, etc.)
183+ since it is powerful, simple to use, and self-documenting.
184+ Just tell agents to run ` uvx repren@latest --help ` and they have everything they need,
185+ including the ability to install it as a skill.
186+ Agents can use ` --format=json ` for machine-parseable output.
207187
208- repren includes a built-in skill for [ Claude Code] ( https://claude.com/claude-code ) , so
209- Claude can use repren for bulk refactoring tasks.
188+ repren includes a built-in skill for Claude Code or other agents.
210189
211190** Install:**
212191
0 commit comments