| Crates.io | rskiller |
| lib.rs | rskiller |
| version | 0.2.1 |
| created_at | 2025-06-01 04:55:15.113602+00 |
| updated_at | 2025-09-23 09:23:04.992054+00 |
| description | Find and clean Rust project build artifacts and caches with parallel processing |
| homepage | https://github.com/NakaSato/rskiller |
| repository | https://github.com/NakaSato/rskiller |
| max_upload_size | |
| id | 1696889 |
| size | 185,914 |
rskiller is a command-line tool inspired by npkill but designed specifically for Rust projects. It helps you find and clean up Rust project build artifacts, target directories, and other cache files to free up disk space.
Cargo.toml files to locate Rust projectstarget directories and their contentsDownload pre-compiled binaries from the releases page:
# Download and install (Intel Mac)
curl -L https://github.com/NakaSato/rskiller/releases/latest/download/rskiller-macos-x64.tar.gz | tar xz
sudo mv rskiller /usr/local/bin/
# Download and install (Apple Silicon Mac)
curl -L https://github.com/NakaSato/rskiller/releases/latest/download/rskiller-macos-arm64.tar.gz | tar xz
sudo mv rskiller /usr/local/bin/
# Or using Homebrew (when available)
brew install rskiller
# Download and install (x86_64)
curl -L https://github.com/NakaSato/rskiller/releases/latest/download/rskiller-linux-x64.tar.gz | tar xz
sudo mv rskiller /usr/local/bin/
# Download and install (ARM64)
curl -L https://github.com/NakaSato/rskiller/releases/latest/download/rskiller-linux-arm64.tar.gz | tar xz
sudo mv rskiller /usr/local/bin/
# Or using package managers (when available)
# Debian/Ubuntu
wget https://github.com/NakaSato/rskiller/releases/latest/download/rskiller_amd64.deb
sudo dpkg -i rskiller_amd64.deb
# Arch Linux (AUR)
yay -S rskiller
# Fedora/RHEL
sudo rpm -i https://github.com/NakaSato/rskiller/releases/latest/download/rskiller-1.x86_64.rpm
# Download and extract
Invoke-WebRequest -Uri "https://github.com/NakaSato/rskiller/releases/latest/download/rskiller-windows-x64.zip" -OutFile "rskiller.zip"
Expand-Archive -Path "rskiller.zip" -DestinationPath "C:\Program Files\rskiller"
# Add to PATH manually or using PowerShell
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\rskiller", "Machine")
# Or using Chocolatey (when available)
choco install rskiller
# Or using Scoop
scoop install rskiller
rskiller binary to a directory in your PATH:
/usr/local/bin/ or ~/.local/bin/C:\Program Files\rskiller\ (and add to PATH)rskiller --version
After installation, you can enable shell completions:
# Bash (add to ~/.bashrc)
source <(rskiller --completion bash)
# Zsh (add to ~/.zshrc)
rskiller --completion zsh > ~/.zsh/_rskiller
autoload -U compinit && compinit
# Fish (add to config.fish)
rskiller --completion fish | source
# PowerShell (add to profile)
rskiller --completion powershell | Out-String | Invoke-Expression
For automated installation, you can use this one-liner that detects your platform:
# Unix-like systems (macOS, Linux)
curl -sSL https://raw.githubusercontent.com/NakaSato/rskiller/main/install.sh | bash
# Or with wget
wget -qO- https://raw.githubusercontent.com/NakaSato/rskiller/main/install.sh | bash
# Windows (PowerShell)
iwr -useb https://raw.githubusercontent.com/NakaSato/rskiller/main/install.ps1 | iex
The install script will:
git clone https://github.com/NakaSato/rskiller.git
cd rskiller
cargo install --path .
cargo install rskiller
If you want to build an optimized binary yourself:
# Clone the repository
git clone https://github.com/NakaSato/rskiller.git
cd rskiller
# Build optimized release binary
cargo build --release
# The binary will be available at:
# ./target/release/rskiller (Unix)
# ./target/release/rskiller.exe (Windows)
# Install locally
cargo install --path .
# Or copy the binary manually to your preferred location
cp ./target/release/rskiller /usr/local/bin/ # Unix
# or
copy .\target\release\rskiller.exe C:\Windows\System32\ # Windows
To build for different platforms:
# Install cross-compilation targets
rustup target add x86_64-pc-windows-gnu
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
# Build for specific targets
cargo build --release --target x86_64-pc-windows-gnu
cargo build --release --target x86_64-apple-darwin
cargo build --release --target aarch64-apple-darwin
cargo build --release --target x86_64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu
rskiller
This opens an interactive terminal interface where you can:
↑↓ or j/kSpace or Deloraq or Escrskiller --list-only
# Start from a specific directory
rskiller --directory ~/projects
# Search from home directory (default behavior)
rskiller --full
# Show sizes in gigabytes
rskiller --gb
# Sort by different criteria
rskiller --sort size # Default
rskiller --sort path
rskiller --sort last-mod
# Exclude directories
rskiller --exclude "target,node_modules"
# Include Cargo cache analysis
rskiller --include-cargo-cache
# Dry run (don't actually delete)
rskiller --dry-run
# Auto-delete all found target directories
rskiller --delete-all --dry-run # Test first!
rskiller supports configuration files to set default options and avoid repetitive command line arguments. Configuration files are loaded in the following priority order (highest to lowest):
./rskill.toml (project-local TOML config)./.rskillrc (project-local JSON config)~/.config/rskiller/rskill.toml (user TOML config)~/rskill.toml (home directory TOML config)~/.rskillrc (home directory JSON config)rskill.toml)[search]
directory = "~/"
target = "target"
exclude = ["node_modules", "vendor", ".git"]
exclude_hidden = true
include_cargo_cache = false
[output]
sort = "size" # size, path, last-mod
gb = false
color = "blue" # blue, cyan, magenta, white, red, yellow
hide_errors = false
[behavior]
dry_run = false
delete_all = false
list_only = false
no_check_update = false
[safety]
confirm_large_deletions = true
large_deletion_threshold = "1GB"
backup_before_delete = false
max_concurrent_deletions = 3
[performance]
enable_parallel_scanning = true
max_parallel_threads = 0 # 0 = auto-detect
chunk_size = 1000
enable_parallel_cleanup = true
[filters]
min_age_days = 0
max_age_days = 365
min_size = "1MB"
ignore_active_projects = true
active_threshold_hours = 24
.rskillrc){
"search": {
"directory": "~/",
"target": "target",
"exclude": ["node_modules", "vendor", ".git"],
"excludeHidden": true,
"includeCargoCache": false
},
"output": {
"sort": "size",
"gb": false,
"color": "blue",
"hideErrors": false
},
"behavior": {
"dryRun": false,
"deleteAll": false,
"listOnly": false,
"noCheckUpdate": false
},
"safety": {
"confirmLargeDeletions": true,
"largeDeletionThreshold": "1GB",
"backupBeforeDelete": false,
"maxConcurrentDeletions": 3
},
"performance": {
"enableParallelScanning": true,
"maxParallelThreads": 0,
"chunkSize": 1000,
"enableParallelCleanup": true
},
"filters": {
"minAgeDays": 0,
"maxAgeDays": 365,
"minSize": "1MB",
"ignoreActiveProjects": true,
"activeThresholdHours": 24
}
}
# Generate sample configuration file
rskiller --init-config # Creates rskill.toml in current directory
rskiller --init-config --format json # Creates .rskillrc in current directory
rskiller --init-config --global # Creates user-level config
# Use specific configuration file
rskiller --config ./custom-config.toml
# Print effective configuration (after merging all sources)
rskiller --print-config
# Validate a configuration file
rskiller --validate-config ./rskill.toml
# Show configuration file search paths and which ones exist
rskiller --config-info
The [performance] section allows you to optimize rskiller's scanning and cleanup operations for your system:
enable_parallel_scanning: Enable multi-threaded scanning of directories (default: true)max_parallel_threads: Maximum number of threads to use. Set to 0 for auto-detection based on CPU cores (default: 0)chunk_size: Number of projects to process per parallel chunk (default: 1000)enable_parallel_cleanup: Enable parallel cleanup operations for future use (default: true)Example performance tuning:
[performance]
enable_parallel_scanning = true
max_parallel_threads = 8 # Use 8 threads explicitly
chunk_size = 500 # Smaller chunks for better load balancing
enable_parallel_cleanup = true
Note: Parallel processing significantly improves performance when scanning large directory trees with many Rust projects. The optimal thread count depends on your CPU and storage type (SSDs benefit more than HDDs).
| Option | Description |
|---|---|
-d, --directory <PATH> |
Directory to start searching from (default: home directory) |
-f, --full |
Search from user's home directory |
-t, --target <NAME> |
Target directory name to search for (default: "target") |
-s, --sort <TYPE> |
Sort by: size, path, or last-mod |
--gb |
Show sizes in gigabytes instead of megabytes |
-E, --exclude <DIRS> |
Exclude directories (comma-separated) |
-x, --exclude-hidden |
Exclude hidden directories |
-e, --hide-errors |
Hide error messages |
-D, --delete-all |
Automatically delete all found directories |
--dry-run |
Don't actually delete anything |
-l, --list-only |
Non-interactive mode, just list projects |
--include-cargo-cache |
Include Cargo registry and git cache analysis |
-c, --color <COLOR> |
Interface color: blue, cyan, magenta, white, red, yellow |
--config <FILE> |
Use specific configuration file |
--print-config |
Print effective configuration (after merging all sources) |
--init-config |
Generate sample configuration file |
--format <FORMAT> |
Configuration file format for --init-config (toml, json) |
--global |
Generate global user configuration instead of project-local |
--validate-config <FILE> |
Validate configuration file |
--config-info |
Show configuration file locations and precedence |
| Option | Description |
|---|---|
--schedule <TYPE> |
Schedule automatic cleanup: daily, weekly, monthly, interval |
--time <HH:MM> |
Time for scheduled cleanup (24-hour format) |
--day <DAY> |
Day for weekly (monday-sunday) or monthly (1-31) cleanup |
--hours <N> |
Interval in hours for recurring cleanup |
--threshold <SIZE> |
Only run if total cleanable size exceeds threshold |
--schedule-config <FILE> |
Load schedule configuration from file |
--list-schedules |
List all configured schedules |
--remove-schedule <ID> |
Remove a scheduled cleanup task |
rskiller includes several safety features to prevent accidental deletion of important files:
--dry-run)rskiller can clean the following Rust-related artifacts:
target/ directories (build outputs)target/debug/ (debug builds)target/release/ (release builds)target/deps/ (compiled dependencies)--include-cargo-cache)~/.cargo/registry/ (crate registry cache)~/.cargo/git/ (git dependency cache)Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
# Clone the repository
git clone https://github.com/NakaSato/rskiller.git
cd rskiller
# Set up development environment
make dev-setup
# Run in development mode
cargo run
# Run with arguments
cargo run -- --directory ~/projects --list-only
# Run tests
make test
# Build release
make build
The project uses GitHub Actions for automated building and releasing:
# Create a new release
make release VERSION=v0.3.0
# This will:
# 1. Update Cargo.toml version
# 2. Create a git tag
# 3. Push to GitHub
# 4. Trigger automated build and release
The release process automatically:
cargo installThe project includes automated publishing to crates.io:
Cargo.toml is bumpedSee docs/AUTO_PUBLISH.md for detailed setup instructions.
# Security audit
make check-security
# Generate shell completions
make completions
# Cross-compile for multiple platforms
make cross-compile
# Create distribution packages
make package
# View documentation
make docs
This project is licensed under the MIT License - see the LICENSE file for details.
.rskillrc or rskill.toml config files with flexible priority systemRequired Crates:
ratatui = "0.24" # Modern TUI framework
crossterm = "0.27" # Terminal manipulation (already included)
tui-tree-widget = "0.17" # Tree view component
fuzzy-matcher = "0.3" # Fuzzy search functionality
git2 = "0.18" # Git integration
serde_json = "1.0" # Enhanced config serialization
tokio = { version = "1.0", features = ["full"] } # Async runtime (already included)
Development Tools:
tui-logger for debug overlays during developmentexpectrlasciinema recordingsHappy cleaning! Keep your Rust projects lean and your disk space free!