Show HN: Kondo, OSS drive cleaner for devs

1 point by tbillington 1 year ago | 1 comment
Hey HN, my open source drive cleaner for devs recently hit a major milestone, now supporting 20 different kinds of software projects.

It handles typical software projects like Cargo (Rust) and Node (JS) to things like Jupyter Notebook (Python) to even game engines like Unreal (C++).

Here's an example run from my pc earlier:

  > kondo ~/code
  /Users/choc/code/driving Cargo project (4 weeks ago)
    └─ target (7.6GiB)
    delete above artifact directories? ([y]es, [n]o, [a]ll, [q]uit): y
    
  /Users/choc/code/aetherift-website Node project (2 months ago)
    └─ node_modules (310.9MiB)
    delete above artifact directories? ([y]es, [n]o, [a]ll, [q]uit): y
  Projects cleaned: 2, Bytes deleted: 7.91GiB
It works by recursively searching in the given path(s) looking for identifiers of known projects. Usually these are specifically named configuration files, for example package.json for JS and Cargo.toml for Rust.

Once a project is identified it is presented to the user with how much space could be reclaimed by deleting the "build artifacts", and given the option to do so.

Build artifacts are any files that can be trivially regenerated from the rest of the project. In a JS project it would be node_modules, in Zig it would be zig-cache, etc. For many types of software projects the artifacts are often 99% of the size, dramatically bloating the size of the directory.

It's most useful when you want to archive/backup repositories without manually clearing all their artifacts, or if you're just running low on disk space because you tried a few too many JS libraries that somehow occupy 500MB in dependencies...

Kondo was my Rust learning project during some career downtime in 2020. It was a very practical transition from a bash script, to evolving a CLI interface, and eventually a GUI. I also experienced adding multi-threading to an existing project and I have to say I found it easier than expected. All in all I found Rust a pleasant and productive language to code in.

You can install kondo via the usual ways, `brew install kondo`, `pacman -S kondo`, building locally or even from your system package manager (though it may be an older version).

I'm open to any feedback, suggestions, and contributions. I have a refactor in the works to remove a few edge cases so I'm curious to hear from people who it doesn't currently suit.

Hope you find it useful - Trent

  • dimkal 1 year ago
    Ummm, why not just use ‘git clean -xdf’?