Open-Source Wikis

/

ripgrep

/

Packages

BurntSushi/ripgrep

Packages

Active contributors: Andrew Gallant

ripgrep is a Cargo workspace with one binary crate (ripgrep, the rg executable) and nine library crates under crates/. Most of ripgrep's logic is in those libraries; the binary is glue that parses flags and wires them together.

The library crates are also published independently to crates.io and have downstream users beyond ripgrep itself (e.g., globset is used by Cargo, ignore by build tools).

Workspace layout

Crate Path Purpose Dedicated page
ripgrep crates/core The rg binary: CLI parsing, search drivers core
grep crates/grep Re-export facade over the other crates grep
grep-matcher crates/matcher Generic Matcher trait for regex implementations matcher
grep-regex crates/regex Matcher impl backed by Rust's regex crate regex
grep-pcre2 crates/pcre2 Matcher impl backed by PCRE2 (optional) pcre2
grep-searcher crates/searcher Line-oriented search engine searcher
grep-printer crates/printer Standard / JSON / Summary output formatters printer
grep-cli crates/cli CLI utilities: stdin handling, decompression, pattern files cli
ignore crates/ignore Recursive directory walker that respects ignore rules ignore
globset crates/globset Single glob and glob-set matching globset

Dependency layering

graph TD
    rg[ripgrep binary - crates/core] --> grep
    rg --> ignore
    grep --> grep_cli
    grep --> grep_matcher
    grep --> grep_pcre2
    grep --> grep_printer
    grep --> grep_regex
    grep --> grep_searcher
    grep_searcher --> grep_matcher
    grep_regex --> grep_matcher
    grep_pcre2 --> grep_matcher
    grep_printer --> grep_matcher
    grep_printer --> grep_searcher
    ignore --> globset

Lines flow from dependent to dependency. globset and grep-matcher are at the bottom; nothing in the workspace depends on crates/core other than the binary it produces.

Versioning

Each library crate has its own version number, separate from the ripgrep binary's version. Versions are bumped only when a release is cut for that specific crate. The #:version marker comment in Cargo.toml is what RELEASE-CHECKLIST.md greps for when bumping.

Latest tagged versions (as of writing):

  • ripgrep 15.1.0
  • grep 0.4.1
  • grep-cli 0.1.12
  • grep-matcher 0.1.8
  • grep-pcre2 0.1.9
  • grep-printer 0.3.1
  • grep-regex 0.1.14
  • grep-searcher 0.1.16
  • globset 0.4.18
  • ignore 0.4.25

Where to start

If you want to understand ripgrep top-down, read in this order:

  1. core — what the rg binary does
  2. matcher — the trait everyone implements or uses
  3. searcher — the search engine
  4. regex — the default matcher implementation
  5. printer — the output formatters
  6. ignore — directory walking and .gitignore rules
  7. globset — what ignore uses for glob matching

The smaller crates (grep, cli, pcre2) can be read in any order.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Packages – ripgrep wiki | Factory