Organize your files with natural language instructions powered by AI
Project description
๐๏ธ ai-file-organizer
Organize any folder with a single natural language command โ in English or Japanese.
$ file-org "ใใฆใณใญใผใใใฉใซใใ็จฎ้กๅฅใซๆด็ใใฆ" ~/Downloads --dry-run
Organization Plan
โโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ Source โ โ Destination โ Reason โ
โโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโค
โ photo_2026.jpg โ images/photo_2026... โ JPEG image file โ
โ invoice_jan.pdf โ documents/invoice... โ PDF document โ
โ setup.exe โ installers/setup.exe โ Windows installer โ
โ vacation.mp4 โ videos/vacation.mp4 โ MP4 video file โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโ
Proceed with moving 4 file(s)? [y/N]:
โจ Features
- Natural language instructions โ type what you want, in any language
- Dry-run mode โ always preview before touching the filesystem
- Safe by design โ never overwrites files (auto-renames conflicts), never deletes
- OpenAI & X.AI (Grok) support โ plug in the API key you already have
- Structured LLM output โ deterministic JSON schema, not fragile text parsing
- Japanese (ๆฅๆฌ่ช) fully supported โ instructions, folder names, filenames
- Beautiful terminal UI โ powered by Rich
- Configurable โ exclude patterns, max files, per-project
.file-organizer.toml
๐ฆ Installation
pip / pipx (recommended)
# One-off use (recommended โ keeps your global Python clean)
pipx install ai-file-organizer
# Or with pip
pip install ai-file-organizer
Homebrew (macOS / Linux)
# Coming soon โ tap will be added after first PyPI release
brew install youi2000jp4/tap/ai-file-organizer
From source
git clone https://github.com/youi2000jp4/ai-file-organizer.git
cd ai-file-organizer
pip install -e ".[dev]"
๐ Quick Start
1. Set your API key
# OpenAI
file-org config set-key sk-...
# Or X.AI (Grok)
file-org config set-key xai-... --provider xai
file-org config set provider xai
# Or use environment variables
export OPENAI_API_KEY=sk-...
2. Organize!
# Preview first (always a good idea)
file-org "Sort by file type" ~/Downloads --dry-run
# Execute with confirmation
file-org "ใใฆใณใญใผใใใฉใซใใ็จฎ้กๅฅใซๆด็ใใฆ" ~/Downloads
# Skip confirmation prompt
file-org "Move PDFs to documents folder" ~/Desktop --yes
# Recursive (including subdirectories)
file-org "Group photos by year" ~/Pictures --recursive
# Use a different model
file-org "Clean up" --model gpt-4o
๐ Command Reference
Usage: file-org [OPTIONS] INSTRUCTION [TARGET]
Organize files with a natural language instruction.
Arguments:
INSTRUCTION Natural language instruction (Japanese OK) [required]
TARGET Target directory [default: current directory]
Options:
-n, --dry-run Preview changes without moving files
-y, --yes Skip confirmation prompt
-r, --recursive Scan subdirectories recursively
-m, --model TEXT Override LLM model
--max-files INT Max files to send to LLM [default: 300]
--help Show this message and exit.
Config subcommands:
file-org config show Show current configuration
file-org config set-key KEY Save API key
file-org config set KEY VALUE Set a config option
file-org config init Create default config file
โ๏ธ Configuration
Config is stored at ~/.config/file-organizer/config.toml.
API keys are stored in ~/.config/file-organizer/.env (chmod 600 โ never committed).
# ~/.config/file-organizer/config.toml
provider = "openai" # "openai" or "xai"
model = "gpt-4o-mini" # any model your provider supports
max_files = 300 # max files per LLM call
confirm_before_execute = true
exclude_patterns = [".DS_Store", "*.pyc", "node_modules"]
Per-project override
Place a .file-organizer.toml in any directory to override settings for that project:
# .file-organizer.toml
exclude_patterns = [".git", "*.log", "tmp"]
max_files = 50
๐ก๏ธ Safety
| Risk | Mitigation |
|---|---|
| Accidental overwrite | Files are never overwritten โ conflicts get a numeric suffix (file_1.txt) |
| Accidental delete | The tool only moves files. Deletion is not possible. |
| Hidden files | Hidden files (.dotfiles) are skipped unless explicitly included |
| Too many files | max_files limits LLM context. Extra files are skipped with a warning. |
| API errors | All LLM errors surface clearly; filesystem is not touched on failure |
Recommended workflow: always run with --dry-run first, review the table, then re-run without it.
๐ค Contributing
Contributions are welcome! See CONTRIBUTING.md for details.
git clone https://github.com/youi2000jp4/ai-file-organizer.git
cd ai-file-organizer
pip install -e ".[dev]"
pytest # run tests
ruff check . # lint
๐ License
MIT ยฉ ai-file-organizer contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ai_file_organizer-0.1.1.tar.gz.
File metadata
- Download URL: ai_file_organizer-0.1.1.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b058508b8e2b6c0f49f91ea8845668afa55b7b4cd89fee0f030b2050f7c38401
|
|
| MD5 |
22f30922341f8be19844a456cd81d883
|
|
| BLAKE2b-256 |
91a0c409d053dcef101e200f994f857c74cbe7f172d118bd7b9a8cc7d1955253
|
Provenance
The following attestation bundles were made for ai_file_organizer-0.1.1.tar.gz:
Publisher:
release.yml on youi2000jp4/ai-file-organizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_file_organizer-0.1.1.tar.gz -
Subject digest:
b058508b8e2b6c0f49f91ea8845668afa55b7b4cd89fee0f030b2050f7c38401 - Sigstore transparency entry: 1743826595
- Sigstore integration time:
-
Permalink:
youi2000jp4/ai-file-organizer@b0b2fd28ec6ac026762cd47ba48294a3c0016137 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/youi2000jp4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0b2fd28ec6ac026762cd47ba48294a3c0016137 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_file_organizer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ai_file_organizer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfc003b488df70ce655e8afa843d666f58563b280941784904bda2ffafef712c
|
|
| MD5 |
866fc5c8b1fdfecfb8ebbb656f5710a3
|
|
| BLAKE2b-256 |
b884e5b597cf92f31548abf9c7024e9be901266768c7bb1329d6f2600139137a
|
Provenance
The following attestation bundles were made for ai_file_organizer-0.1.1-py3-none-any.whl:
Publisher:
release.yml on youi2000jp4/ai-file-organizer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_file_organizer-0.1.1-py3-none-any.whl -
Subject digest:
dfc003b488df70ce655e8afa843d666f58563b280941784904bda2ffafef712c - Sigstore transparency entry: 1743826650
- Sigstore integration time:
-
Permalink:
youi2000jp4/ai-file-organizer@b0b2fd28ec6ac026762cd47ba48294a3c0016137 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/youi2000jp4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b0b2fd28ec6ac026762cd47ba48294a3c0016137 -
Trigger Event:
push
-
Statement type: