null-e 0.2.0

Disk cleanup CLI for developers - clean node_modules, target, .venv, Docker, Xcode caches and 50+ cache types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# null-e - Disk Cleanup Tool for Developers πŸ€–

```
     .---.
    |o   o|    null-e
    |  ^  |    ═══════════════════════════════════
    | === |    The friendly disk cleanup robot
    `-----'    Send your cruft to /dev/null!
     /| |\
```

> **Clean node_modules, target, .venv, Docker images, Xcode DerivedData, and 50+ cache types. Reclaim 100+ GB of disk space.**

**The Friendly Disk Cleanup Robot** - Inspired by Wall-E, powered by Rust.

null-e is a fast, cross-platform disk cleanup CLI tool that helps developers reclaim disk space by finding and cleaning development artifacts, build caches, and unused files. Works on **macOS**, **Linux**, and **Windows**.

[![Crates.io](https://img.shields.io/crates/v/null-e.svg)](https://crates.io/crates/null-e)
[![Downloads](https://img.shields.io/crates/d/null-e.svg)](https://crates.io/crates/null-e)
![Rust](https://img.shields.io/badge/rust-1.75+-orange.svg)
![License](https://img.shields.io/badge/license-WTFPL-brightgreen.svg)
![Platform](https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-lightgrey.svg)

## Why "null-e"?

> `/dev/null` + Wall-E = **null-e** πŸ€–
>
> Like the adorable trash-compacting robot from the movie, null-e tirelessly cleans up your developer junk and sends it where it belongs - to `/dev/null`!

## What Can null-e Clean?

| Category              | Examples                                          | Typical Size |
| --------------------- | ------------------------------------------------- | ------------ |
| **Project Artifacts** | `node_modules`, `target`, `.venv`, `build`        | 10-100 GB    |
| **Global Caches**     | npm, pip, cargo, go, maven, gradle                | 5-50 GB      |
| **Xcode**             | DerivedData, Simulators, Archives, Device Support | 20-100 GB    |
| **Docker**            | Images, Containers, Volumes, Build Cache          | 10-100 GB    |
| **Android**           | AVD, Gradle, SDK Components                       | 5-30 GB      |
| **ML/AI**             | Huggingface models, Ollama, PyTorch cache         | 10-100 GB    |
| **IDE Caches**        | JetBrains, VS Code, Cursor                        | 2-20 GB      |
| **Homebrew**          | Downloads, Old versions                           | 2-20 GB      |
| **iOS Dependencies**  | CocoaPods, Carthage, SPM                          | 1-10 GB      |
| **Electron Apps**     | Slack, Discord, Spotify, Teams caches             | 1-5 GB       |
| **Game Dev**          | Unity, Unreal, Godot caches                       | 10-100 GB    |
| **Cloud CLI**         | AWS, GCP, Azure, kubectl, Terraform               | 1-5 GB       |
| **macOS System**      | Orphaned containers, App remnants                 | 1-20 GB      |

## Features

- **Multi-language Support**: Node.js, Rust, Python, Go, Java, .NET, Swift, Ruby, PHP, and more
- **Git Protection**: Never accidentally delete uncommitted changes
- **Safe Deletion**: Moves to trash by default with recovery option
- **Parallel Scanning**: Fast directory traversal using multiple threads
- **Analysis Tools**: Find stale projects, duplicate dependencies, optimize git repos
- **Beautiful CLI**: Colored output with progress indicators
- **Cross-Platform**: macOS, Linux, Windows support

## Installation

### Using Cargo (Recommended)

```bash
cargo install null-e
```

### Pre-built Binaries

Download from [GitHub Releases](https://github.com/us/null-e/releases):

- **macOS**: `null-e-darwin-aarch64.tar.gz` (Apple Silicon) / `null-e-darwin-x86_64.tar.gz` (Intel)
- **Linux**: `null-e-linux-x86_64.tar.gz` / `null-e-linux-aarch64.tar.gz`
- **Windows**: `null-e-windows-x86_64.zip`

### Package Managers

```bash
# Homebrew (macOS/Linux) - requires 75+ stars for homebrew-core
brew install null-e          # coming soon

# Scoop (Windows)
scoop bucket add us https://github.com/us/scoop-bucket
scoop install null-e

# AUR (Arch Linux)
yay -S null-e

# Nix
nix-env -iA nixpkgs.null-e   # coming soon
```

### Docker

```bash
docker run -v $(pwd):/workspace ghcr.io/us/null-e
```

### From Source

```bash
git clone https://github.com/us/null-e.git
cd null-e
cargo install --path .
```

## Quick Start

```bash
# Scan current directory for cleanable artifacts
null-e

# Deep sweep - find ALL cleanable items across your system
null-e sweep

# Clean global developer caches (npm, pip, cargo, etc.)
null-e caches

# Analyze git repositories for optimization
null-e git-analyze ~/projects

# Find stale projects not touched in 6 months
null-e stale ~/projects

