| Crates.io | vibewatch |
| lib.rs | vibewatch |
| version | 0.5.0 |
| created_at | 2025-10-05 20:04:47.782453+00 |
| updated_at | 2025-10-17 04:35:28.099214+00 |
| description | A file watcher utility with glob pattern support |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1869396 |
| size | 259,279 |
A fast and extensible file watcher utility built in Rust with glob pattern support and cross-platform compatibility.
--on-create, --on-modify, --on-delete, --on-change){file_path}, {relative_path}, {absolute_path}, {event_type} in commands*.rs, node_modules/**cargo install vibewatch
Download pre-built binaries from the latest release.
Available platforms:
.tar.gz).tar.gz).zip)# Example: Linux x86_64
wget https://github.com/rodrigogs/vibewatch/releases/latest/download/vibewatch-x86_64-unknown-linux-gnu.tar.gz
tar -xzf vibewatch-x86_64-unknown-linux-gnu.tar.gz
sudo mv vibewatch /usr/local/bin/
# Example: macOS ARM (Apple Silicon)
wget https://github.com/rodrigogs/vibewatch/releases/latest/download/vibewatch-aarch64-apple-darwin.tar.gz
tar -xzf vibewatch-aarch64-apple-darwin.tar.gz
sudo mv vibewatch /usr/local/bin/
Make sure you have Rust installed via mise or rustup:
# Clone and build
git clone https://github.com/rodrigogs/vibewatch.git
cd vibewatch
cargo build --release
vibewatch includes significant performance optimizations:
Run comprehensive benchmarks yourself:
cargo bench # All benchmarks
cargo bench --bench template_substitution # Specific suite
The benchmark suite includes:
The primary use case is executing commands when files change:
# Run tests on any change
vibewatch . --on-change "npm test"
# Format Rust files when modified
vibewatch src --include "*.rs" --on-modify "rustfmt {file_path}"
# Run linter on TypeScript files (using brace expansion)
vibewatch . --include "*.{ts,tsx}" --exclude "node_modules/**" --on-modify "npx eslint {file_path} --fix"
# Different commands for different events
vibewatch src \
--on-create "git add {file_path}" \
--on-modify "cargo check" \
--on-delete "echo Removed: {relative_path}"
Available Templates:
{file_path} - Full path to the changed file{relative_path} - Path relative to watched directory{absolute_path} - Absolute path to the changed file{event_type} - Type of event (create, modify, delete)Brace Expansion: You can use brace expansion syntax for convenience with both --include and --exclude patterns:
# Include patterns - these are equivalent:
vibewatch . --include "*.{ts,tsx}"
vibewatch . --include "*.ts" --include "*.tsx"
# Works with multiple extensions:
vibewatch . --include "*.{js,jsx,ts,tsx}"
# Works with paths:
vibewatch . --include "src/**/*.{rs,toml}"
# Exclude patterns - these are equivalent:
vibewatch . --exclude "{target,dist,node_modules}/**"
vibewatch . --exclude "target/**" --exclude "dist/**" --exclude "node_modules/**"
# Combined include and exclude with brace expansion:
vibewatch . --include "src/**/*.{rs,toml}" --exclude "{target,build}/**"
Watch a directory and log all file changes (no commands):
vibewatch /path/to/directory
Watch only specific file types:
vibewatch /path/to/directory --include "*.rs" --include "*.ts"
Ignore common directories and files:
vibewatch /path/to/directory --exclude "node_modules/**" --exclude ".git/**" --exclude "target/**"
Use both include and exclude patterns:
vibewatch . \
--include "*.rs" \
--include "*.ts" \
--include "*.tsx" \
--exclude "target/**" \
--exclude "node_modules/**" \
--verbose
Directory:
<DIRECTORY>: Directory to watch (can be relative or absolute)Command Execution:
--on-create <COMMAND>: Run command when files are created--on-modify <COMMAND>: Run command when files are modified--on-delete <COMMAND>: Run command when files are deleted--on-change <COMMAND>: Run command on any file change (fallback)Filtering:
-i, --include <PATTERN>: Include patterns like *.ts, *.rs (use multiple times for multiple patterns)-e, --exclude <PATTERN>: Exclude patterns like node_modules/**, .git/**, .next/**General:
-v, --verbose: Enable verbose output with debug logging-q, --quiet: Suppress command output (only show file events and status)-h, --help: Show help message-V, --version: Show version informationvibewatch provides objective, timestamp-based logs for monitoring and automation:
File Events:
[2025-10-06T14:23:15] [CREATED] src/main.rs
[2025-10-06T14:23:16] [MODIFIED] src/watcher.rs
[2025-10-06T14:23:17] [DELETED] tmp/test.txt
Command Execution:
[2025-10-06T14:23:15] Executing command: cargo build
<command output appears here>
[2025-10-06T14:23:18] Command succeeded (exit code: 0)
Command Failure:
[2025-10-06T14:23:19] Executing command: cargo check
<error output appears here>
[2025-10-06T14:23:20] Command failed (exit code: 1)
Features:
[YYYY-MM-DD)--quiet to suppress command output, keeping only events and statusvibewatch src \
--include "*.{ts,tsx}" \
--exclude "node_modules/**" --exclude "dist/**" \
--on-modify "npx prettier --write {file_path}"
vibewatch . \
--include "*.rs" --include "Cargo.toml" \
--exclude "target/**" \
--on-change "cargo test"
vibewatch docs \
--include "*.md" --include "*.rst" \
--exclude "_build/**" \
--on-change "mdbook build"
vibewatch src \
--include "*.js" --include "*.json" \
--exclude "node_modules/**" \
--on-change "pkill -f 'node server.js' && node server.js &"
vibewatch src \
--on-create "git add {file_path} && git commit -m 'Add {relative_path}'"
The application is structured for extensibility:
main.rs: CLI argument parsing and application entry pointwatcher.rs: Core file watching logic using the notify cratefilter.rs: Glob pattern matching for include/exclude functionalitynode_modules/** - Node.js dependencies.git/** - Git repository files.next/** - Next.js build filestarget/** - Rust build directorydist/** - Build output directory{target,dist,build}/** - Multiple build directories (brace expansion)*.tmp - Temporary files*.swp - Vim swap files*.{tmp,swp,bak} - Multiple temporary file types (brace expansion)*.rs - Rust source files*.{ts,tsx} - TypeScript files (brace expansion supported)*.{js,jsx} - JavaScript files (brace expansion supported)*.py - Python files*.go - Go files*.{cpp,c,h} - C/C++ files (brace expansion supported)*.md - Markdown filesNote: Brace expansion like *.{ext1,ext2} or {dir1,dir2}/** works with both --include and --exclude patterns. The syntax is automatically expanded to multiple patterns before glob compilation. You can also use multiple flags if you prefer explicit patterns.
The following features are planned for future releases:
.vibewatch.toml.gitignore, .watchignore patternsmise)The project uses just for task automation:
# Install just (if not already installed)
cargo install just
# or: brew install just
# List all available tasks
just --list
# Common tasks
just test # Run all tests
just coverage # Generate coverage report
just lint # Run linter
just check # Run all checks (fmt, lint, test)
just demo # Run vibewatch on src/ directory
# Run all tests (187 total: 140 unit + 21 filesystem + 26 integration)
cargo test
# or: just test
# Run tests with output
cargo test -- --nocapture
# or: just test-verbose
# Run specific test suite
cargo test --test it # Integration tests only
# or: just test-integration test_name
The project maintains 90.95% code coverage (1096/1205 lines):
# Generate coverage report
cargo llvm-cov --all-features --workspace --html
# View report
open target/llvm-cov/html/index.html
Coverage by file:
filter.rs: 100.00% (177/177) ✅main.rs: 97.67% (252/258) ✅watcher.rs: 86.62% (667/770) ✅Note: The watcher.rs coverage is lower due to command execution happening in spawned async tasks that are harder to test in unit tests. All command execution logic is thoroughly tested through our comprehensive integration test suite.
# Run with debug logging
RUST_LOG=debug cargo run -- /path/to/directory --verbose
# Build for release
cargo build --release
# Run linter
cargo clippy
# Format code
cargo fmt
This project uses Conventional Commits for automated versioning and changelog generation.
Format: <type>(<optional scope>): <description>
Types:
feat: - New feature (triggers minor version bump)fix: - Bug fix (triggers patch version bump)docs: - Documentation changeschore: - Maintenance tasksrefactor: - Code refactoringtest: - Adding or updating testsfeat!: or fix!: - Breaking changes (triggers major version bump)Examples:
feat: add support for symlink watching
fix: resolve race condition in file detection
docs: update README with new examples
feat!: change CLI argument structure (breaking change)
Releases are fully automated via Release Please:
master is analyzedCARGO_TOKEN secret)Current version: v0.4.0 (October 2025)
Binary build tool: Uses taiki-e/upload-rust-binary-action for reliable cross-compilation
Branch Protection: Enabled on master with 6 required status checks
All PRs and pushes to master run:
cargo fmt --check)cargo clippy -D warnings)On release (after merging Release PR):
Release Process:
RELEASE_PLEASE_TOKEN)See docs/CI_CD.md for complete CI/CD architecture documentation.
For comprehensive technical documentation:
docs/CI_CD.md - Complete CI/CD pipeline, release process, branch protection (v2.0)docs/TESTING.md - Test organization, best practices, and quick referencedocs/COVERAGE.md - Detailed coverage metrics and industry benchmarksdocs/INTEGRATION_TEST.md - Testing research, rationale, and best practicesdocs/JUSTFILE_IMPLEMENTATION.md - Task runner implementation and benefits