kondor
Clean build artifacts from your projectshttps://github.com/gblach/kondorkondor finds and removes build artifacts such as target, node_modules, and __pycache__ from
software projects, freeing up disk space. It is an improved take on
kondo.
For each project it finds, kondor shows the path, the project type, and the size of each artifact directory, then asks what to do with a single key press.
Features
- Nested projects - kondo stops descending once it finds a project, so a Node frontend inside a Cargo workspace is missed. kondor keeps scanning below every project.
- Custom artifacts - a
.kondorfile adds glob patterns for generated directories that no built-in project type knows about. - One key per answer - the prompt reacts to
y,n,a,q, or the arrow keys, without Enter. - Read-only directories - some build outputs contain read-only directories; kondor makes them writable and tries again.
- Many project types - Bun, C/C++, Cargo, Dart, Deno, Elixir, Go, Gradle, Haskell, Maven, Meson, .NET, Node, PHP, Python, Ruby, Scala, Swift, and Zig.
- Failures are reported - the exit code is 1 when something could not be removed.
- Safe by default - symlinks are never followed, and hidden directories like
.gitor~/.cacheare not scanned.
Installation
On Fedora, install it from the gblachx/apps COPR repository:
sudo dnf copr enable gblachx/apps
sudo dnf install kondor
With Cargo:
# From source
cargo install kondor
# Prebuilt binary
cargo binstall kondor
# From a clone of this repository
cargo install --path .
Usage
Usage: kondor [-y] [-n] [<dirs...>]
Arguments:
dirs Directories to scan (default: current directory).
Options:
-y, --yes Clean all found projects without asking.
-n, --dry-run List what would be cleaned without removing anything.
-h, --help Show this help message and exit.
Clean interactively
Run kondor in a directory with your projects. Each project is handled as soon as it is found:
$ kondor
Clean ./api/frontend (Node)?
.next 36.2 MiB
node_modules 392.9 MiB
Yes No All Quit
| Key | Action |
|---|---|
y |
Clean this project |
n |
Skip this project |
a |
Clean this project and all remaining ones |
q, Esc |
Stop scanning |
←/→ or h/l |
Move between the buttons |
| Enter | Confirm the selected button (default is No) |
After each answer the prompt shrinks to one line, and a total is printed at the end:
Clean ./api (Cargo)? 1.8 GiB
Clean ./api/frontend (Node)? 429.2 MiB
Clean ./legacy (Go)? skipped
Freed 2.2 GiB
See what would be removed
--dry-run lists what would be cleaned without asking or removing anything:
$ kondor -n
Would clean ./api (Cargo) 1.8 GiB
Would clean ./api/frontend (Node) 429.2 MiB
Would free 2.2 GiB
Clean everything without asking
$ kondor -y
Cleaned ./api (Cargo) 1.8 GiB
Cleaned ./api/frontend (Node) 429.2 MiB
Custom artifacts
A .kondor file adds artifacts to the directory it is in. Each line is a glob pattern relative
to that directory. A line starting with ! keeps matching directories, even built-in ones:
# Generated by our codegen
generated/
logs/*.log
packages/*/dist
# Our build directory holds hand-written scripts
!build
Absolute paths and paths with .. are ignored, so a .kondor file cannot remove anything outside
its directory.
Caution
Some artifact names are also used for real source directories. Go vendor is sometimes committed
to git, and build or dist in C/C++, Meson, and Python projects may contain hand-written files.
Review the list before answering y, be careful with --yes, and add an exclude to a .kondor
file for directories you want to keep.
kondor is licensed under the GNU General Public License v3.0 or later.