rskiller-0.1.0 is not a library.
๐ฆ rust-cleaner - Rust Project Cleaner
rust-cleaner 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.
โจ Features
- ๐ Find Rust Projects: Automatically scans for
Cargo.toml
files to locate Rust projects - ๐งน Clean Build Artifacts: Remove
target
directories and their contents - ๐ Size Analysis: Shows the disk space used by each project's build artifacts
- โฐ Last Modified: Displays when projects were last modified to help identify stale projects
- ๐ฏ Interactive Mode: Navigate through projects with keyboard shortcuts
- ๐ List Mode: Non-interactive listing of projects and their sizes
- ๐จ Colorized Output: Beautiful terminal interface with customizable colors
- โ ๏ธ Safety Features: Warns about active projects and system directories
- ๐๏ธ Workspace Support: Detects and handles Cargo workspaces
- ๐ฆ Cache Cleanup: Optional Cargo registry and git cache cleanup
๐ Installation
From Source
Using Cargo
๐ Usage
Interactive Mode (Default)
This opens an interactive terminal interface where you can:
- Navigate with
โโ
orj/k
- Delete target directories with
Space
orDel
- Open project directories with
o
- Refresh the list with
r
- Delete all targets with
a
- Quit with
q
orEsc
List Mode
Common Options
# Start from a specific directory
# Search from home directory
# Show sizes in gigabytes
# Sort by different criteria
# Exclude directories
# Include Cargo cache analysis
# Dry run (don't actually delete)
# Auto-delete all found target directories
๐ฏ Command Line Options
Option | Description |
---|---|
-d, --directory <PATH> |
Directory to start searching from (default: current 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 |
๐ก๏ธ Safety Features
rskill includes several safety features to prevent accidental deletion of important files:
- Active Project Detection: Projects modified recently are marked as "Active"
- System Directory Protection: Avoids scanning system directories
- Workspace Awareness: Understands Cargo workspaces
- Dry Run Mode: Test deletions before actually removing files
- Size Warnings: Large deletions are highlighted
- Confirmation Prompts: For important operations (in interactive mode)
๐ What Gets Cleaned
rskill can clean the following Rust-related artifacts:
Project Level
target/
directories (build outputs)target/debug/
(debug builds)target/release/
(release builds)target/deps/
(compiled dependencies)- Incremental compilation cache
Global Level (with --include-cargo-cache
)
~/.cargo/registry/
(crate registry cache)~/.cargo/git/
(git dependency cache)
๐จ Screenshots
๐ฆ RUST-CLEANER - Rust Project Cleaner
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ โโ Navigate | Space/Del Delete | o Open | r Refresh | q Quit
โบ my-rust-project 15.30 MB ~/projects/rust/my-app 2 days ago Active
old-experiment 245.67 MB ~/old-projects/experiment 45 days ago Stale โ ๏ธ
web-server 89.12 MB ~/work/backend 1 day ago Active
cli-tool 12.45 MB ~/tools/cli 7 days ago Active
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ 4 projects | ๐พ 362.54 MB cleanable | ๐๏ธ 2 deleted (180.23 MB)
๐ /Users/username/projects/rust/my-app
๐ฏ Target: /Users/username/projects/rust/my-app/target
๐ฆ 15 dependencies
๐ค Contributing
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.
Development
# Clone the repository
# Run in development mode
# Run with arguments
# Run tests
# Build release
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Inspired by npkill for Node.js projects
- Built with the amazing Rust ecosystem
- Thanks to all contributors and users
๐ Roadmap
- Advanced Filtering: Filter by project age, size, or activity
- Batch Operations: Select multiple projects for batch deletion
- Project Templates: Detect and handle different project types (bin, lib, workspace)
- Statistics: Historical cleanup statistics and trends
- Configuration: Configuration file support for default options
- Integration: IDE/Editor plugins
- Cross-platform: Better Windows support and testing
โก Happy cleaning! Keep your Rust projects lean and your disk space free! โก