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 launchd and Linux systemd to 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

zsh — install sortie
$ brew tap tanagersoftware/tap $ brew install sortie

Or build from source via Go:

zsh — go install
$ go install github.com/msjurset/sortie@latest

Quickstart

Initialize a starter configuration file at ~/.config/sortie/config.yaml:

zsh — sortie init
$ sortie init $ sortie watch ~/Downloads

Sample 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/