dokk

Command-line tool

Example page

The project, data and links on this page are made up, to show what dokk’s components can do. It does not document dokk itself.

tidy sorts the files in a folder into subfolders by type and date. This page is its documentation.

Install #

brew install tidy

Check that it works:

tidy --version

Quick start #

  1. Go to a messy folder: cd ~/Downloads.
  2. See what tidy would do, without moving anything: tidy --dry-run.
  3. Sort the files for real: tidy.
  4. Changed your mind? tidy undo puts everything back.

Commands #

Command What it does
tidy [folder] Sort the files in a folder; the current one by default.
tidy undo Undo the last run.
tidy rules Show the rules tidy uses, and where they come from.
tidy watch [folder] New Keep sorting new files as they arrive.

Options #

Option Default What it does
-n, --dry-run off Show the moves without making them.
--by type Group by type, date or type,date.
--keep none Leave files matching a pattern, such as --keep "*.part".
-q, --quiet off Only print errors.
Tip

Stop tidy watch with Ctrl+C. It finishes the move it is busy with first.

Configuration #

tidy reads tidy.toml from the folder it sorts, then from your config folder. A file in the folder wins.

  • ~/.config/tidy/
    • tidy.tomlyour defaults
  • ~/Downloads/
    • tidy.tomlrules for this folder only
    • images/
    • documents/
    • …
tidy.toml
by = "type,date"

[folders]
images = ["jpg", "png", "heic"]
documents = ["pdf", "docx", "md"]
Shell completion

Add one line to your shell’s startup file, then open a new terminal:

eval "$(tidy completion zsh)"
Caution

tidy never deletes files, but it does move them. Run it with --dry-run first on a folder that other programs write to.