| Crates.io | bin-expire |
| lib.rs | bin-expire |
| version | 0.1.0 |
| created_at | 2026-01-01 20:40:52.942247+00 |
| updated_at | 2026-01-01 20:40:52.942247+00 |
| description | Scan for stale binaries in common bin folders and safely archive/restore them |
| homepage | https://github.com/Yashb404/bin-expire |
| repository | https://github.com/Yashb404/bin-expire |
| max_upload_size | |
| id | 2017486 |
| size | 97,355 |
bin-expire scans common "bin" folders, identifies stale binaries, and can archive/restore them safely.
By default it scans:
~/.cargo/bin~/go/binIt also detects Windows “App Execution Alias stubs” (0-byte .exe placeholder files) and treats them specially so you don’t accidentally archive them.
C:\Users\<you>\AppData\Local\rust-apps\bin-expire.exe.exe) to your PATH.Windows: add to User PATH (GUI)
C:\Users\<you>\AppData\Local\rust-appsVerify:
where bin-expire
bin-expire --help
Git Bash: ensure PATH includes the folder
Git Bash may not pick up Windows PATH changes until you restart it. If you want it to always work in Git Bash, add the folder to ~/.bashrc:
echo 'export PATH="$PATH:/c/Users/<you>/AppData/Local/rust-apps"' >> ~/.bashrc
source ~/.bashrc
bin-expire.exe --help
Build an optimized binary:
cargo build --release
Run it:
./target/release/bin-expire scan --days 30
Or install it into your Cargo bin directory:
cargo install --path .
# Scan default locations (~/.cargo/bin and ~/go/bin)
bin-expire scan
# Scan a specific directory
bin-expire scan -p ~/.cargo/bin --days 30
# Archive stale binaries (moves them into your configured archive_path)
bin-expire archive --days 30
# Restore a previously archived binary by name
bin-expire restore old_tool.exe
✗)
·) (Windows App Execution Alias stubs)--verbose also shows OK rows (✓) and adds:
PATH columnSRC column indicating where last_used came from: A=atime, M=mtime, ?=unknownUseful filters:
--only-stale (hides OK + stubs)--hide-ok (mainly useful with --verbose)--hide-stub (hides stub rows)Moves stale binaries into archive_path and records each move in a manifest so it can be restored later.
Notes:
.exe) are never archived.Restores the most recent archived entry for the given name (from the manifest).
Safety behavior:
On first run, bin-expire creates a config file under your platform config directory:
%APPDATA%\bin-expire\config.toml~/.config/bin-expire/config.toml~/Library/Application Support/bin-expire/config.tomlYou can override the config root with an environment variable:
BIN_EXPIRE_CONFIG_DIR=/some/pathWhen set, bin-expire reads/writes:
BIN_EXPIRE_CONFIG_DIR/bin-expire/config.tomlBIN_EXPIRE_CONFIG_DIR/bin-expire/archive.jsonExample config.toml:
ignored_bins = ["cargo", "rustc"]
default_threshold_days = 90
archive_path = "C:/Users/me/.bin-expire/archive"
windows_use_access_time = true
Config keys:
ignored_bins: file names to ignore during scan/archivedefault_threshold_days: used when --days is not providedarchive_path: where archived binaries are movedwindows_use_access_time: Windows-only preference for selecting last_usedOn Windows, access times (atime) are best-effort and can be disabled, delayed, or updated by scanning/listing.
windows_use_access_time=false to use modified time (mtime).cargo fmt --all
cargo clippy --all-targets -- -D warnings
cargo test
cargo test --release --all-targets