bfs
$ bfs Community Med Riskbfs is a fast breadth-first drop-in replacement for UNIX find that discovers top-level files before descending into deep subdirectories. It adds -exclude, -limit N, -nocolor, -printf, and NO_COLOR support while staying compatible with POSIX/GNU find expressions.
brew install bfs Fast local breadth-first directory discovery (bfs); direct execution avoids MCP overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Non-interactive with -nocolor / NO_COLOR, -limit, -exclude, and -printf custom formatting, though it has no --json output.
- Supports
-nocolor,-limit N,-exclude, and-printf - Plain-text path output; no
--jsonflag
Read-only traversal by default, though find-compatible -delete and -exec flags can delete files or run commands if invoked.
- Read-only unless
-deleteor-execis explicitly passed
Fast C binary available via brew install bfs and Linux distro packages; targets POSIX/Unix hosts (no native Win32 build).
- Packaged on Homebrew and major Linux/BSD distros
Breadth-first traversal + -exclude + -limit locates shallow config/manifest files dramatically faster than depth-first find.
- Multi-threaded/async I/O breadth-first search (
-S bfs)
Actively maintained by Tavian Barnes under the permissive 0BSD license.
- Active
tavianator/bfsrepository
Detailed bfs(1) man page and project documentation covering all find extensions.
- Comprehensive man page and tavianator.com docs
Security, Auth & Guardrails
None required; local filesystem traversal utility.
100% free, offline, and open-source (0BSD).
# bfs Agent Rules - Always pass `-nocolor` (or `NO_COLOR=1`) and `-exclude -name .git -exclude -name node_modules`. - Do NOT pass `-delete` or `-exec` without explicit user approval; use `-limit <N>` to bound large searches.
Agent-Ready Command Recipes
Safe Read-Only Queries
bfs . -nocolor -exclude -name .git -exclude -name node_modules -type f -limit 50
Traverses shallow files first, skips .git and node_modules with -exclude, and stops after 50 matches (-limit).
bfs src -nocolor -type f -printf '%s\t%p\n'
Outputs tab-separated byte size and path records without spawning stat subprocesses.
Strengths for Agents
- + Breadth-first order with
-limitfinds shallow project files instantly without descending deep trees. - +
-excludesyntax is far simpler and less error-prone thanfind's-pruneexpressions.
Caveats & Pitfalls
- ! POSIX/Unix only (macOS, Linux, BSD); Windows requires WSL or MSYS2.
- ! Lacks
--jsonoutput, and inheritsfind's-delete/-exechazards if misused.