# Find duplicate dependencies
null-e duplicates ~/projects
```

## Commands Overview

### Core Commands

| Command         | Description                                  |
| --------------- | -------------------------------------------- |
| `null-e`        | Scan current directory for project artifacts |
| `null-e scan`   | Scan with detailed output                    |
| `null-e clean`  | Clean found artifacts (interactive)          |
| `null-e sweep`  | Deep scan for ALL cleanable items            |
| `null-e caches` | Manage global developer caches               |

### Specialized Cleaners

| Command           | Description                         |
| ----------------- | ----------------------------------- |
| `null-e xcode`    | Clean Xcode artifacts               |
| `null-e android`  | Clean Android development artifacts |
| `null-e docker`   | Clean Docker resources              |
| `null-e ml`       | Clean ML/AI model caches            |
| `null-e ide`      | Clean IDE caches                    |
| `null-e homebrew` | Clean Homebrew caches               |
| `null-e ios-deps` | Clean iOS dependency caches         |
| `null-e electron` | Clean Electron app caches           |
| `null-e gamedev`  | Clean game development caches       |
| `null-e cloud`    | Clean cloud CLI caches              |
| `null-e macos`    | Clean macOS system caches           |

### Analysis Tools

| Command              | Description                           |
| -------------------- | ------------------------------------- |
| `null-e git-analyze` | Find large .git repos, suggest git gc |
| `null-e stale`       | Find projects not touched in months   |
| `null-e duplicates`  | Find duplicate dependencies           |

## Usage Examples

### Basic Scanning

```bash
# Scan current directory
null-e

# Scan specific directories
null-e ~/projects ~/work

# Scan with depth limit
null-e -d 5 ~/projects

# Filter by minimum size
null-e -s 100MB ~/projects

# Show all results (no limit)
null-e -a ~/projects

# Verbose output
null-e -v ~/projects
```

### Deep Sweep

```bash
# Find everything cleanable
null-e sweep

# Filter by category
null-e sweep --category xcode
null-e sweep --category docker

# Clean interactively
null-e sweep --clean
```

### Global Caches

```bash
# Show all global caches
null-e caches

# Clean selected caches interactively
null-e caches --clean

# Clean all caches
null-e caches --clean-all
```

### Xcode Cleanup

```bash
# Show Xcode artifacts
null-e xcode

# Clean DerivedData, old simulators, etc.
null-e xcode --clean
```

### Docker Cleanup

```bash
# Show Docker resources
null-e docker

# Clean (excluding volumes)
null-e docker --clean

# Clean including volumes (careful!)
null-e docker --clean --volumes
```

### Git Analysis

```bash
# Analyze git repos in a directory
null-e git-analyze ~/projects

# Run git gc on repos that need it
null-e git-analyze ~/projects --fix

# Dry run
null-e git-analyze ~/projects --fix --dry-run
```

### Stale Project Detection

```bash
# Find projects not touched in 180 days (default)
null-e stale ~/projects

# Custom threshold (90 days)
null-e stale --days 90 ~/projects

# Clean build artifacts from stale projects
null-e stale --days 90 --clean ~/projects
```

### Duplicate Detection

```bash
# Find duplicate dependencies
null-e duplicates ~/projects

# Verbose output with details
null-e duplicates -v ~/projects
```

## Protection Levels

null-e protects your uncommitted work:

```bash
# Warn about uncommitted changes (default)
null-e clean -p warn

# Block cleaning repos with uncommitted changes
null-e clean -p block

# No protection (dangerous!)
null-e clean -p none

# Paranoid mode - require confirmation for everything
null-e clean -p paranoid
```

## Deletion Methods

```bash
# Move to trash (default, safe)
null-e clean -m trash

# Permanent delete (careful!)
null-e clean -m permanent

# Dry run (no deletion)
null-e clean -m dry-run
# or
null-e clean -n
```

## Configuration

Create `~/.config/null-e/config.toml`:

```toml
[general]
default_paths = ["~/projects", "~/work"]
verbose = false

[scan]
max_depth = 10
skip_hidden = true
min_size = 1000000  # 1 MB

[clean]
delete_method = "trash"
protection_level = "warn"

[ui]
use_icons = true
sort_by = "size"
```

### Config Commands

```bash
# Show current config
null-e config

# Initialize config file
null-e config --init

