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__ --globs "*.pyc" "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.0.tar.gz (3.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.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for cli_cleaner-1.0.tar.gz
Algorithm Hash digest
SHA256 50778d69d2c49c7cc7d173831ff5c023ebce48898cf13a543d0b8ee0a5272c7d
MD5 4d37f8cfb588a4e8b3d16b699fa89bb6
BLAKE2b-256 8e2e3e2b672e93da2eba8456809ebc4e54447cebd722595713d299d0af97fbf3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for cli_cleaner-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6462af6c7cad6527b9f765f1aaae0054a2f17b4eb4e4d3b5e3d9fe3f81c65985
MD5 6facb628e5a99cfd424b55979d4f41b8
BLAKE2b-256 650f71ab7663cba48b39f7aaf7d040132167c3d950d523d4a0623699d3d349db

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