MCPcopy Index your code
hub / github.com/acheronfail/repgrep

github.com/acheronfail/repgrep @0.16.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.16.1 ↗ · + Follow
284 symbols 719 edges 27 files 15 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

crate documentation Average time to resolve an issue Percentage of issues still open

repgrep (rgr)

An interactive replacer for ripgrep.

This is an interactive command line tool to make find and replacement easy. It uses [ripgrep] to find, and then provides you with a simple interface to see the replacements in real-time and conditionally replace matches.

Some features:

  • ⚡ Super fast search results
  • ✨ Interactive interface for selecting which matches should be replaced or not
  • 🕶️ Live preview of the replacements
  • 🧠 Replace using capturing groups (e.g., when using /foo (\w+)/ replace with bar $1)
  • 🦀 and more!

Supported file encodings:

  • ASCII
  • UTF8
  • UTF16BE
  • UTF16LE

Other encodings are possibly supported but untested at the moment. See this issue for more information.

Usage

After installing, just use rgr (think: rg + replace).

The arguments are:

rgr <rg arguments> # See `rgr --help` for more details

Here's an example where we ran the command:

rgr -C5 dreamcast

And have entered the replacement flycast:

demo using rgr

Installation

First and foremost, make sure you've installed ripgrep (AKA: rg). To do so see the [ripgrep installation instructions].

Precompiled binaries

See the releases page for pre-compiled binaries.

Via Cargo

NOTE: The minimum Rust version required is 1.81.0.

cargo install repgrep

Via Pacman (Arch Linux)

repgrep can be installed from the official repositories using Pacman.

pacman -S repgrep

Via MacPorts (macOS)

repgrep can also be installed on macOS using MacPorts:

sudo port install repgrep

More info here.

From Source

NOTE: The minimum Rust version required is 1.81.0.

git clone https://github.com/acheronfail/repgrep/
cd repgrep
cargo install --path .

License: Unlicense OR MIT OR Apache-2.0

Extension points exported contracts — how you extend this code

Printable (Interface)
(no doc) [6 implementers]
src/model/printable.rs

Core symbols most depended-on inside this repo

len
called by 30
src/encoding.rs
new_ui_item_ctx
called by 22
src/ui/line/item.rs
new_app_list_state
called by 22
src/ui/line/item.rs
set_selected_submatch
called by 15
src/ui/app/state.rs
set_selected_item
called by 13
src/ui/app/state.rs
set_should_replace
called by 13
src/ui/line/item.rs
perform_replacements
called by 10
src/replace.rs
move_pos
called by 10
src/ui/app/app_events.rs

Shape

Function 136
Method 115
Class 18
Enum 14
Interface 1

Languages

Rust100%

Modules by API surface

src/ui/line/item.rs58 symbols
src/ui/app/app_events.rs36 symbols
src/rg/de.rs36 symbols
src/cli/mod.rs23 symbols
src/rg/de_borrow.rs21 symbols
src/ui/app/state.rs19 symbols
src/encoding.rs14 symbols
src/model/printable.rs13 symbols
src/ui/app/app_render.rs11 symbols
src/replace.rs11 symbols
benches/parsing_json.rs9 symbols
src/ui/tui.rs5 symbols

For agents

$ claude mcp add repgrep \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact