Terminal-based automated file organizer that watches folders and applies rules to move, copy, rename, or delete files based on patterns
Hazelnut is a terminal-based automated file organizer inspired by Hazel. It monitors specified directories for file changes and automatically applies user-defined rules to organize files based on conditions like filename patterns, extensions, size, age, and file type. The tool can move, copy, rename, delete, archive files, send them to trash, or execute custom scripts when conditions are met.
The tool provides both a TUI interface for real-time monitoring and rule management, and a background daemon (hazelnutd) that runs continuously. Rules support glob patterns and regex matching, multiple extension matching, size conditions (greater/less than specified bytes), and age-based filtering. Actions include moving files across filesystems, creating destination directories automatically, and variable substitution in rename patterns using tokens like {date}, {name}, and {ext}.
Configuration is managed through TOML files located at ~/.config/hazelnut/config.toml. Watch folders can be configured with recursive monitoring and rule-specific filtering. The TUI includes 15 built-in themes, desktop notifications for errors, activity logging, and editors for both watch folders and rules. The daemon component is available on macOS and Linux, while Windows supports only the TUI interface.
# via Homebrew
brew install ricardodantas/tap/hazelnut
# via Cargo
cargo install hazelnut
# via Arch Linux
pacman -S hazelnut