Search

Lib.rs

› Filesystem
#disk-cleanup #cleanup #disk #cache #developer

app diskard

Developer-aware disk cleanup CLI

Owned by connectwithprakash.

  • Install
  • GitHub repo (connectwithprakash)

4 releases

0.2.0 Feb 19, 2026
0.1.2 Feb 19, 2026
0.1.1 Feb 19, 2026
0.1.0 Feb 19, 2026

#2695 in Filesystem

MIT/Apache

92KB
2K SLoC

diskard

Developer-aware disk cleanup CLI. Scans your machine for reclaimable space from build caches, AI models, package managers, and IDE artifacts.

Why

Developers accumulate tens of GBs of reclaimable space — Xcode DerivedData, npm cache, Ollama models, HuggingFace cache, Docker images, Cargo target dirs, and more. diskard finds them all and lets you clean up safely.

Install

# Via cargo
cargo install diskard

# Via Homebrew
brew install connectwithprakash/tap/diskard

Usage

# Scan for reclaimable space
diskard scan

# Scan with JSON output
diskard scan --format json

# Scan only safe-to-delete items
diskard scan --risk safe

# Scan with minimum size filter
diskard scan --min-size 100MB

# Filter by category
diskard scan --category xcode
diskard scan --category node
diskard scan --category rust

# Sort by risk or category instead of size
diskard scan --sort risk
diskard scan --sort category

# Only show items older than 30 days
diskard scan --older-than 30d

# Combine filters
diskard scan --category xcode --risk safe --min-size 1GB

# Clean (move to Trash by default)
diskard clean --risk safe

# Clean with dry-run
diskard clean --dry-run

# Permanently delete (no Trash)
diskard clean --permanent --risk safe

# Clean a specific category
diskard clean --category node --risk safe -y

# Interactive TUI mode (requires --features tui)
diskard interactive

# List available recognizers
diskard list targets

# Manage config
diskard config init     # Create default config
diskard config show     # Show current config
diskard config path     # Print config file path

# Generate shell completions
diskard completions zsh > ~/.zfunc/_diskard
diskard completions bash > /etc/bash_completion.d/diskard
diskard completions fish > ~/.config/fish/completions/diskard.fish

Recognizers

18 built-in recognizers across 13 categories:

Recognizer Category Path Risk
Xcode DerivedData Xcode ~/Library/Developer/Xcode/DerivedData Safe
Xcode DeviceSupport Xcode ~/Library/Developer/Xcode/iOS DeviceSupport Moderate
Xcode Simulators Xcode ~/Library/Developer/CoreSimulator/Devices Risky
Xcode Archives Xcode ~/Library/Developer/Xcode/Archives Moderate
Xcode Previews Xcode ~/Library/Developer/Xcode/UserData/Previews Safe
npm cache Node.js ~/.npm Safe
node_modules Node.js **/node_modules/ (with package.json) Safe
Homebrew cache Homebrew ~/Library/Caches/Homebrew Safe
pip cache Python ~/Library/Caches/pip Safe
Cargo target dirs Rust **/target/ (with Cargo.toml) Moderate
Docker data Docker ~/Library/Containers/com.docker.docker/Data Risky
Ollama models Ollama ~/.ollama/models Moderate
HuggingFace cache HuggingFace ~/.cache/huggingface Moderate
Claude Code data Claude ~/.claude/projects/, ~/.claude/debug/ Moderate
VS Code extensions VS Code ~/.vscode/extensions (old versions) Moderate
Gradle cache Gradle ~/.gradle/caches, ~/.gradle/wrapper/dists Safe
Maven repository Gradle ~/.m2/repository Moderate
CocoaPods cache CocoaPods ~/Library/Caches/CocoaPods Safe
.DS_Store files Generic **/.DS_Store Safe

Configuration

Config file location: ~/.config/diskard/config.toml

[defaults]
risk_tolerance = "moderate"
delete_mode = "trash"
min_size = 0

[ignore]
paths = []

[recognizers]
disabled = []

Risk Levels

  • Safe — Caches and build artifacts that regenerate automatically
  • Moderate — Can be regenerated but may require downloads or time
  • Risky — May contain user data or require manual reconfiguration

License

Dual-licensed under MIT or Apache 2.0.

Dependencies

~7–40MB
~594K SLoC

  • anyhow
  • clap+derive+env+wrap_help
  • clap_complete
  • console 0.15
  • dirs 5.0
  • diskard-core
  • tui diskard-tui
  • env_logger 0.11
  • log
  • serde_json
  • toml 0.8
  • dev tempfile
Related: diskard-core, diskard-tui
See also: diskforge, dysk, symsrv, lazyprune, ignoreit, sinbo, warpgate_pdk, rskiller, findex, dinfo, gix-tempfile

Lib.rs is an unofficial list of Rust/Cargo crates, created by kornelski. It contains data from multiple sources, including heuristics, and manually curated data. Content of this page is not necessarily endorsed by the authors of the crate. This site is not affiliated with nor endorsed by the Rust Project. If something is missing or incorrect, please file a bug.