🦀 rust_filesearch - Fast Developer Tools
A dual-binary Rust workspace providing two powerful command-line tools for developers:
- fexplorer - Fast file system exploration, searching, and analysis
- px - Intelligent project switcher with fuzzy search and frecency ranking
🎯 Quick Start
# Install both tools
# Set up px
# Edit ~/.config/px/config.toml with your project directories
# Now you're ready!
📦 Two Tools, One Workspace
fexplorer - File System Explorer
Fast filesystem traversal, searching, and analysis tool.
Use fexplorer when:
- Finding specific files across projects
- Analyzing disk usage
- Generating reports (HTML/Markdown)
- Exploring unfamiliar codebases
- Need structured output (JSON/CSV)
px - Project Switcher
Intelligent project management with fuzzy search and frecency ranking.
Use px when:
- Switching between projects quickly
- Opening projects in editor + terminal
- Tracking project access patterns
- Finding projects by name/fuzzy match
- Managing multiple development workspaces
See WORKFLOWS.md for powerful ways to combine both tools!
✨ fexplorer Features
- 🚀 Fast traversal with parallel processing (default)
- 🔍 Powerful filtering by name (glob/regex), extension, size, date, and type
- 📊 Multiple output formats: pretty (colored), JSON, NDJSON, CSV
- 📄 Template export: HTML and Markdown reports (default)
- 🌳 Tree view with ASCII art visualization
- 📏 Size analysis with directory aggregation (du-like)
- 🔎 Content search (grep functionality, default)
- 🔁 Duplicate detection via BLAKE3 hashing (optional)
- 🔗 Git integration for status and change tracking (optional)
- 👁️ Watch mode for real-time filesystem monitoring (optional)
- 🙈 Respects .gitignore by default
- ⚙️ Cross-platform: macOS, Linux, Windows
- 🎨 TTY-aware colored output
- 🔒 Memory-safe Rust implementation with zero unsafe code
📦 Installation
Quick Install (Recommended)
This installs fexplorer to ~/.cargo/bin/ with default features:
- ✅ Parallel traversal (fast)
- ✅ Template export (HTML/Markdown)
- ✅ Content search (grep)
Using the Install Script
Verify Installation
# Should show: /Users/yourusername/.cargo/bin/fexplorer
# Should show: fexplorer 0.1.0
macOS Setup
If fexplorer command isn't found, add cargo bin to your PATH:
# Add to ~/.zshrc
# Reload shell
Optional Features
# Install with all features
# Install with specific features
Available features:
parallel(default) - Multi-threaded traversaltemplates(default) - HTML/Markdown exportgrep(default) - Content searchwatch- Filesystem monitoringprogress- Progress barsdedup- Duplicate file detectiongit- Git integrationtui- Interactive TUI modetrends- Filesystem trend analysis
✨ px Features
- 🚀 Fast project switching - Open projects in editor + iTerm2 instantly
- 🔍 Fuzzy search - Find projects by partial name matching
- 📊 Frecency ranking - Most frequent and recent projects surface first
- 📁 Git integration - Track branches, commits, and uncommitted changes
- 🎯 Smart filtering - Filter by uncommitted changes, inactive projects
- 💾 Caching - Fast startup with JSON index caching
- 📝 Rich info - View project details, git status, README excerpts
- 🔄 Auto-sync - Keep project index up to date
- ⚙️ Configurable - Set editor, scan directories, and more
📦 px Installation
# Install px binary
# Initialize configuration
# Edit config with your project directories
# Example config:
# scan_dirs = [
# "/Users/you/Developer/projects",
# "/Users/you/Work/repos"
# ]
# default_editor = "cursor" # or "code", "vim", etc.
# Sync and index all projects
Verify:
Shell Aliases (recommended):
# Add to ~/.zshrc
🚀 fexplorer Usage
List Files
List entries with metadata and sorting:
# List current directory
# List with custom sorting
# Show directories first
# Include hidden files
# Output as JSON
# Custom columns
Tree View
Display directory structure as an ASCII tree:
# Show directory tree
# Limit depth
# Directories first
# Disable .gitignore filtering
Find Files
Search with powerful filtering:
# Find Rust files (use --name, not --names!)
# Multiple patterns
# By extension
# Regex pattern
# Size range
# Modified after date
# Combine filters
# Find only directories
# Category-based search
Template Export (NEW!)
Generate HTML or Markdown reports:
# HTML report of recent changes
# Markdown table
# Open in browser (macOS)
&&
Suppress macOS Permission Warnings
When scanning from home directory:
# Use -q (quiet) flag
# Or search specific directories
🚀 px Usage
Quick Commands
# List all projects (sorted by frecency)
# Filter projects
# Open project (fuzzy match)
# Show project details
# Sync/rebuild index
# Initialize config
Real-World Examples
# Morning routine: check what needs attention
# Jump to project instantly
# Opens in Cursor + creates iTerm2 window at project directory
# Find project you haven't touched in a while
# Get detailed info before starting work
# Shows:
# - Branch and git status
# - Last commit details
# - README excerpt
# - Access frequency stats
# After cloning new repos
# Scans configured directories and updates index
Combined with fexplorer
# Open project, then explore files
# Find files across all projects
# Find large uncommitted files
| while ; do
done
See docs/PX_USER_GUIDE.md and docs/WORKFLOWS.md for advanced usage!
🚀 fexplorer Size Analysis
Calculate and display file/directory sizes:
# Show sizes
# Aggregate directory sizes (like 'du')
# Top 20 largest files
# Sort by size descending (default for size command)
Watch Mode
Monitor filesystem changes in real-time (requires watch feature):
# Watch for all changes
# Watch specific events
# Output as NDJSON (streaming)
🎛️ Options
Global Options
--no-color- Disable colored output-q, --quiet- Quiet mode (suppress non-essential output)
Common Options (All Subcommands)
--max-depth <N>- Maximum traversal depth--hidden- Include hidden files--no-gitignore- Disable .gitignore filtering--follow-symlinks- Follow symbolic links--format <FORMAT>- Output format:pretty,json,ndjson,csv--columns <COLS>- Comma-separated columns:path,name,size,mtime,kind,perms,owner
Parallel Feature Options
With --features parallel:
--threads <N>- Number of threads for parallel traversal (default: 4)
Progress Feature Options
With --features progress:
--progress- Show progress bar during traversal
📊 Output Formats
Pretty (Default)
Human-readable colored output with automatic column sizing:
file1.txt 1.2 KiB 2024-01-15 10:30:00 file
dir1/ 0 B 2024-01-15 10:25:00 dir
JSON
Structured JSON array (buffered):
NDJSON
Streaming newline-delimited JSON (one object per line):
CSV
Comma-separated values with header:
path,name,size,mtime,kind
file1.txt,file1.txt,1234,2024-01-15T10:30:00Z,file
file2.txt,file2.txt,5678,2024-01-15T10:31:00Z,file
🔧 Development
Prerequisites
- Rust 1.70+ (stable)
- Cargo
Building
# Debug build
# Release build (optimized)
# With all features
Testing
# Run all tests
# Run unit tests only
# Run integration tests
# With all features
Linting and Formatting
# Format code
# Lint with clippy
# Check without building
Using Justfile
A justfile is provided for common tasks:
# Show available commands
# Format, lint, and test
# Build release
# Run example
🏗️ Architecture
This is a dual-binary Cargo workspace with ~80% code reuse:
rust_filesearch/
├── src/
│ ├── bin/
│ │ ├── fexplorer.rs # fexplorer CLI entry point
│ │ └── px.rs # px CLI entry point
│ ├── lib.rs # Shared library interface
│ ├── cli.rs # Shared argument parsing (clap)
│ ├── errors.rs # Shared error types (thiserror)
│ ├── models.rs # Shared data structures
│ ├── config.rs # Shared config (fexplorer + px)
│ ├── util.rs # Shared utilities
│ ├── fs/
│ │ ├── traverse.rs # Directory traversal (used by both)
│ │ ├── filters.rs # Predicate-based filtering
│ │ ├── metadata.rs # Cross-platform metadata
│ │ ├── size.rs # Directory size calculation
│ │ ├── git.rs # Git operations (used by both)
│ │ └── watch.rs # Filesystem watching (feature-gated)
│ ├── output/
│ │ ├── format.rs # OutputSink trait
│ │ ├── pretty.rs # Colored terminal output
│ │ ├── json.rs # JSON & NDJSON formatters
│ │ └── csvw.rs # CSV formatter
│ └── px/
│ ├── commands.rs # px command implementations
│ ├── project.rs # Project model with git status
│ ├── index.rs # Project index with JSON caching
│ ├── search.rs # Fuzzy search with SkimMatcherV2
│ └── frecency.rs # Firefox-style frecency algorithm
├── tests/
│ └── integration_tests.rs # E2E tests with assert_cmd
└── Cargo.toml # Workspace with [[bin]] entries
Key Design Decisions:
- Dual binary approach: Separate binaries sharing 80%+ infrastructure
- Git integration reuse: Both tools use same git operations from
fs/git.rs - Config separation:
PxConfigfor px, existing config for fexplorer - JSON caching: px uses
~/.cache/px/projects.jsonfor fast startup - Frecency algorithm: Firefox-style ranking (frequency + recency)
📈 Performance
fexplorer Performance
- Streaming architecture: Processes entries as they're discovered, minimizing memory usage
- Parallel traversal (optional): Leverages rayon and jwalk for multi-threaded directory walking
- Zero-copy where possible: Uses references and borrows to avoid unnecessary clones
- Respects .gitignore: Skips ignored paths early, reducing I/O
Benchmarks (tested on ~50,000 files):
| Command | Time (Cold Cache) | Time (Warm Cache) |
|---|---|---|
find . (GNU find) |
850ms | 120ms |
fexplorer list . |
780ms | 110ms |
fexplorer list . --features parallel |
420ms | 65ms |
px Performance
- JSON caching: Fast startup (~10ms) after initial sync
- Parallel scanning: Uses rayon + jwalk for multi-threaded project discovery
- Respects gitignore: Skips ignored directories during sync
- Fuzzy matching: SkimMatcherV2 provides fast substring matching
Real-World Results:
| Operation | Projects | Time |
|---|---|---|
px sync (4 scan dirs) |
243 | 12.02s |
px list (cached) |
243 | 10ms |
px open <query> |
243 | 15ms |
px info <query> |
243 | 12ms |
Memory usage: ~5MB for index with 243 projects
🛣️ Roadmap
Completed ✅
- Parallel traversal
- Template export (HTML/Markdown)
- Content search (grep)
- Duplicate file detection
- Git integration
- Config profiles
- px - Project switcher with frecency ⭐
In Progress 🚧
- TUI mode with interactive navigation
- Enhanced px features (Obsidian vault integration)
Planned 📋
- Archive support (zip, tar.gz)
- Configurable ignore patterns beyond .gitignore
- Export directory structure as JSON schema
- Plugin system for custom filters
- Publish to crates.io
📚 Documentation
Core Documentation
- docs/FEXPLORER_USER_GUIDE.md - Complete fexplorer guide
- docs/PX_USER_GUIDE.md - Complete px guide
- docs/WORKFLOWS.md - Combined workflows using both tools ⭐
Additional Resources
- docs/QUICK_START.md - Quick reference guide
- docs/INSTALLATION.md - Detailed installation
- docs/ - Complete documentation index
🤝 Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes with tests
- Run
cargo fmt && cargo clippy && cargo test - Submit a pull request
📄 License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
🙏 Acknowledgments
Built with these excellent crates:
Core Dependencies (Both Tools)
- clap - Command-line argument parsing
- ignore - Gitignore support from ripgrep
- walkdir - Filesystem traversal
- serde - Serialization framework
- chrono - Date and time library
- rayon - Data parallelism
- git2 - Git operations via libgit2
fexplorer-Specific
- notify - Filesystem notifications
px-Specific
- fuzzy-matcher - Fuzzy string matching
- toml - Configuration parsing
Made with 🦀 and ❤️ by Rust enthusiasts