looneygrep

Crates.iolooneygrep
lib.rslooneygrep
version0.1.0
created_at2025-06-03 21:42:39.219185+00
updated_at2025-06-03 21:42:39.219185+00
descriptionA powerful command-line search tool with web page support and replace functionality.
homepage
repositoryhttps://github.com/looneyrichie/looneygrep
max_upload_size
id1699545
size74,811
Richie Looney (LooneyRichie)

documentation

README

Looneygrep

Looneygrep is executable as lg for those who wish to type less

Looneygrep is a feature-rich, blazing-fast command-line text search tool created by Richie Looney as a modern alternative to grep and ripgrep.
It supports searching files, web pages, and even interactive replacement of matches.


Features

  • 🔍 Search files or web pages for a query string
  • 🅰️ Optional case-insensitive search
  • 📝 Prompt-to-replace matches interactively
  • 📄 Show context lines around matches
  • 🎨 Syntax highlighting for code files
  • 🧠 File type awareness
  • 📂 Search all files in a directory with --all

Installation

From crates.io:

cargo install looneygrep

Or clone and build manually:

git clone https://github.com/looneyrichie/looneygrep.git
cd looneygrep
cargo build --release

Usage

looneygrep <query> <filename> [--ignore-case] [--replace] [--context N] [--url <url>] [--all]

Examples

Search a file:

looneygrep foo myfile.txt

Search a web page:

looneygrep Rust --url https://www.rust-lang.org

Case-insensitive search with context:

looneygrep error log.txt --ignore-case --context 2

Prompt to replace matches:

looneygrep oldword file.txt --replace

Search all files in the current directory:

looneygrep TODO --all

Library Usage

You can also use Looneygrep as a library in your Rust code:

use looneygrep::{Config, run};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let config = Config {
        query: "foo".to_string(),
        file_path: "bar.txt".to_string(),
        ignore_case: false,
        replace: false,
        url: None,
        context: 0,
        search_all: false,
    };
    run(config)?;
    Ok(())
}

License

Licensed under either of


Author

Richie Looney (richieandkayla@gmail.com)


Contributions welcome!

Commit count: 3

cargo fmt