hazelnut

Terminal-based automated file organizer that watches folders and applies rules to move, copy, rename, or delete files based on patterns

install

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.

Installation

# via Homebrew
brew install ricardodantas/tap/hazelnut
# via Cargo
cargo install hazelnut
# via Arch Linux
pacman -S hazelnut

Alternatives & related tools

add a badge to your README

Maintain hazelnut? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/hazelnut.svg)](https://www.trmn.sh/tools/hazelnut?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/hazelnut?utm_source=badge"><img src="https://www.trmn.sh/badge/hazelnut.svg" alt="Featured on trmn" height="20"></a>