Skip to content

Automatically organize files using declarative rules

License

Notifications You must be signed in to change notification settings

prettymuchbryce/autotidy

Repository files navigation

autotidy

autotidy

Automatically organize files using declarative rules

License: MIT unit tests install tests Release

About

autotidy is a cross-platform file organization daemon. Define rules in YAML, and it watches your folders for changes, moving, renaming, or organizing files as they appear.

  • Automatic - Runs in the background, watching directories. Triggers your rules when contents change.
  • Declarative - Define your rules in YAML. No code required.
  • Filters - Match files by name, extension, size, date, MIME type, file type.
  • Actions - Move, copy, rename, delete, and trash files that pass your filters.
  • Standalone - Standalone compiled binary. No runtime dependencies.
  • Dry-run - Preview what your config would do before running it with autotidy run.
  • Cross-platform - Linux, macOS, Windows (experimental)
  • Open source - MIT licensed

Examples

Below are some example rules. Rules are defined in a config.yaml file.

# Organize downloads by extension
rules:
 - name: Organize Downloads
   locations: ~/Downloads
   filters:
     - extension: [pdf, doc, docx]
   actions:
     - move: ~/Documents
# Sort images by date taken
rules:
 - name: Sort Photos
   locations: ~/Downloads
   recursive: true
   filters:
     - extension: [jpg, jpeg, png, heic]
   actions:
     - move: ~/Pictures/%Y/%B  # e.g., ~/Pictures/2024/January
# Trash old Downloads
rules:
 - name: Trash old downloads
   locations: ~/Downloads
   filters:
     - date_created:
         before:
           days_ago: 90
   actions:
     - trash
# Backup images or videos (OR logic with any:)
# Copy the file, then move the copy to the backups directory
rules:
 - name: Backup Media
   locations: ~/Downloads
   filters:
     - any:
         - mime_type: "image/*"
         - mime_type: "video/*"
   actions:
     - copy: "${name}_backup${ext}"
     - move: ~/backups

You can find an exhaustive list of configuration options here.

Quick start

Homebrew (macOS)

brew install prettymuchbryce/tap/autotidy
brew services start autotidy
autotidy status

Nix (Home Manager)

{
  inputs.autotidy.url = "github:prettymuchbryce/autotidy";

  imports = [ inputs.autotidy.homeModules.default ];

  services.autotidy.enable = true;
}

Linux

curl -fsSL https://raw.githubusercontent.com/prettymuchbryce/autotidy/master/install/linux/install.sh | sh

Windows

irm https://raw.githubusercontent.com/prettymuchbryce/autotidy/master/install/windows/install.ps1 | iex

Additional installation information can be found here.

Configuration path

By default, rules are defined in the following locations:

Platform Default Path
Linux ~/.config/autotidy/config.yaml
macOS ~/.config/autotidy/config.yaml
Windows %APPDATA%\autotidy\config.yaml

The default rule file contains no enabled rules, but does include some commented-out examples.

CLI Usage

autotidy status      Print status information
autotidy help        Show available commands
autotidy disable     Temporarily pause rule execution
autotidy enable      Resume rule execution (if it was previously disabled)
autotidy reload      Reload the daemon\'s rules from configuration
autotidy run         Perform a one-off run or dry run of rules

Documentation

Full documentation is available here.

Quick links

Inspired By

autotidy was inspired by tools like Hazel, Maid, and organize.

autotidy logo designed by Aaron Ng

About

Automatically organize files using declarative rules

Resources

License

Stars

Watchers

Forks

Packages

No packages published