A real-time CLI tool for watching file changes and visualizing diffs in your terminal.
- Real-time file watching with platform-native notifications
- Live diff visualization with colored output
- Recursive subdirectory watching
- Smart file filtering (ignores shell history, lock files, temp files)
- Event coalescing to handle rapid file changes
- 1MB file size limit for graceful handling of large files
- Beautiful TUI built with Bubbletea
- Binary file detection
- Automatic permission error handling
brew install deemkeen/tap/diffwatchgo install github.com/deemkeen/diffwatch/cmd/diffwatch@latestDownload the pre-built binary for your platform from the latest release.
git clone https://github.com/deemkeen/diffwatch.git
cd diffwatch
go build -o bin/diffwatch ./cmd/diffwatchWatch the current directory:
diffwatchWatch a specific directory:
diffwatch -p /path/to/directory
# or
diffwatch -path /path/to/directoryWatch all subdirectories recursively:
diffwatch -p /path/to/directory -r
# or
diffwatch -path /path/to/directory -recursive-p,-path- Path to watch for changes (default: current directory)-r,-recursive- Watch all subdirectories recursively (default: false)-h- Show help
qorCtrl+C- Quit the application
File Change → fsnotify → Debouncer → State Manager → Diff Engine → TUI
- File Watcher - Monitors files using platform-native APIs (inotify, FSEvents, etc.)
- Event Coalescing - Batches rapid changes within a 200ms window to prevent TUI flicker
- File Filtering - Automatically ignores noisy files (shell history, lock files, temp files)
- State Manager - Tracks file contents for comparison
- Diff Engine - Computes unified diffs between versions
- TUI Renderer - Displays colorized diffs in real-time with file status
DiffWatch automatically ignores common noisy files:
- Shell history files (
.zsh_history,.bash_history, etc.) - Lock files (
*.lock,*.LOCK) - Vim/Emacs temporary files (
.*.swp,#*#,*~) - Common dotfiles (
.lesshst,.viminfo,.recently-used) - Build directories (
.git,node_modules,.cache, etc.)
MIT
