npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tidyai-ts

v1.1.1

Published

AI-powered cross-platform file organizer using OpenRouter API

Downloads

36

Readme

TidyAI-TS

████████╗██╗██████╗ ██╗   ██╗ █████╗ ██╗
╚══██╔══╝██║██╔══██╗╚██╗ ██╔╝██╔══██╗██║
   ██║   ██║██║  ██║ ╚████╔╝ ███████║██║
   ██║   ██║██║  ██║  ╚██╔╝  ██╔══██║██║
   ██║   ██║██████╔╝   ██║   ██║  ██║██║
   ╚═╝   ╚═╝╚═════╝    ╚═╝   ╚═╝  ╚═╝╚═╝

========================================
  Organize your files with AI power!
========================================

Organize your files with AI. Works everywhere. Powered by OpenRouter.

TidyAI-TS is a cross-platform CLI tool that uses AI to organize your messy folders. It leverages the OpenRouter API to analyze filenames and suggest logical folder structures, making file organization effortless and intelligent.

🌟 Features

  • AI-powered folder suggestions using OpenRouter API
  • Smart file sorting based on file extensions and AI classification
  • Undo system to revert changes
  • Delete unnecessary files (thumbs.db, .DS*Store, *.tmp, _.log, desktop.ini)
  • Cross-platform CLI (Windows, macOS, Linux)
  • Secure and private - only sends filenames to the AI, never file contents
  • Robust error handling with fallback to default suggestions
  • Beautiful CLI interface with progress indicators
  • ASCII art logo and colored output
  • Automatic logging of operations with timestamps
  • GitHub Actions for CI/CD and automatic releases

📦 Installation

Option 1: Download Standalone Executables (Recommended)

Download the standalone executable for your platform from the releases page:

  • Windows: tidyai-win.exe
  • macOS: tidyai-macos
  • Linux: tidyai-linux

These executables can be run directly without needing to install Node.js.

Option 2: Install from npm (Recommended for library usage)

npm install tidyai-ts

Or install globally:

npm install -g tidyai-ts

Option 3: Install from Local Directory

If you have the source code locally:

npm install -g /path/to/tidyai-ts

Option 4: Install from Git Repository

npm install -g git+https://github.com/pawan67/tidyai-ts.git

Option 5: Run with npx

Run directly from the local directory without installing:

npx . /path/to/folder

⚙️ Setup

  1. Get an API key from OpenRouter
  2. Set the API key as an environment variable (choose one method):

Method 1: Permanent Environment Variable (Recommended)

Windows (PowerShell):

# Set for current user (permanent)
[Environment]::SetEnvironmentVariable("TIDYAI_API_KEY", "your_openrouter_api_key", "User")

Windows (Command Prompt as Administrator):

setx TIDYAI_API_KEY "your_openrouter_api_key"

macOS/Linux:

# Add to your shell profile (~/.bashrc, ~/.zshrc, etc.)
echo 'export TIDYAI_API_KEY=your_openrouter_api_key' >> ~/.bashrc
source ~/.bashrc

Method 2: Temporary Environment Variable

Windows (Command Prompt):

set TIDYAI_API_KEY=your_openrouter_api_key
tidyai-win.exe C:\path\to\your\folder

Windows (PowerShell):

$env:TIDYAI_API_KEY="your_openrouter_api_key"
.\tidyai-win.exe C:\path\to\your\folder

macOS/Linux:

export TIDYAI_API_KEY=your_openrouter_api_key
./tidyai-macos /path/to/your/folder  # macOS
./tidyai-linux /path/to/your/folder  # Linux

Method 3: Using the Provided Scripts

Edit the tidyai.bat (Windows) or tidyai.ps1 (PowerShell) file and uncomment the line with your API key:

set TIDYAI_API_KEY=your_actual_api_key_here

Then run:

tidyai.bat C:\path\to\your\folder

🚀 Usage

Basic Commands

tidyai --help                   # Show help information
tidyai --version                # Show version information
tidyai /path/to/folder          # Organize files in a folder
tidyai --delete /path/to/folder # Organize and delete unnecessary files
tidyai --undo /path/to/folder   # Undo organization

Help Command Output

Usage:
  tidyai [options] [folder_path]
  tidyai --help
  tidyai --version

