Skip to content

Commit 9cb67c0

Browse files
committed
merge: Integrate multi-ecosystem scanner support v1.0.1
- Add 7 new scanner types: Flutter, Go, Python, Rust, Homebrew, Docker, Java/Kotlin - Total 10 ecosystem scanners now supported (iOS, Android, Node + 7 new) - Enhanced TUI with new scanner types - All tests passing, 35 items scannable (43.2 GB) - Version bumped to 1.0.1 - Documentation archived and updated
2 parents 44f40d9 + cb490a9 commit 9cb67c0

File tree

69 files changed

+27878
-120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+27878
-120
lines changed

.gitignore

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ GoogleService-Info.plist
5858

5959
repomix-output.xml
6060
.serena/cache
61-
plans/**/*
6261
!plans/templates/*
6362
screenshots/*
6463
docs/screenshots/*
@@ -77,6 +76,11 @@ dev-cleaner
7776
.claude/settings.bak.json
7877
.claude
7978
CLAUDE.md
80-
plans
81-
docs
82-
design-mockups
79+
# plans
80+
# docs
81+
design-mockups
82+
/plans/templates/
83+
/.idea/git_toolbox_prj.xml
84+
/.idea/mac-dev-cleaner-cli.iml
85+
/.idea/modules.xml
86+
/.idea/vcs.xml

.idea/.gitignore

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ Mac Dev Cleaner is a CLI tool that helps developers reclaim disk space by removi
1212
- **Xcode** - DerivedData, Archives, Caches
1313
- **Android** - Gradle caches, SDK caches
1414
- **Node.js** - node_modules, npm/yarn/pnpm/bun caches
15+
- **Flutter/Dart** - .pub-cache, .dart_tool, build artifacts
16+
- **Python** - pip/poetry/uv caches, virtualenvs, __pycache__
17+
- **Rust** - Cargo registry, git caches, target directories
18+
- **Go** - build cache, module cache
19+
- **Homebrew** - download caches
20+
- **Docker** - unused images, containers, volumes, build cache
21+
- **Java/Kotlin** - Maven .m2, Gradle caches, build directories
1522

1623
## Installation
1724

@@ -43,6 +50,13 @@ dev-cleaner scan
4350
dev-cleaner scan --ios
4451
dev-cleaner scan --android
4552
dev-cleaner scan --node
53+
dev-cleaner scan --flutter
54+
dev-cleaner scan --python
55+
dev-cleaner scan --rust
56+
dev-cleaner scan --go
57+
dev-cleaner scan --homebrew
58+
dev-cleaner scan --docker
59+
dev-cleaner scan --java
4660
```
4761

4862
**Example Output:**
@@ -102,6 +116,56 @@ dev-cleaner clean --ios --confirm
102116
- `~/.yarn/cache/`
103117
- `~/.bun/install/cache/`
104118

119+
### Flutter/Dart
120+
- `~/.pub-cache/`
121+
- `~/.dart_tool/`
122+
- `~/Library/Caches/Flutter/`
123+
- `~/Library/Caches/dart/`
124+
- `*/build/` (in Flutter projects)
125+
- `*/.dart_tool/` (in Flutter projects)
126+
- `*/ios/build/`, `*/android/build/` (in Flutter projects)
127+
128+
### Python
129+
- `~/.cache/pip/` (pip cache)
130+
- `~/.cache/pypoetry/` (Poetry cache)
131+
- `~/.cache/uv/` (uv cache)
132+
- `~/.cache/pdm/` (pdm cache)
133+
- `*/__pycache__/` (bytecode cache)
134+
- `*/venv/`, `*/.venv/` (virtual environments)
135+
- `*/.pytest_cache/` (pytest cache)
136+
- `*/.tox/` (tox environments)
137+
- `*/.mypy_cache/`, `*/.ruff_cache/` (linter caches)
138+
139+
### Rust/Cargo
140+
- `~/.cargo/registry/` (package registry)
141+
- `~/.cargo/git/` (git dependencies)
142+
- `*/target/` (build artifacts, in Rust projects with Cargo.toml)
143+
144+
### Go
145+
- `~/Library/Caches/go-build/` (build cache, or `$GOCACHE`)
146+
- `~/go/pkg/mod/` (module cache, or `$GOMODCACHE`)
147+
148+
### Homebrew
149+
- `~/Library/Caches/Homebrew/` (user cache)
150+
- `/opt/homebrew/Library/Caches/Homebrew/` (Apple Silicon)
151+
- `/usr/local/Homebrew/Library/Caches/Homebrew/` (Intel)
152+
153+
### Docker
154+
- Unused images (via `docker image prune`)
155+
- Stopped containers (via `docker container prune`)
156+
- Unused volumes (via `docker volume prune`)
157+
- Build cache (via `docker builder prune`)
158+
159+
**Note:** Requires Docker daemon to be running.
160+
161+
### Java/Kotlin
162+
- `~/.m2/repository/` (Maven local repository)
163+
- `~/.gradle/wrapper/` (Gradle wrapper distributions)
164+
- `~/.gradle/daemon/` (Gradle daemon logs)
165+
- `*/target/` (Maven build directories, with pom.xml)
166+
- `*/build/` (Gradle build directories, with build.gradle)
167+
- `*/.gradle/` (Project Gradle cache)
168+
105169
## Development
106170

107171
```bash
@@ -118,10 +182,11 @@ go test ./...
118182
## Roadmap
119183

