ai-renamer  by ozgrozer

CLI tool for intelligent file renaming via LLMs

created 1 year ago
1,893 stars

Top 23.5% on sourcepulse

GitHubView on GitHub
Project Summary

This Node.js CLI tool intelligently renames files based on their content using local LLMs via Ollama or LM Studio, or cloud models via OpenAI. It targets users who manage large collections of media files (images, videos) and need to automate descriptive renaming for better organization. The primary benefit is saving time and improving file discoverability through AI-powered context.

How It Works

The CLI leverages multimodal LLMs (like Llava) or text-based models to analyze file content. For videos, it extracts frames using ffmpeg and feeds them to the LLM. For images, it uses the image directly. It then prompts the LLM to generate a descriptive filename based on the content, with options to customize output case, character limits, and language.

Quick Start & Requirements

  • Install globally: npm install -g ai-renamer
  • Run: npx ai-renamer /path/to/files
  • Prerequisites: Node.js, Ollama or LM Studio with at least one LLM (Llava, Gemma, Llama, etc.), ffmpeg for video processing.
  • Configuration: Flags like --provider, --model, --api-key, --base-url can be used and are saved to ~/ai-renamer.json.
  • Help: npx ai-renamer --help

Highlighted Details

  • Supports multiple LLM providers: Ollama, LM Studio, OpenAI.
  • Customizable renaming: case styles, filename length, language, custom prompts.
  • Handles images and videos; video renaming requires ffmpeg.
  • Configuration persistence for repeated use.

Maintenance & Community

The project is open for contributions via issues and pull requests.

Licensing & Compatibility

  • License: GPL-3.0.
  • Compatibility: The GPL-3.0 license may impose copyleft restrictions on derivative works or linked code, potentially impacting commercial or closed-source usage.

Limitations & Caveats

Requires local LLM setup (Ollama/LM Studio) and ffmpeg, which can be resource-intensive. The effectiveness of renaming is dependent on the chosen LLM's capabilities and the quality of the prompts.

Health Check
Last commit

5 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
79 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.