Options:
  --undo, -u     Undo the organization of a folder
  --delete, -d   Delete unnecessary files after organization
  --help, -h     Show this help message
  --version, -v  Show version information

Examples:
  tidyai /path/to/folder          # Organize files in a folder
  tidyai --delete /path/to/folder # Organize and delete unnecessary files
  tidyai --undo /path/to/folder   # Undo organization
  tidyai --help                   # Show this help message

Notes:
  - Unnecessary files include: thumbs.db, .DS_Store, *.tmp, *.log, desktop.ini
  - Deletion requires confirmation and cannot be undone (files are permanently deleted)
  - Organization history is used for undo operations

Environment Variables:
  TIDYAI_API_KEY  OpenRouter API key for AI-powered suggestions

Example Usage

Here's an example of how TidyAI organizes a messy folder:

Before:

messy-folder/
├── document.pdf
├── photo.jpg
├── script.js
├── data.csv
├── presentation.pptx
└── video.mp4

After running tidyai messy-folder:

messy-folder/
├── Documents/
│   ├── document.pdf
│   └── presentation.pptx
├── Images/
│   └── photo.jpg
├── Scripts/
│   └── script.js
├── Data/
│   └── data.csv
├── Media/
│   └── video.mp4
└── .tidyai/
    ├── history.json
    └── logs/

Beautiful CLI Interface

TidyAI-TS features a beautiful CLI interface with:

  • Colorful output for different types of messages
  • Progress bars for file operations
  • ASCII art logo
  • Section headers for better organization
  • Timestamped log files in .tidyai/logs/ directory

Here's what the output looks like when organizing files:

████████╗██╗██████╗ ██╗   ██╗ █████╗ ██╗
╚══██╔══╝██║██╔══██╗╚██╗ ██╔╝██╔══██╗██║
   ██║   ██║██║  ██║ ╚████╔╝ ███████║██║
   ██║   ██║██║  ██║  ╚██╔╝  ██╔══██║██║
   ██║   ██║██████╔╝   ██║   ██║  ██║██║
   ╚═╝   ╚═╝╚═════╝    ╚═╝   ╚═╝  ╚═╝╚═╝

========================================
  Organize your files with AI power!
========================================


┌──────────────────────┐
│ Organization Process │
└──────────────────────┘

ℹ Scanning folder contents...
ℹ Found 4 files to organize
ℹ Getting folder suggestions from AI...
ℹ Sending request to OpenRouter API...

┌──────────────┐
│ Moving Files │
└──────────────┘

Moving files: [████████████████████████████████████████] 100% (4/4) script.js
✓ Moved 4 files into folders
ℹ Saving organization history...
✓ Organization complete!
✓ Successfully organized folder: test-folder

🛡️ Error Handling

TidyAI-TS includes robust error handling:

  • When the API key is not set or invalid, it falls back to default folder suggestions based on file extensions
  • API errors are properly caught and logged
  • The application continues to function even when the AI service is unavailable
  • Prompts user to continue with default suggestions when API key is missing

If you're getting authentication errors, make sure you:

  1. Have a valid API key from OpenRouter
  2. Are setting the environment variable correctly
  3. Are using the correct syntax for your operating system and shell

🧪 Development

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Build the project:
    npm run build
  4. Run the CLI:
    npm start -- /path/to/folder

Creating Standalone Executables

To create standalone executables for all platforms, you can use the packaging script:

npm run package

This will create the following executables:

  • Windows: tidyai-win.exe
  • macOS: tidyai-macos
  • Linux: tidyai-linux

Alternatively, you can build individual platform executables using the npm scripts:

npm run build:win    # Windows executable
npm run build:linux  # Linux executable
npm run build:mac    # macOS executable
npm run build:all    # All platforms

Development Scripts

  • npm run build - Compile TypeScript to JavaScript
  • npm run dev - Run the TypeScript code directly
  • npm start - Run the compiled JavaScript
  • npm test - Run tests
  • npm run package - Create executables for all platforms
  • npm run clean - Remove generated executables
  • npm run build:win - Create Windows executable
  • npm run build:linux - Create Linux executable
  • npm run build:mac - Create macOS executable
  • npm run build:all - Create executables for all platforms

📊 Badges

npm version Build Status License Language Weekly Downloads Issues Stars Forks

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.