# ProjClean
[](https://github.com/sigoden/projclean/actions/workflows/ci.yaml)
[](https://crates.io/crates/projclean)
Find and clean heavy build or cache directories.
ProjClean finds directories such as node_modules(node), target(rust), build(java) and their storage space for you, so you can easily inspect or clean.

## Install
### With cargo
```
cargo install projclean
```
### Binaries on macOS, Linux, Windows
Download from [Github Releases](https://github.com/sigoden/projclean/releases), unzip and add projclean to your $PATH.
## Usage
- Starting search from current directory
```
projclean
```
- Starting search from $HOME directory
```
projclean $HOME
```
- Print default rules
```
projclean -L
```
```
node_modules;;node
target;Cargo.toml;rust
build;build.gradle;java
- Use custom rules
Search tmp folder
```sh
projclean -r tmp
```
Search build or dist folder belongs to js project
```sh
projclean -r 'build;package.json;js' -r 'dist;packge.json;js'
```
- Load custom rules from file
You can write the rules to a file for reuse.
```sh
projclean -L > rules
echo 'build;pom.xml;java' >> rules
projclean -f rules
```
- List found targets only, do not enter tui
```sh
projclean -t
## Rule
ProjClean finds target folders according to project rule.
Each project rule consist of:
```
<target>[;flag][;name]
```
- target: folders to be searched, e.g. `node_modules`, `^(build|dist)$`
- flag: specific file to a specific project, e.g. `Cargo.toml` to rust, `build.gradle` to java or `\.sln$` to vs.
- name: rule/project name.
The flag is used to filter out target folders that are not in the project.
## License
Copyright (c) 2022 projclean-developers.
argc is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
See the LICENSE-APACHE and LICENSE-MIT files for license details.