0.0
The project is in a healthy, maintained state
Spreen — the falcon's stoop, then the preen. Deletes files in a directory tree matching a glob pattern via the file-clean CLI, defaulting to a dry-run mode that prints every file that would be removed; pass `--mode e` to actually delete them.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Actions Status: PyPI - CI Actions Status: PyPI - Daily Dependencies Update Actions Status: RubyGem - CI Actions Status: RubyGem - Daily Dependencies Update Actions Status: CodeQL

spreen-clean

spreen-clean: an origami falcon sweeping scattered files off a malachite stone, leaving a polished gleam in its wake

1. Overview

spreen-clean — the falcon's stoop, then the preen — deletes files in a directory tree matching a glob pattern, dry run first.
It ships as a RubyGems gem and a PyPI library, both installing the same file-clean CLI.

The icon tells the story: the origami falcon (隼 /hayabusa/) mid-sweep across the malachite stone, scattered files dissolving ahead of its dive and a polished gleam left in its wake — the workspace, settled.
The full legend behind the spreen name is told in spreen-wiki's README.

$ file-clean '*.log' --dirname ./tmp
Target dirname is /home/hayat01sh1da/workspace/tmp
========== [DRY RUN] Total File Count to Clean: 2 ==========
========== [DRY RUN] Start Cleaning *.log ==========
========== [DRY RUN] Cleaning ./tmp/app.log ==========
========== [DRY RUN] Cleaning ./tmp/jobs/worker.log ==========
========== [DRY RUN] Cleaned *.log ==========
========== [DRY RUN] Total Cleaned File Count: 2 ==========

Part of the spreen-* toolchain (spreen-wiki, spreen-pr, spreen-tracks, spreen-clean): tools that take something scattered and return it settled.

2. Safety Model

The tool is opinionated about safety: every run is a dry run until you say otherwise.

Mode Meaning Filesystem
d (default) Dry run Prints every file that would be removed; nothing is touched.
e Execution Deletes every printed file. This cannot be undone.

Any other mode fails with a clear error instead of guessing.

Two more guardrails back the dry-run default:

  • Filesystem roots are refused. A dirname that resolves to / (or a drive root like C:\) fails with a clear error before anything is scanned, so a stray file-clean can never sweep an entire drive.
  • Bulk deletions ask first. When the execution mode matches more than 100 files, the CLI shows the count and asks for an explicit y before deleting; pass --yes to skip the prompt in scripts.

3. Installation

Install from either ecosystem — the CLI is identical:

$ gem install spreen-clean
$ pipx install spreen-clean

(pip install spreen-clean works too if you prefer managing the environment yourself.)

4. Usage

$ file-clean [PATTERN] [options]
  • PATTERN is the dirname or filename glob to clean; with no PATTERN, everything under the target directory matches (*).
  • --dirname DIR sets the directory tree to clean (default: the current directory); the pattern matches recursively beneath it.
  • --mode d|e picks the operation mode — dry run by default; pass e to actually delete what the dry run printed:
$ file-clean '*.log' --dirname ./tmp --mode e
Target dirname is /home/hayat01sh1da/workspace/tmp
========== [EXECUTION] Total File Count to Clean: 2 ==========
========== [EXECUTION] Start Cleaning *.log ==========
========== [EXECUTION] Cleaning ./tmp/app.log ==========
========== [EXECUTION] Cleaning ./tmp/jobs/worker.log ==========
========== [EXECUTION] Cleaned *.log ==========
========== [EXECUTION] Total Cleaned File Count: 2 ==========
  • --yes skips the bulk-delete confirmation that the execution mode raises above 100 matches — for scripted use.
  • --version prints the version; --help prints the usage.

Both packages also expose the logic as a library — see the per-language READMEs below.

5. Development