Skip to main content

A command-line tool for safely cleaning files and directories using customizable rules and dry-run preview

Project description

๐Ÿงน cleaner

cleaner is a powerful and safe CLI tool for cleaning up unwanted files and directories in your project, with support for dry-run mode, glob patterns, and rich terminal output.

โœจ Features

  • Dry-run mode (--delete optional)
  • Match by:
    • folder name (--dirs)
    • file name (--files)
    • glob patterns (--globs)
  • Rich output with icons and colors
  • Ignore specific files and folders
  • Root directory control (--root)
  • Works well with pipx or uv tool install

๐Ÿš€ Installation

Install via pipx:

pipx install git+https://github.com/DasKaroWow/cli_cleaner.git

Or with uv:

uv tool install --from git+https://github.com/DasKaroWow/cli_cleaner

๐Ÿ›  Usage

cleaner --dirs __pycache__ -g "*.pyc" -g "build/**" --delete

๐Ÿ”Ž Dry-run (default):

cleaner --files project_dump.txt --globs "*.log"

๐Ÿ—‘๏ธ Real delete:

cleaner --dirs dist --delete

๐Ÿ“ Specify root directory:

cleaner --dirs .venv --root ./backend --delete

๐Ÿ™ˆ Ignore certain files/folders:

cleaner --dirs __pycache__ --ignore-dirs migrations --ignore-files keep.py

๐Ÿ’ป Example Output

๐Ÿ‘€ DRY RUN in /home/user/project
๐Ÿ‘€ Would delete: src/__pycache__/utils.cpython-310.pyc
๐Ÿ‘€ Would delete: build/output.txt
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ‘€ 2 files will be deleted with --delete option

Or:

๐Ÿ—‘๏ธ DELETING in /home/user/project
๐Ÿ—‘๏ธ Deleting: dist/
โœ… done
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
๐Ÿ—‘๏ธ 1 files successfully deleted; 0 could not be deleted

๐Ÿ“ฆ Project layout

src/
โ””โ”€โ”€ cleaner/
    โ”œโ”€โ”€ cli.py
    โ”œโ”€โ”€ __init__.py
    โ””โ”€โ”€ __main__.py

โœ… Requirements


๐Ÿ“„ License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cli_cleaner-1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_cleaner-1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file cli_cleaner-1.1.tar.gz.

File metadata

  • Download URL: cli_cleaner-1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for cli_cleaner-1.1.tar.gz
Algorithm Hash digest
SHA256 6697ac3de7eb63916e1b8dd5a22b6963122594e028d3c597187adf3ec095fdce
MD5 acda39cb6c6b92819b0c93752b5c3ea4
BLAKE2b-256 cf2da67691d3a53017a9f4bc0aea5b67de5afec473bc03664969468bac654378

See more details on using hashes here.

File details

Details for the file cli_cleaner-1.1-py3-none-any.whl.

File metadata

  • Download URL: cli_cleaner-1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.9

File hashes

Hashes for cli_cleaner-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d37025f6494fb18371857258cadc9cefc5a8f98af7a7543acb36dd2a5803afa6
MD5 8a25ce4d163a57a036831e8b702035a0
BLAKE2b-256 3b3b2d90796247340ee6997e387a9a0ef83e50dbecb546dee0ea157f5b25c29e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page