Smart Directory and File Organizer with OpenAI π
A powerful utility to analyze, restructure, and organize your file directories using OpenAI. OrgaNizeAI helps you achieve a cleaner, more logical organization while providing full control over the process.
-
Analyze and Suggest Structure π Automatically generates a new logical folder structure based on your source directory. Uses OpenAIβs powerful language models for smarter file organization suggestions.
-
Flexible Preview and Confirmation β Preview the proposed organization in the terminal. Choose to accept, regenerate, or exit without applying any changes.
-
Apply New Structure π¦ Once accepted, the tool copies files from the source to the target directory in the newly organized structure.
-
Cross-Platform Compatibility π Supports file paths on Linux, Windows, and macOS.
-
Customizable Paths π οΈ Easily define source and target directories via environment variables or command-line arguments.
-
Clone the Repository
git clone https://github.com/jorcelinojunior/OrgaNizeAI.git cd OrgaNizeAI
-
Install Dependencies
npm install
-
(Optional) Build If you plan to run or deploy this in a TypeScript-compiled environment, execute:
npm run build
This step will generate compiled JavaScript in the
dist
folder.
-
Environment Variables
- Copy
.env.example
to.env
in the project root. - Define your custom environment variables (e.g.,
SOURCE_DIR
,TARGET_DIR
,OPENAI_API_KEY
). - If these variables are missing, the tool may not run correctly.
- Copy
-
Sample
.env
SOURCE_DIR=./_example/source TARGET_DIR=./_example/target OPENAI_API_KEY=sk-xxxxxx
Note: Do not commit sensitive information like API keys into your repository.
-
Start the Application
npm start
-
Follow On-Screen Prompts
- The tool will list the newly proposed structure in the console.
- You can choose to
[A]ccept
,[G]enerate again
, or[E]xit
.
-
Result
- If you accept, a new organized directory (specified by
TARGET_DIR
) will be created and populated accordingly. - The original
SOURCE_DIR
remains untouched.
- If you accept, a new organized directory (specified by
--- Source Directory (Before Organization) ---
source/
βββ Interstellar - Hans Zimmer Live in Prague.mp4
βββ Lorem Ipsum Project
β βββ readme.md
β βββ src
β β βββ index.js
β βββ todo.txt
βββ finances-2025.xlsx
βββ images
β βββ logo1.png
β βββ logo2.png
β βββ vacation
β βββ vacation-photo1.jpg
β βββ vacation-photo2.jpg
βββ interstellar-movie.mov
βββ interstellar-resume.txt
βββ oppenheimer-movie.flv
βββ oppenheimer-resume.txt
βββ quick notes.txt
--- Proposed New Structure ---
destination/
βββ Movies
β βββ Interstellar - Hans Zimmer Live in Prague.mp4
β βββ interstellar-movie.mov
β βββ oppenheimer-movie.flv
βββ Projects
β βββ Lorem Ipsum Project
β βββ readme.md
β βββ src
β β βββ index.js
β βββ todo.txt
βββ Finances
β βββ finances-2025.xlsx
βββ Notes
β βββ quick notes.txt
β βββ interstellar-resume.txt
β βββ oppenheimer-resume.txt
βββ Images
βββ logo1.png
βββ logo2.png
βββ Vacation
βββ vacation-photo1.jpg
βββ vacation-photo2.jpg
Click to expand
Choose an option: [A]ccept, [G]enerate again, [E]xit: A
Copied file from "Interstellar - Hans Zimmer Live in Prague.mp4" to "Movies/Interstellar - Hans Zimmer Live in Prague.mp4"
Copied file from "interstellar-movie.mov" to "Movies/interstellar-movie.mov"
Copied file from "oppenheimer-movie.flv" to "Movies/oppenheimer-movie.flv"
Copied file from "Lorem Ipsum Project/readme.md" to "Projects/Lorem Ipsum Project/readme.md"
Copied file from "Lorem Ipsum Project/src/index.js" to "Projects/Lorem Ipsum Project/src/index.js"
Copied file from "Lorem Ipsum Project/todo.txt" to "Projects/Lorem Ipsum Project/todo.txt"
Copied file from "finances-2025.xlsx" to "Finances/finances-2025.xlsx"
Copied file from "quick notes.txt" to "Notes/quick notes.txt"
Copied file from "interstellar-resume.txt" to "Notes/interstellar-resume.txt"
Copied file from "oppenheimer-resume.txt" to "Notes/oppenheimer-resume.txt"
Copied file from "images/logo1.png" to "Images/logo1.png"
Copied file from "images/logo2.png" to "Images/logo2.png"
Copied file from "images/vacation/vacation-photo1.jpg" to "Images/Vacation/vacation-photo1.jpg"
Copied file from "images/vacation/vacation-photo2.jpg" to "Images/Vacation/vacation-photo2.jpg"
Files successfully reorganized.
-
Ignore List for API Requests Configure files/directories to exclude from the suggestions (e.g.,
.git/
, large media). -
Ignore List for Destination Define files/directories that should not be copied to the new structure.
-
Extended Error Handling Improve logging and error reporting for problematic file operations.
-
Additional CLI Options Provide command-line flags for skipping prompts or specifying custom organization rules.
Check the full history and release notes in the CHANGELOG.md
.
We welcome all contributions! Please read the CONTRIBUTING.md
file for guidelines on how to get started, coding standards, and more.
This project is licensed under the MIT License. Feel free to use, modify, and distribute this code for personal or commercial projects.