brain-cleaner 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.es.md +20 -6
- package/README.md +29 -17
- package/bin/brain-cleaner.js +29 -11
- package/package.json +18 -8
package/README.es.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Brain Cleaner
|
|
2
2
|
|
|
3
3
|
**Language / Idioma:**
|
|
4
|
-
[🇬🇧 English](https://github.com/konstantinWDK/brain-cleaner/blob/main/README.md)
|
|
4
|
+
🇪🇸 Español | [🇬🇧 English](https://github.com/konstantinWDK/brain-cleaner/blob/main/README.md)
|
|
5
5
|
|
|
6
6
|
[](https://www.python.org/downloads/)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -9,13 +9,27 @@
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
### 🚀 Instalación Recomendada (Global)
|
|
13
|
+
Instala directamente desde NPM para obtener la última versión estable:
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g brain-cleaner
|
|
17
|
+
```
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
#### Alternativa: Instalación desde el Código Fuente (Python)
|
|
20
|
+
Si prefieres instalar vía Python/Pip directamente desde el repositorio:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install git+https://github.com/konstantinwdk/brain-cleaner
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
### 🚀 Requisitos
|
|
29
|
+
- Se requiere **Python 3.9+**.
|
|
30
|
+
- **Node.js 14+** (si se instala por NPM).
|
|
31
|
+
|
|
32
|
+
---
|
|
19
33
|
|
|
20
34
|
## Inicio Rápido (Instalación y Ejecución)
|
|
21
35
|
|
package/README.md
CHANGED
|
@@ -1,33 +1,45 @@
|
|
|
1
1
|
# Brain Cleaner
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/brain-cleaner)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
|
|
3
7
|
**Language / Idioma:**
|
|
4
8
|
🇬🇧 English | [🇪🇸 Español](https://github.com/konstantinWDK/brain-cleaner/blob/main/README.es.md)
|
|
5
9
|
|
|
6
|
-
[](https://www.python.org/downloads/)
|
|
7
|
-
[](https://opensource.org/licenses/MIT)
|
|
8
|
-
[](https://www.apple.com/macos/)
|
|
9
|
-
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
**Brain Cleaner** is a
|
|
12
|
+
**Brain Cleaner** is a professional CLI utility designed to reclaim disk space by identifying and removing digital noise:
|
|
13
|
+
- **AI Residue Cleaner** — Finds cache, logs, and config files from Gemini, Claude, Cursor, Windsurf, and more.
|
|
14
|
+
- **NPM Optimization** — Detects and safely deletes heavy `node_modules` folders from your development projects.
|
|
15
|
+
- **Interactive UI** — High-performance terminal interface with granular selection and safety checks.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
### ⚙️ Technical Architecture
|
|
18
|
+
While distributed via NPM for ease of use, Brain Cleaner is a hybrid tool. The Node.js wrapper automatically:
|
|
19
|
+
1. Detects your local Python environment.
|
|
20
|
+
2. **Auto-installs missing dependencies** (`blessed`, `Pillow`) on first run.
|
|
21
|
+
3. Seamlessly executes the core Python cleaning engine.
|
|
15
22
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Granular Selection — Interactive file tree to review and exclude individual files from deletion.
|
|
23
|
+
### 🚀 Recommended Installation (Global)
|
|
24
|
+
Install directly from NPM to get the latest stable version:
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g brain-cleaner
|
|
28
|
+
```
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
#### Alternative: Install from Source (Python)
|
|
31
|
+
If you prefer to install via Python/Pip directly from the repository:
|
|
23
32
|
|
|
24
|
-
|
|
33
|
+
```bash
|
|
34
|
+
pip install git+https://github.com/konstantinwdk/brain-cleaner
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 🚀 Requirements
|
|
38
|
+
- **Python 3.9+** is required.
|
|
39
|
+
- **Node.js 14+** (if installing via NPM).
|
|
40
|
+
|
|
41
|
+
## Quick Start
|
|
25
42
|
|
|
26
|
-
1. **Clone the repository**:
|
|
27
|
-
```bash
|
|
28
|
-
git clone https://github.com/konstantinwdk/brain-cleaner.git
|
|
29
|
-
```
|
|
30
|
-
2. **Navigate to the folder**:
|
|
31
43
|
```bash
|
|
32
44
|
cd brain-cleaner
|
|
33
45
|
```
|
package/bin/brain-cleaner.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
const { spawn } = require('child_process');
|
|
3
|
+
const { spawn, execSync } = require('child_process');
|
|
4
4
|
const path = require('path');
|
|
5
|
-
const fs = require('fs');
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
|
-
* JS Wrapper for Brain Cleaner (Python)
|
|
7
|
+
* Enhanced JS Wrapper for Brain Cleaner (Python)
|
|
8
|
+
* Handles auto-installation of dependencies.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
function findPython() {
|
|
12
|
-
const commands = ['python3', 'python'];
|
|
13
|
-
const { execSync } = require('child_process');
|
|
14
|
-
|
|
12
|
+
const commands = ['python3', 'python', 'py'];
|
|
15
13
|
for (const cmd of commands) {
|
|
16
14
|
try {
|
|
17
15
|
execSync(`${cmd} --version`, { stdio: 'ignore' });
|
|
@@ -23,21 +21,41 @@ function findPython() {
|
|
|
23
21
|
return null;
|
|
24
22
|
}
|
|
25
23
|
|
|
24
|
+
function checkAndInstallDeps(python) {
|
|
25
|
+
console.log('\x1b[36mFinalizing Brain Cleaner installation...\x1b[0m');
|
|
26
|
+
const deps = ['blessed', 'Pillow'];
|
|
27
|
+
|
|
28
|
+
for (const dep of deps) {
|
|
29
|
+
try {
|
|
30
|
+
// Check if dependency exists
|
|
31
|
+
execSync(`${python} -c "import ${dep.toLowerCase()}"`, { stdio: 'ignore' });
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.log(`\x1b[33mDependency '${dep}' not found. Installing...\x1b[0m`);
|
|
34
|
+
try {
|
|
35
|
+
execSync(`${python} -m pip install ${dep}`, { stdio: 'inherit' });
|
|
36
|
+
} catch (pipErr) {
|
|
37
|
+
console.error(`\x1b[31mFailed to install '${dep}'. Please run 'pip install ${dep}' manually.\x1b[0m`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
26
43
|
const python = findPython();
|
|
27
44
|
|
|
28
45
|
if (!python) {
|
|
29
46
|
console.error('\x1b[31mError: Python not found!\x1b[0m');
|
|
30
|
-
console.error('Brain Cleaner requires Python 3.9 or higher
|
|
31
|
-
console.error('Please install Python
|
|
47
|
+
console.error('Brain Cleaner requires Python 3.9 or higher.');
|
|
48
|
+
console.error('Please install Python: https://www.python.org/downloads/');
|
|
32
49
|
process.exit(1);
|
|
33
50
|
}
|
|
34
51
|
|
|
52
|
+
// Ensure dependencies are present
|
|
53
|
+
checkAndInstallDeps(python);
|
|
54
|
+
|
|
35
55
|
// Path to the python entry point
|
|
36
56
|
const scriptPath = path.join(__dirname, '..', 'console', 'brain_cleaner_cli.py');
|
|
37
|
-
|
|
38
|
-
// Since we are running from NPM, we might need to ensure dependencies are installed
|
|
39
|
-
// For now, we just pass the arguments to the python script
|
|
40
57
|
const args = process.argv.slice(2);
|
|
58
|
+
|
|
41
59
|
const pythonProcess = spawn(python, [scriptPath, ...args], {
|
|
42
60
|
stdio: 'inherit',
|
|
43
61
|
env: { ...process.env, PYTHONPATH: path.join(__dirname, '..') }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "brain-cleaner",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Professional CLI utility to reclaim disk space by removing residues from AI tools (Gemini, Claude, Cursor) and heavy node_modules folders. Optimized for system performance and digital decluttering.",
|
|
5
5
|
"main": "bin/brain-cleaner.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"brain-cleaner": "bin/brain-cleaner.js"
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
11
|
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/konstantinwdk/brain-cleaner.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/konstantinwdk/brain-cleaner/issues"
|
|
18
|
+
},
|
|
19
|
+
"homepage": "https://github.com/konstantinwdk/brain-cleaner#readme",
|
|
12
20
|
"author": "Konstantin <info@webdesignerk.com>",
|
|
13
21
|
"license": "MIT",
|
|
14
22
|
"keywords": [
|
|
@@ -17,13 +25,15 @@
|
|
|
17
25
|
"system",
|
|
18
26
|
"npm",
|
|
19
27
|
"node_modules",
|
|
20
|
-
"disk-space"
|
|
28
|
+
"disk-space",
|
|
29
|
+
"ai-tools-cleaner",
|
|
30
|
+
"gemini",
|
|
31
|
+
"claude",
|
|
32
|
+
"cursor-cleaner",
|
|
33
|
+
"cleanup-utility",
|
|
34
|
+
"developer-tools"
|
|
21
35
|
],
|
|
22
36
|
"engines": {
|
|
23
37
|
"node": ">=14.0.0"
|
|
24
|
-
}
|
|
25
|
-
"bugs": {
|
|
26
|
-
"url": "https://github.com/konstantinwdk/brain-cleaner/issues"
|
|
27
|
-
},
|
|
28
|
-
"homepage": "https://github.com/konstantinwdk/brain-cleaner#readme"
|
|
38
|
+
}
|
|
29
39
|
}
|