Skip to main content

Clean folders instantly with preview and full undo — fast, safe, cross-platform.

Project description

FOLDR

PyPI Version Python License PyPI Downloads Platform Ask DeepWiki Sponsor

Smart, safe, cross-platform CLI file organizer.

FOLDR cleans messy directories by sorting files into category folders — instantly, predictably, and safely. Preview every action before anything moves. Undo anything. Watch a folder and keep it tidy automatically.

Installation · Quick Start · All Commands · Watch Mode · Undo & History · Configuration


Installation

pip install foldr

Requires Python 3.10+. Works on Windows, Linux, macOS


Quick Start

# Preview what would happen (nothing moves)
foldr ~/Downloads --preview

# Organize (shows preview, asks to confirm)
foldr ~/Downloads

# Undo the last operation
foldr undo

# Watch a folder — organize now and keep watching
foldr watch ~/Downloads

Paths with spaces must be quoted:

foldr "D:\My Downloads" --preview

All Commands

Organize

foldr <path>                          # organize (preview → confirm → move)
foldr <path> --preview                # dry-run: show plan, nothing moves
foldr <path> --recursive              # also organize subdirectories
foldr <path> --recursive --depth 2    # limit to 2 levels deep
foldr <path> --ignore "*.log" "tmp/"  # skip patterns this run
foldr <path> --no-ignore              # disable all ignore rules
foldr <path> --show-ignored           # list skipped files
foldr <path> --verbose                # print every file moved
foldr <path> --quiet                  # no output (for scripts / cron)
foldr <path> --config myconfig.toml   # use a custom category config

Duplicate removal

# ⚠ IRREVERSIBLE — always preview first
foldr <path> --dedup keep-newest --preview
foldr <path> --dedup keep-newest      # delete older copies
foldr <path> --dedup keep-largest     # delete smaller copies
foldr <path> --dedup keep-oldest      # delete newer copies

Watch mode

foldr watch <path>                    # organize now + keep watching
foldr watch <path> --recursive        # watch subdirectories too
foldr watch <path> --preview          # watch mode, log only (no moves)
foldr watches                         # list active watchers
foldr unwatch <path>                  # stop a specific watcher
foldr unwatch                         # interactive picker

Undo & History

foldr undo                            # undo the last operation
foldr undo --id a1b2c3                # undo a specific operation by ID
foldr undo --preview                  # show what would be restored
foldr history                         # list last 50 operations
foldr history --all                   # list all operations ever

Config

foldr config                          # show config file locations
foldr config --edit                   # open config.toml in your editor
foldr config --edit --ignore-file     # open .foldrignore in your editor

Watch Mode

Watch mode has two jobs: organize what's already there, then keep watching forever.

foldr watch ~/Downloads

When you run this:

  1. FOLDR organizes all existing files in ~/Downloads immediately (same as running foldr ~/Downloads).
  2. FOLDR then watches the folder in the background. Any file you drop, copy, or move into it gets organized automatically — within about one second.
  3. If you move an already-organized file back to the root, it gets re-organized again. No stale state.

The watcher runs until your machine shuts down or you stop it with foldr unwatch.

See all active watchers:

foldr watches

Stop watching:

foldr unwatch ~/Downloads

Watch logs (for debugging) live at:

~/.foldr/watch_logs/<dirname>.log

How It Works

Files are classified by extension and moved into category folders at the root of the target directory. Existing folders are never touched. Filename conflicts are resolved automatically by appending _(1), _(2), etc.

Default categories

