In development · no stable release yet GPLv3, royalty-free or commercial — your choice

swarfr.

Sweep the swarf out of Cargo target/ directories — compress and dedupe build output without deleting what you still build with.

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/pyrlyn/swarfr/releases/latest/download/swarfr-installer.sh | sh
Abstract helical metal shavings in straw-to-blue temper colours, curling off a glass block.

See it run

swarfr, in the terminal.

swarfr — zsh
$ swarfr status ~/code
$ swarfr advise ~/code
$ swarfr run --dry-run ~/code
$ swarfr run ~/code
$ swarfr run --dry-run --lossy orphans ~/code
$ swarfr run --lossy evict --evict-max-total-gib 50 ~/code
Commands from the swarfr usage examples.

Overview

What swarfr does.

Swarf is the chips and shavings a lathe or a mill throws off: metal cut away, waste that is not the part. Much of a Cargo target/ directory is swarf, and swarfr sweeps it out without deleting what you still build with and without slowing builds.

One planner runs several approaches that reinforce each other: transparent compression of stable artifacts, copy-on-write dedupe across targets, zero-byte seeding of new worktrees, and opt-in removal of orphaned and idle targets. Everything runs under cargo's own build lock and keeps mtimes, so nothing is rebuilt.

swarfr is in active development: v0.1.0 is out, and testing volunteers are welcome. Lossless compress and dedupe need a filesystem that can share blocks or compress (APFS, btrfs, XFS with reflink); on Windows the tool builds and reports, but those two passes plan no work yet.

Features

Built for real workflows.

Install

Up and running in a minute.

Install

Every release carries binaries for Apple Silicon macOS (signed), x86_64 Linux and x86_64 Windows. The shell installer puts swarfr and its updater swarfr-update into cargo's bin directory:

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/pyrlyn/swarfr/releases/latest/download/swarfr-installer.sh | sh

With ketch:

ketch install pyrlyn/swarfr

Or build it from a checkout, with the toolchain the repository pins:

git clone https://github.com/pyrlyn/swarfr
cargo install --locked --path swarfr

Usage

The first five minutes: everything is read-only until the last step.

swarfr status ~/code
swarfr advise ~/code
swarfr run --dry-run ~/code
swarfr run ~/code

More examples below.

Usage examples

Real commands, straight from the docs.

Opt in to a lossy pass, on a dry run first.

swarfr run --dry-run --lossy orphans ~/code
swarfr run --lossy evict --evict-max-total-gib 50 ~/code

Run it as a service that visits a build dir once it has gone cold.

swarfr daemon install
swarfr daemon status

Links

License

You can use swarfr under any of the following licenses, at your choice:

  1. GNU GPLv3 — free for open-source applications on any platform, including embedded systems.
  2. Royalty-free license — free for proprietary desktop, mobile and web applications, as long as you disclose that your application uses the project. Embedded systems are not covered.
  3. Commercial license — for proprietary applications, including embedded systems, without the attribution requirement.

Pricing

Pro is a placeholder

Free forever. Pro when you need it.

Free · open source

GPLv3, royalty-free or commercial — your choice

$0forever

  • Lossless compress and dedupe
  • Seed new worktrees from a sibling
  • Read-only status and advise
Install free

Try swarfr today.

Free and open source. Star it, file an issue, or send a pull request.