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 (
--deleteoptional) - Match by:
- folder name (
--dirs) - file name (
--files) - glob patterns (
--globs)
- folder name (
- Rich output with icons and colors
- Ignore specific files and folders
- Root directory control (
--root) - Works well with
pipxoruv 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6697ac3de7eb63916e1b8dd5a22b6963122594e028d3c597187adf3ec095fdce
|
|
| MD5 |
acda39cb6c6b92819b0c93752b5c3ea4
|
|
| BLAKE2b-256 |
cf2da67691d3a53017a9f4bc0aea5b67de5afec473bc03664969468bac654378
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d37025f6494fb18371857258cadc9cefc5a8f98af7a7543acb36dd2a5803afa6
|
|
| MD5 |
8a25ce4d163a57a036831e8b702035a0
|
|
| BLAKE2b-256 |
3b3b2d90796247340ee6997e387a9a0ef83e50dbecb546dee0ea157f5b25c29e
|