120184
- [x] MVP: Scan and clean commands
121-
- [ ] TUI with interactive selection (BubbleTea)
185+
- [x] TUI with interactive selection (BubbleTea)
186+
- [x] Support for 10 development ecosystems
122187
- [ ] Config file support
123188
- [ ] Homebrew distribution
124-
- [ ] Progress bars
189+
- [ ] Scheduled automatic cleanup
125190

126191
## License
127192

cmd/root/clean.go

Lines changed: 83 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,77 @@ import (
1616
)
1717

1818
var (
19-
dryRun bool
20-
confirmFlag bool
21-
cleanIOS bool
22-
cleanAndroid bool
23-
cleanNode bool
24-
useTUI bool
19+
dryRun bool
20+
confirmFlag bool
21+
cleanIOS bool
22+
cleanAndroid bool
23+
cleanNode bool
24+
cleanFlutter bool
25+
cleanPython bool
26+
cleanRust bool
27+
cleanGo bool
28+
cleanHomebrew bool
29+
cleanDocker bool
30+
cleanJava bool
31+
useTUI bool
2532
)
2633

2734
// cleanCmd represents the clean command
2835
var cleanCmd = &cobra.Command{
29-
Use: "clean",
36+
Use: "clean [flags]",
3037
Short: "Clean development artifacts",
3138
Long: `Interactively select and clean development artifacts.
3239
33-
By default, runs in TUI mode with interactive selection.
34-
Use --confirm to actually delete files (default is dry-run).
40+
By default, runs in TUI mode with interactive selection and dry-run
41+
enabled (preview only). Use --confirm to actually delete files.
42+
43+
The TUI provides:
44+
• Real-time deletion progress with package-manager style output
45+
• Tree navigation for exploring nested folders
46+
• Quick single-item cleanup or batch operations
47+
• All operations logged to ~/.dev-cleaner.log
48+
49+
Safety Features:
50+
✓ Dry-run mode by default (files are safe)
51+
✓ Confirmation required before deletion
52+
✓ Path validation (never touches system files)
53+
✓ All actions logged for audit trail
3554
3655
Examples:
37-
dev-cleaner clean # Interactive TUI (dry-run)
38-
dev-cleaner clean --confirm # Interactive TUI (actually delete)
39-
dev-cleaner clean --no-tui # Simple text mode
40-
dev-cleaner clean --ios # Clean iOS artifacts only`,
56+
dev-cleaner clean # Interactive TUI (dry-run)
57+
dev-cleaner clean --confirm # Interactive TUI (actually delete)
58+
dev-cleaner clean --no-tui # Simple text mode
59+
dev-cleaner clean --ios --confirm # Clean iOS artifacts only
60+
dev-cleaner clean --node # Preview Node.js cleanup (dry-run)
61+
62+
Flags:
63+
--confirm Actually delete files (disables dry-run)
64+
--dry-run Preview only, don't delete (default: true)
65+
--ios Clean iOS/Xcode artifacts only
66+
--android Clean Android/Gradle artifacts only
67+
--node Clean Node.js artifacts only
68+
--flutter Clean Flutter/Dart artifacts only
69+
--python Clean Python caches
70+
--rust Clean Rust/Cargo caches
71+
--go Clean Go caches
72+
--homebrew Clean Homebrew caches
73+
--docker Clean Docker images, containers, volumes
74+
--java Clean Maven/Gradle caches
75+
--no-tui, -T Disable TUI, use simple text mode
76+
--tui Use interactive TUI mode (default: true)
77+
78+
TUI Keyboard Shortcuts:
79+
c Quick clean current item (ignores selections)
80+
Enter Clean all selected items (batch mode)
81+
Space Toggle selection
82+
a/n Select all / none
83+
→/l Enter tree mode (explore folders)
84+
? Show help screen
85+
86+
Important:
87+
• 'c' clears all selections and cleans ONLY the current item
88+
• 'Enter' cleans ALL selected items (batch operation)
89+
• Tree mode allows deletion at any folder level`,
4190
Run: runClean,
4291
}
4392

@@ -49,6 +98,13 @@ func init() {
4998
cleanCmd.Flags().BoolVar(&cleanIOS, "ios", false, "Clean iOS/Xcode artifacts only")
5099
cleanCmd.Flags().BoolVar(&cleanAndroid, "android", false, "Clean Android/Gradle artifacts only")
51100
cleanCmd.Flags().BoolVar(&cleanNode, "node", false, "Clean Node.js artifacts only")
101+
cleanCmd.Flags().BoolVar(&cleanFlutter, "flutter", false, "Clean Flutter/Dart artifacts only")
102+
cleanCmd.Flags().BoolVar(&cleanPython, "python", false, "Clean Python caches")
103+
cleanCmd.Flags().BoolVar(&cleanRust, "rust", false, "Clean Rust/Cargo caches")
104+
cleanCmd.Flags().BoolVar(&cleanGo, "go", false, "Clean Go caches")
105+
cleanCmd.Flags().BoolVar(&cleanHomebrew, "homebrew", false, "Clean Homebrew caches")
106+
cleanCmd.Flags().BoolVar(&cleanDocker, "docker", false, "Clean Docker images, containers, volumes")
107+
cleanCmd.Flags().BoolVar(&cleanJava, "java", false, "Clean Maven/Gradle caches")
52108
cleanCmd.Flags().BoolVar(&useTUI, "tui", true, "Use interactive TUI mode (default)")
53109
cleanCmd.Flags().BoolP("no-tui", "T", false, "Disable TUI, use simple text mode")
54110
}
@@ -76,14 +132,23 @@ func runClean(cmd *cobra.Command, args []string) {
76132
MaxDepth: 3,
77133
}
78134

79-
if cleanIOS || cleanAndroid || cleanNode {
135+
specificFlagSet := cleanIOS || cleanAndroid || cleanNode || cleanFlutter ||
136+
cleanPython || cleanRust || cleanGo || cleanHomebrew ||
137+
cleanDocker || cleanJava
138+
139+
if specificFlagSet {
80140
opts.IncludeXcode = cleanIOS
81141
opts.IncludeAndroid = cleanAndroid
82142
opts.IncludeNode = cleanNode
143+
opts.IncludeFlutter = cleanFlutter
144+
opts.IncludePython = cleanPython
145+
opts.IncludeRust = cleanRust
146+
opts.IncludeGo = cleanGo
147+
opts.IncludeHomebrew = cleanHomebrew
148+
opts.IncludeDocker = cleanDocker
149+
opts.IncludeJava = cleanJava
83150
} else {
84-
opts.IncludeXcode = true
85-
opts.IncludeAndroid = true
86-
opts.IncludeNode = true
151+
opts = types.DefaultScanOptions()
87152
}
88153

89154
ui.PrintHeader("Scanning for development artifacts...")
@@ -104,7 +169,7 @@ func runClean(cmd *cobra.Command, args []string) {
104169

105170
// Use TUI or simple mode
106171
if useTUI {
107-
if err := tui.Run(results, dryRun); err != nil {
172+
if err := tui.Run(results, dryRun, Version); err != nil {
108173
fmt.Fprintf(os.Stderr, "TUI error: %v\n", err)
109174
os.Exit(1)
110175
}

cmd/root/root.go

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
var (
1212
// Version is set at build time
13-
Version = "dev"
13+
Version = "1.0.1"
1414
)
1515

1616
// rootCmd represents the base command
@@ -20,16 +20,47 @@ var rootCmd = &cobra.Command{
2020
Long: `Mac Dev Cleaner - A CLI tool to clean development project artifacts
2121
2222
Quickly free up disk space by removing:
23-
• Xcode DerivedData and caches
24-
• Android Gradle caches
23+
• Xcode DerivedData, Archives, and caches
24+
• Android Gradle caches and SDK artifacts
2525
• Node.js node_modules directories
2626
• Package manager caches (npm, yarn, pnpm, bun)
27+
• Flutter/Dart build artifacts and pub-cache
2728
28-
Examples:
29-
dev-cleaner scan # Scan and show all cleanable items
30-
dev-cleaner scan --ios # Scan iOS/Xcode only
31-
dev-cleaner clean # Interactive clean (dry-run by default)
32-
dev-cleaner clean --confirm # Actually delete selected items`,
29+
Features:
30+
✨ Interactive TUI with keyboard navigation
31+
✨ Tree mode for exploring nested folders
32+
✨ Dry-run mode by default (safe preview)
33+
✨ Quick clean with single keypress
34+
✨ Batch operations for multiple items
35+
✨ Real-time deletion progress tracking
36+
37+
Scan Examples:
38+
dev-cleaner scan # Scan all + launch TUI
39+
dev-cleaner scan --ios # Scan iOS/Xcode only
40+
dev-cleaner scan --android # Scan Android/Gradle only
41+
dev-cleaner scan --node # Scan Node.js artifacts only
42+
dev-cleaner scan --flutter # Scan Flutter/Dart only
43+
dev-cleaner scan --no-tui # Text output without TUI
44+
45+
Clean Examples:
46+
dev-cleaner clean # Interactive TUI (dry-run)
47+
dev-cleaner clean --confirm # Interactive TUI (actually delete)
48+
dev-cleaner clean --ios --confirm # Clean iOS artifacts only
49+
dev-cleaner clean --no-tui # Simple text mode cleanup
50+
51+
TUI Keyboard Shortcuts:
52+
↑/↓, k/j Navigate up/down
53+
Space Toggle selection
54+
a Select all items
55+
n Deselect all items
56+
c Quick clean current item (single-item mode)
57+
Enter Clean all selected items (batch mode)
58+
→/l Drill down into folder (tree mode)
59+
←/h Go back to parent (in tree mode)
60+
? Show detailed help screen
61+
q Quit
62+
63+
Tip: Use 'dev-cleaner scan' to start the interactive TUI mode!`,
3364
Version: Version,
3465
}
3566

0 commit comments

Comments
 (0)