Category Folder Common extensions
Documents Documents/ .pdf .doc .docx .odt .md .tex
Images Images/ .jpg .png .gif .webp .heic .raw
Videos Videos/ .mp4 .mkv .mov .avi .webm
Audio Audio/ .mp3 .wav .flac .aac .ogg
Archives Archives/ .zip .rar .7z .tar .gz
Code Code/ .py .js .ts .html .css .java .cpp
Scripts Scripts/ .sh .bash .ps1 .bat .cmd
Spreadsheets Spreadsheets/ .xlsx .xls .csv .ods
Presentations Presentations/ .pptx .ppt .odp
Databases Databases/ .db .sqlite .sqlite3
Executables Executables/ .exe .msi .deb .rpm .apk .dmg
Fonts Fonts/ .ttf .otf .woff .woff2
Ebooks Ebooks/ .epub .mobi .azw
Notebooks Notebooks/ .ipynb
Text & Data Text_Data/ .txt .json .xml .yaml .toml

Files with unrecognised extensions are left in place — never moved.


Undo & History

Every organize operation is saved to ~/.foldr/history/. You can undo any operation independently — no need to undo in order.

foldr history          # see what's available
foldr undo             # undo the most recent
foldr undo --id a1b2   # undo a specific one

If a file was moved again after the operation you're undoing, FOLDR skips it and tells you — it never blindly overwrites later changes.

Dedup cannot be undone--dedup permanently deletes files. Always --preview first.


Configuration

Custom categories

FOLDR auto-creates ~/.foldr/config.toml on first run. Edit it to add extensions or create your own categories:

[foldr]
merge = true   # true = extend built-ins | false = replace them

[Images]
extensions = [".heic", ".avif", ".raw"]   # adds to built-in Images

[RAW Photos]
folder     = "RAW_Photos"
extensions = [".cr2", ".nef", ".arw", ".dng", ".orf"]

[Design]
folder     = "Design"
extensions = [".fig", ".sketch", ".xd", ".psd", ".ai"]

Open in editor:

foldr config --edit

Ignore rules

Create ~/.foldr/.foldrignore (global, applies to all runs):

# ~/.foldr/.foldrignore
*.tmp
*.bak
desktop.ini
~$*
Thumbs.db

Or pass patterns for one run:

foldr ~/Downloads --ignore "*.log" "tmp/" "DO_NOT_MOVE*"

Disable all rules for one run:

foldr ~/Downloads --no-ignore

File locations

Platform Config History Watch logs
Linux / macOS ~/.foldr/config.toml ~/.foldr/history/ ~/.foldr/watch_logs/
Windows %USERPROFILE%\.foldr\config.toml %USERPROFILE%\.foldr\history\ %USERPROFILE%\.foldr\watch_logs\

Safety

  • Preview by default — FOLDR shows you what it will do and asks before moving anything.
  • Folders are never touched — only files are moved; directories stay where they are.
  • Conflict-safe — if a file with the same name already exists at the destination, FOLDR renames the incoming file (photo_(1).jpg, etc.) rather than overwriting.
  • Undo anything — every operation is reversible via foldr undo.
  • Dedup is the only irreversible action — always use --preview before --dedup.

Support

If FOLDR saves you time, consider supporting continued development:

❤️ github.com/sponsors/qasimio


Author

Muhammad Qasim GitHub: github.com/qasimio LinkedIn: linkedin.com/in/qasimio


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foldr-0.2.1.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

foldr-0.2.1-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file foldr-0.2.1.tar.gz.

File metadata

  • Download URL: foldr-0.2.1.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for foldr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 81b69781bc0caf4b6b778bc8c0b8fb490d95e61568c78a7bf2e82654c470fc13
MD5 4c1c9ca5171018b1cfa8d486d366611b
BLAKE2b-256 5b17b38ee62d96229c371abe415a6b327aba45ab0b83be125329f6fb9b03b213

See more details on using hashes here.

File details

Details for the file foldr-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: foldr-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for foldr-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 efe3407654e2f825d4a71c5d8e191503c6df2a74900d76dec53de3d3abb3df9d
MD5 ff43d51824da584a7678bd74e096284c
BLAKE2b-256 f1384e84fef84daddaf605cd6dd03ecea8a29049705f9f179d98e60c90f4f984

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page