Skip to content

pashkov256/deletor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deletor

codecov
MIT

Manage and delete files efficiently with an interactive TUI and scriptable CLI.


Deletor is a handy file deletion tool that combines a powerful text interface (TUI) with visual directory navigation, and classic command line mode (CLI). It allows you to quickly find and delete files by extension and size, both interactively and through scripts.

Features

  • 🖥️ Interactive TUI: Modern text-based user interface for easy file navigation and management
  • ♻️ Safe Deletion: Files: are moved to the system trash/recycle bin instead of permanent deletion
  • Modification Time Filter: Delete files older,newer than X days/hours/minutes
  • 📏 Size Filter: Deletes only files larger than the specified size (e.g., 10mb, 1gb)
  • 🗑️ Extensions Filter: Deletes files with specified extensions (e.g., .mp4, .zip)
  • 📂 Directory Navigation: Easy navigation through directories with arrow keys
  • 📖 Log Operations: log the various fields and look at the tui table, or parse the file
  • 🎯 Quick Selection: Select and delete files with keyboard shortcuts
  • ⚙️ Customizable Options: Toggle hidden files and confirmation prompts
  • 🛠️ Confirmation Prompt: Optional confirmation before deleting files
  • 🧠 Rules System: Create and manage deletion presets for repeated use

Project Banner

📦 Installation

Using Go

go install github.com/pashkov256/deletor@latest

🛠 Usage

TUI Mode (default):

deletor

CLI Mode (with filters):

deletor -cli -d ~/Downloads -e mp4,zip  --min-size 10mb -subdirs --exclude data,backup

Arguments:

-e, --extensions — comma-separated list of extensions (for example, mp4,zip,jpg).

-d, --directory — the path to the file search directory.

--min-size — minimum file size to delete (for example, 10 kb, 1mb, 1gb).

--exclude - exclude specific files/paths (e.g. data,backup)

-subdirs - include subdirectories in scan, default false

-progress - display a progress bar during file scanning

-confirm-delete - confirmation before deleting files

✨ The Power of Dual Modes: TUI and CLI

  • TUI mode provides a user-friendly way to navigate and manage files visually, ideal for manual cleanups and exploration.

  • CLI mode is perfect for automation, scripting, and quick one-liners. It's essential for server environments, cron jobs, and integrating into larger toolchains.

Unlike many traditional disk usage tools that focus only on visualizing disk space (like ncdu, gdu, dua-cli), Deletor is optimized specifically for fast and targeted file removal. It offers advanced filtering options by file extension, size, and custom exclusions, making it a powerful tool for real-world file management — not just analysis.

📋 Rules System

Deletor supports rule-based file operations through JSON configuration:

  1. Rule Location: Automatically stored in ~/.config/deletor/rule.json (Linux/macOS) or %APPDATA%\deletor\rule.json (Windows)

  2. Rule Format (rule.json example):

{
  "path": "C:\Users\pashkov\Downloads\gws",
  "extensions": [".log", ".tmp"],
  "exclude": ["backup", "important"],
  "min_size": "10mb"
}
  1. Key Features:
  • Create/edit rules via TUI or manual JSON editing

  • Combine multiple filters (extension + size + exclusions)

  • Share rules between machines

🛠 Contributing

We welcome and appreciate any contributions to Deletor! There are many ways you can help us grow and improve:

  • 🐛 Report Bugs — Found an issue? Let us know by opening an issue.
  • 💡 Suggest Features — Got an idea for a new feature? We'd love to hear it!
  • 📚 Improve Documentation — Help us make the docs even clearer and easier to use.
  • 💻 Submit Code — Fix a bug, refactor code, or add new functionality by submitting a pull request.

Before contributing, please take a moment to read our CONTRIBUTING.md guide. It explains how to set up the project, coding standards, and the process for submitting contributions.

Together, we can make Deletor even better! 🚀

AI docs

https://code2tutorial.com/tutorial/dcba8e56-33cd-4d67-b9ee-0c9f3c276b6e/index.md

📜 License

This project is distributed under the MIT license.


Thank you to these wonderful people for their contributions!