Sortie
Intelligent rule-based file dispatcher for organizing directories like ~/Downloads and ~/Desktop.
Overview
Sortie is a declarative, rule-based file routing utility written in Go. It runs as a background service or on-demand command to keep your clutter directories (like ~/Downloads and ~/Desktop) immaculately organized.
Sortie evaluates files against custom pattern recipes, metadata conditions, and timestamps to move, tag, archive, or process matching incoming assets.
Features
- Declarative YAML Rules: Define clean rule sets with condition matching on file extensions, MIME types, regex names, sizes, and age.
- Atomic Operations: Renames and file transfers are verified for data integrity before removing source assets.
- Service Integration: Native integration with macOS
launchdand Linuxsystemdto monitor directories in real time using kernel event listeners (fsevents/inotify). - Dry-Run Mode: Test rules against existing directories safely before applying changes:
sortie run --dry-run. - Conflict Resolution: Configurable collision handling (auto-numbering, timestamp suffixing, or overwriting).
Installation
$ brew tap tanagersoftware/tap
$ brew install sortieOr build from source via Go:
$ go install github.com/msjurset/sortie@latestQuickstart
Initialize a starter configuration file at ~/.config/sortie/config.yaml:
$ sortie init
$ sortie watch ~/DownloadsSample configuration:
rules:
- name: Organize DMG Installers
match:
extensions: [dmg, pkg]
action:
move: ~/Downloads/Installers/
- name: Clean Old Screenshots
match:
name_pattern: "^Screen Shot.*\\.png$"
age_days: "> 14"
action:
archive: ~/Pictures/Screenshots/Archive/