# Show config path
null-e config --path
```

## Project Types Supported

| Language/Framework | Marker Files                         | Cleanable Artifacts                                |
| ------------------ | ------------------------------------ | -------------------------------------------------- |
| **Node.js**        | `package.json`                       | `node_modules`, `.next`, `.nuxt`, `dist`, `.cache` |
| **Rust**           | `Cargo.toml`                         | `target/`                                          |
| **Python**         | `requirements.txt`, `pyproject.toml` | `.venv`, `__pycache__`, `.pytest_cache`            |
| **Go**             | `go.mod`                             | `vendor/`                                          |
| **Java/Kotlin**    | `pom.xml`, `build.gradle`            | `target/`, `build/`, `.gradle/`                    |
| **.NET**           | `*.csproj`                           | `bin/`, `obj/`                                     |
| **Swift**          | `Package.swift`                      | `.build/`, `.swiftpm/`                             |
| **Ruby**           | `Gemfile`                            | `vendor/bundle`, `.bundle`                         |
| **PHP**            | `composer.json`                      | `vendor/`                                          |

## Safety Levels

Each cleanable item has a safety level:

| Level            | Symbol | Meaning                                    |
| ---------------- | ------ | ------------------------------------------ |
| **Safe**         | `βœ“`    | Safe to delete, will be regenerated        |
| **SafeWithCost** | `~`    | Safe but may slow down next operation      |
| **Caution**      | `!`    | May lose some data, verify before deleting |
| **Dangerous**    | `⚠`    | High risk, may break things                |

## Architecture

```
     .---.
    |o   o|
    |  ^  |    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    | === |    β”‚                       CLI                         β”‚
    `-----'    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
     /| |\     β”‚                    Core Engine                    β”‚
               β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
               β”‚  β”‚ Scanner  β”‚  β”‚ Cleaner  β”‚  β”‚ Analysis β”‚        β”‚
               β”‚  β”‚          β”‚  β”‚          β”‚  β”‚  Tools   β”‚        β”‚
               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
               β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
               β”‚                    Modules                        β”‚
               β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”     β”‚
               β”‚  β”‚Plugins β”‚ β”‚Cleanersβ”‚ β”‚ Caches β”‚ β”‚ Docker β”‚     β”‚
               β”‚  β”‚(langs) β”‚ β”‚(system)β”‚ β”‚(global)β”‚ β”‚        β”‚     β”‚
               β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```

## Documentation

Detailed documentation for each module:

- [Cleaners Guide]docs/CLEANERS.md - System cleaners (Xcode, Docker, etc.)
- [Caches Guide]docs/CACHES.md - Global cache management
- [Analysis Guide]docs/ANALYSIS.md - Analysis tools (git, stale, duplicates)

## Development

### Building

```bash
# Debug build
cargo build

# Release build
cargo build --release

# Run tests
cargo test

# Run with logging
RUST_LOG=debug cargo run
```

### Project Structure

```
src/
β”œβ”€β”€ main.rs           # CLI entry point
β”œβ”€β”€ lib.rs            # Library exports
β”œβ”€β”€ analysis/         # Analysis tools
β”‚   β”œβ”€β”€ git.rs        # Git repository analysis
β”‚   β”œβ”€β”€ stale.rs      # Stale project detection
β”‚   └── duplicates.rs # Duplicate dependency detection
β”œβ”€β”€ caches/           # Global cache management
β”œβ”€β”€ cleaners/         # System cleaners
β”‚   β”œβ”€β”€ xcode.rs      # Xcode cleaner
β”‚   β”œβ”€β”€ android.rs    # Android cleaner
β”‚   β”œβ”€β”€ docker.rs     # Docker cleaner
β”‚   β”œβ”€β”€ ml.rs         # ML/AI cleaner
β”‚   β”œβ”€β”€ ide.rs        # IDE cleaner
β”‚   β”œβ”€β”€ homebrew.rs   # Homebrew cleaner
β”‚   β”œβ”€β”€ ios_deps.rs   # iOS dependencies cleaner
β”‚   β”œβ”€β”€ electron.rs   # Electron apps cleaner
β”‚   β”œβ”€β”€ gamedev.rs    # Game development cleaner
β”‚   β”œβ”€β”€ cloud.rs      # Cloud CLI cleaner
β”‚   β”œβ”€β”€ macos.rs      # macOS system cleaner
β”‚   └── logs.rs       # Log cleaner
β”œβ”€β”€ plugins/          # Language plugins
β”œβ”€β”€ core/             # Core scanning/cleaning logic
β”œβ”€β”€ docker/           # Docker integration
β”œβ”€β”€ git/              # Git integration
β”œβ”€β”€ trash/            # Trash/delete operations
└── config/           # Configuration management
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

### Adding a New Cleaner

1. Create a new file in `src/cleaners/`
2. Implement the cleaner with `detect()` method
3. Add to `src/cleaners/mod.rs`
4. Add CLI command in `src/main.rs`
5. Add tests

### Adding a New Plugin

1. Create a new file in `src/plugins/`
2. Implement the `Plugin` trait
3. Register in `src/plugins/mod.rs`
4. Add tests

## License

This project is licensed under the WTFPL - see the [LICENSE](LICENSE) file for details.

## Acknowledgments

- Inspired by [Wall-E]https://www.pixar.com/feature-films/wall-e (the adorable trash robot!)
- Also inspired by [npkill]https://github.com/voidcosmos/npkill and [kondo]https://github.com/tbillington/kondo
- Built with [Rust]https://www.rust-lang.org/

---

```
     .---.
    |o   o|   "Directive: Clean all the things!"
    |  ^  |
    | === |   Made with πŸ’š for developers who need their disk space back.
    `-----'
     /| |\
```