A CLI that watches a folder and automatically moves incoming files to destination folders based on their extension. Works on macOS, Linux, and Windows.
Useful with Syncthing or LocalSend to auto-move files received from your phone.
macOS / Linux
curl -fsSL https://raw.githubusercontent.com/jensrot/move-files/main/install.sh | bashIf move-files is not found after install, add this to your ~/.zshrc or ~/.bashrc:
export PATH="$HOME/.local/bin:$PATH"Windows (PowerShell)
Invoke-WebRequest -Uri https://raw.githubusercontent.com/jensrot/move-files/main/install.ps1 -OutFile install.ps1
powershell -ExecutionPolicy Bypass -File install.ps1Requires Python 3.10+. Both installers create an isolated virtual environment — no sudo or admin rights needed.
move-files # interactive menu
move-files --dry-run # preview what would be moved
move-files sync # move all files in the input folder once
move-files watch # auto-move files as they arrive
move-files watch -i <dir> # watch a specific folder
move-files return # move files back to the input folderEdit INPUT_FOLDER, OUTPUT_FOLDERS, and FALLBACK_FOLDER at the top of move-files.py to change where file types go:
INPUT_FOLDER = "~/Downloads/phone"
OUTPUT_FOLDERS = {
".jpg": "~/Pictures/phone",
".jpeg": "~/Pictures/phone",
".png": "~/Pictures/phone",
".gif": "~/Pictures/phone",
".heic": "~/Pictures/phone",
".mp4": "~/Movies/phone",
".mov": "~/Movies/phone",
".pdf": "~/Documents/phone",
".txt": "~/notes_phone",
}
FALLBACK_FOLDER = "~/Downloads/moved"Syncthing (recommended — fully automatic)
Install Syncthing on your computer:
| Platform | Command |
|---|---|
| macOS | brew install syncthing && brew services start syncthing |
| Linux | sudo apt install syncthing && syncthing & |
| Windows | Download from syncthing.net and run |
Then:
- Open
http://127.0.0.1:8384and install Syncthing on Android (Play Store) - Link devices and share a folder from Android to
~/Downloads/phone - Run
move-files watch -i ~/Downloads/phone
Files sync automatically over WiFi — no manual steps after setup.
LocalSend (manual send each time)
Install LocalSend on your computer:
| Platform | Command |
|---|---|
| macOS | brew install --cask localsend |
| Linux | Download the .AppImage from localsend.org |
| Windows | winget install localsend.localsend |
Then:
- Install LocalSend on Android (Play Store)
- Both devices on the same WiFi, both apps open
- Share any file → LocalSend → pick your computer
- Run
move-filesto move what arrived
pip install -r requirements-dev.txt
pytest tests/ -v- macOS, Linux, or Windows
- Python 3.10+
click(installed automatically)