Skip to main content

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

Metadata

Release files for foldr 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foldr 0.2.1
File Size Uploaded
foldr-0.2.1.tar.gz 42.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foldr 0.2.1
File Interpreter ABI Platform
foldr-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.0 kB

Release files / foldr-0.2.1.tar.gz

Download URL foldr-0.2.1.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
81b69781bc0caf4b6b778bc8c0b8fb490d95e61568c78a7bf2e82654c470fc13
BLAKE2b-256 checksum
How to use checksums
5b17b38ee62d96229c371abe415a6b327aba45ab0b83be125329f6fb9b03b213
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / foldr-0.2.1-py3-none-any.whl

Download URL foldr-0.2.1-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efe3407654e2f825d4a71c5d8e191503c6df2a74900d76dec53de3d3abb3df9d
BLAKE2b-256 checksum
How to use checksums
f1384e84fef84daddaf605cd6dd03ecea8a29049705f9f179d98e60c90f4f984
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page