Both recur and ripgrep support --stdin for pipeline workflows, but they serve different purposes:
- ripgrep: Filters file paths OR searches content from stdin
- recur: Filters file paths from stdin using hierarchical patterns
ripgrep treats filenames as flat strings:
ls *.cs | rg "UserService" # Matches any file containing "UserService" substringrecur understands hierarchical structure:
ls *.cs | recur files "UserService.**" --stdin # Matches hierarchical pattern UserService.**With ripgrep (substring matching):
git diff --name-only | rg "\.cs$" # All .cs filesWith recur (hierarchical patterns):
# Filter changed files by hierarchy
git ls-files "*.cs" | recur files "UserService.**" --stdin
# Find only modified UserService handler files
git diff --name-only | recur files "UserService.Handlers.*" --stdinWith ripgrep:
Get-ChildItem -Recurse -Name | rg "Service" # Any file with "Service" in nameWith recur:
# Filter by hierarchical pattern
Get-ChildItem *.cs -Name | recur files "*.Service" --stdin
# Match deep hierarchies
Get-ChildItem *.cs -Name | recur files "UserService.**" --stdin# Find all UserService files, then search for "async" in them
recur files "UserService.**" | recur find "async" --scope "**" --stdin
# Get files at specific depth, filter further
recur files "**" | recur files "*.Handlers.*" --stdinPS C:\src\recur\test_stdin> ls *.cs | Select-Object -ExpandProperty Name | ..\target\release-safe\recur.exe files "UserService.**" --stdin
.\UserService.cs
.\UserService.Handlers.cs
.\UserService.Models.csPS C:\src\recur\test_stdin> ls *.cs | Select-Object -ExpandProperty Name | ..\target\release-safe\recur.exe files "Api*" --stdin
.\ApiController.cs| Input Files | Pattern | Matches |
|---|---|---|
UserService.csUserService.Handlers.csUserService.Models.csApiController.cs |
UserService.** |
UserService.csUserService.Handlers.csUserService.Models.cs |
| Same files | Api* |
ApiController.cs |
| Same files | **.Handlers.* |
UserService.Handlers.cs |
| Feature | ripgrep | recur --stdin |
|---|---|---|
| Input Type | File paths OR content | File paths only |
| Pattern Type | Regex/substring | Hierarchical (*, **) |
| Use Case | Text search | Hierarchy filtering |
| Hierarchy Awareness | ❌ | ✅ |
| Example | | rg "Service" |
| recur files "*.Service" --stdin |
- Searching file content from stdin
- Simple substring matching on filenames
- Need regex patterns on flat strings
- Maximum speed is critical
- Filtering by hierarchical patterns (e.g.,
Module.SubModule.**) - Working with dotted naming conventions
- Need to understand parent/child relationships
- Filtering git output by code structure
With ripgrep (limited):
# Can only do substring matching
git diff --name-only | rg "UserService.*Handlers"With recur (hierarchical):
# Precise hierarchical filtering
git diff --name-only | recur files "UserService.Handlers.*" --stdin
# Or get all UserService descendants
git diff --name-only | recur files "UserService.**" --stdinrecur files --stdin- WORKING- CLI flag recognized
- Help text documented
- Pipeline compatibility verified
recur find --stdinrecur stats --stdinrecur tree --stdin- Other commands with stdin
The stdin functionality reads file paths from stdin (one per line) and applies hierarchical pattern matching to filter them. This differs from filesystem scanning and allows integration with:
- Git commands:
git ls-files,git diff --name-only - File explorers: PowerShell
Get-ChildItem, Unixfind - Other recur commands: Chain multiple recur operations
recur --stdin complements ripgrep by adding hierarchical awareness to pipeline workflows. While ripgrep excels at fast text search, recur provides structure-aware filtering for modern codebases with dotted naming conventions.
Best Practice: Use both together:
# Find UserService files (recur), search for async patterns (ripgrep)
recur files "UserService.**" | rg "async.*Task"
# Or: Filter by structure (recur), search content (recur find)
git ls-files "*.cs" | recur files "UserService.**" --stdin | xargs recur find "async" --scope "**"