Skip to content

Smart Directory and File Organizer powered by OpenAI, written in TypeScript and Node.js.

License

Notifications You must be signed in to change notification settings

jorcelinojunior/OrgaNizeAI

Repository files navigation

OrgaNizeAI Logo

OrgaNizeAI

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.

OpenAI API Node.js TypeScript PRs Welcome Issues License


Table of Contents πŸ“–


Features ✨

  1. 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.

  2. Flexible Preview and Confirmation βœ… Preview the proposed organization in the terminal. Choose to accept, regenerate, or exit without applying any changes.

  3. Apply New Structure πŸ“¦ Once accepted, the tool copies files from the source to the target directory in the newly organized structure.

  4. Cross-Platform Compatibility 🌐 Supports file paths on Linux, Windows, and macOS.

  5. Customizable Paths πŸ› οΈ Easily define source and target directories via environment variables or command-line arguments.


Installation βš™οΈ

  1. Clone the Repository

    git clone https://github.com/jorcelinojunior/OrgaNizeAI.git
    cd OrgaNizeAI
  2. Install Dependencies

    npm install
  3. (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.


Configuration πŸ› οΈ

  1. 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.
  2. 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.


Usage πŸ“‚

  1. Start the Application

    npm start
  2. 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.
  3. Result

    • If you accept, a new organized directory (specified by TARGET_DIR) will be created and populated accordingly.
    • The original SOURCE_DIR remains untouched.

Examples πŸ“

Source Directory (Before Organization)

--- 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 Structure (Generated by OpenAI)

--- 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

Logs (option [A]ccept chosen)

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.

Roadmap πŸ›£οΈ

  • 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.


Changelog πŸ“†

Check the full history and release notes in the CHANGELOG.md.


Contributing 🀝

We welcome all contributions! Please read the CONTRIBUTING.md file for guidelines on how to get started, coding standards, and more.


License πŸ“œ

This project is licensed under the MIT License. Feel free to use, modify, and distribute this code for personal or commercial projects.