search-text

Crates.iosearch-text
lib.rssearch-text
version0.1.2
created_at2025-09-26 09:09:25.045997+00
updated_at2025-10-12 09:29:43.712272+00
descriptionA fast and flexible command-line tool to recursively search for text or regex patterns in files under a directory.
homepagehttps://crates.io/crates/search-text
repositoryhttps://github.com/ssrlive/search-text
max_upload_size
id1855654
size29,338
(ssrlive)

documentation

README

search-text

A fast and flexible command-line tool to recursively search for text or regex patterns in files under a directory.

Features

  • Recursively search all files in a directory and its subdirectories
  • Supports plain text and regex pattern matching
  • Filter files by extension (e.g. .rs, .txt, or multiple)
  • Asynchronous file reading for high performance
  • Command-line options auto-filled from Cargo metadata
  • If no directory is specified, search starts from the current working directory

Usage

search-text [OPTIONS] -p <PATTERN>

Options

  • -p, --pattern <PATTERN>: Text or regex pattern to search for (required)
  • -d, --dir <DIR>: Directory to search (optional, default: current working directory)
  • -r, --regex: Use regex pattern matching (optional)
  • -e, --ext <EXT>: File extensions to filter, comma separated (e.g. rs,txt). If omitted, all files are searched.

Examples

Search for the word "TODO" in all .rs files:

search-text -p TODO -e rs

Search for a regex pattern in .txt and .md files:

search-text -p "T.O" -r -e txt,md

Search for a string in all files under current directory:

search-text -p hello

Search for a string in a specific directory:

search-text -p hello -d ./src

Installation

From crates.io

cargo install search-text

From Source

Clone the repo and build with Cargo:

git clone https://github.com/ssrlive/search-text.git
cd search-text
cargo install search-text --path .

License

MIT

Commit count: 0

cargo fmt