ordr clean
Moves files matching your rules into their configured destinations. Creates destination directories automatically.
ordr clean [directory] [flags]If directory is omitted, the current working directory is used.
Flags
| Flag | Short | Default | Description |
|---|---|---|---|
--dry-run | -n | false | Preview what would happen without moving anything |
--recursive | -r | false | Recurse into subdirectories |
--global | -g | false | Also process rules that have explicit scope.dirs defined |
--rule <name> | Run only the rule with this name | ||
--yes | -y | false | Skip all confirmation prompts |
--verbose | -v | false | Show each file evaluated, not just moved files |
Behavior
- Loads and merges config (local
.ordrrc+ global~/.ordrrc) - Warns if the target directory is a git repo (requires
--yesor confirmation) - Builds an execution plan without touching the filesystem
- Prints the plan and asks for confirmation (unless
--yes) - Executes moves and saves them to
~/.ordr/undo.json
Examples
# Clean current directory (with confirmation)ordr clean
# Clean Desktop without confirmationordr clean ~/Desktop --yes
# Preview only — nothing is movedordr clean ~/Desktop --dry-run
# Clean recursivelyordr clean ~/Downloads --recursive
# Run only the "PDFs" ruleordr clean ~/Desktop --rule "PDFs to documents"
# Verbose: show every file evaluatedordr clean ~/Desktop --verboseOutput
Plan — 3 file(s) to move
~/Desktop/invoice.pdf → ~/Desktop/documents/invoice.pdf [PDFs to documents] ~/Desktop/photo.png → ~/Desktop/images/photo.png [Images] ~/Desktop/backup.zip → ~/Desktop/archives/backup.zip [Archives]
12 file(s) skipped (no matching rule)
? Move 3 file(s)? (Y/n)
✓ Moved 3 file(s). Run 'ordr undo' to reverse.Conflict resolution
When a file already exists at the destination, the rule’s options.on_conflict setting applies:
| Value | Behavior |
|---|---|
rename (default) | Appends (1), (2), etc. to the filename |
skip | Leaves the file in place |
overwrite | Replaces the existing file |
See Rule options for details.