Skip to content

Commit 350b505

Browse files
committed
Rewrite Bleach to Go (v1.0.0)
Completely refactored the application from Bash/Gum to Go/Bubble Tea for improved performance, stability, and responsiveness. Key Changes: - Architecture: Switched to Model-View-Update (MVU) using Bubble Tea. - Dashboard: Unified 'Command Center' with live CPU/RAM/Disk stats. - Actions: Interactive menu and operations modules (cleanup, updates). - Installer: Updated install.sh to build the Go binary from source. - CI/CD: Replaced Shellcheck workflow with Go Build/Test workflow. - Documentation: Updated README.md and Walkthrough for v1.0.0. Breaking Changes: - Removed legacy Bash scripts from entry point. - Build from source is now required (handled by installer).
1 parent 3ab4bb0 commit 350b505

File tree

14 files changed

+821
-365
lines changed

14 files changed

+821
-365
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
name: Shellcheck
1+
name: Go Build
22

33
on:
44
push:
5-
branches: [ "main", "dev" ]
5+
branches: [ "main" ]
66
pull_request:
7-
branches: [ "main", "dev" ]
7+
branches: [ "main" ]
88

99
jobs:
10-
shellcheck:
11-
name: Shellcheck
10+
build:
1211
runs-on: ubuntu-latest
1312
steps:
14-
- uses: actions/checkout@v3
15-
- name: Run ShellCheck
16-
uses: ludeeus/action-shellcheck@master
17-
with:
18-
scandir: './src'
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v4
17+
with:
18+
go-version: '1.23'
19+
20+
- name: Build
21+
run: go build -v ./cmd/bleach
22+
23+
- name: Test
24+
run: go test -v ./internal/...
1925
- name: Check Main Script
2026
uses: ludeeus/action-shellcheck@master
2127
with:

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,10 @@ cython_debug/
140140
*.swp
141141
*.swo
142142

143-
linutil
143+
linutil
144+
# Go
145+
bleach
146+
*.exe
147+
*.test
148+
*.out
149+
go.work

README.md

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,69 @@
1-
# Bleach (Bash Edition)
2-
3-
Bleach is a powerful, interactive terminal utility designed to keep your Linux system clean, fast, and private. Rewritten entirely in **Bash** for maximum portability and control, it uses [gum](https://github.com/charmbracelet/gum) to provide a modern, easy-to-use interface.
4-
5-
## ✨ Features
6-
7-
- **Interactive TUI**: Navigate easy menus to select exactly what you want to clean.
8-
- **Deep Clean & Storage Recovery**:
9-
- **System**: APT (autoremove/clean), Docker (prune), Logs (vacuum), Temp files (`/tmp`), Trash.
10-
- **Dev**: Node (`npm`, `pnpm`, `yarn`), Python (deep `__pycache__` scan), Build Artifacts (`dist`, `build`).
11-
- **IDE**: Clear caches for VS Code and JetBrains IDEs.
12-
- **Privacy**: Clear user thumbnail caches.
13-
- **System Maintenance**:
14-
- **SSD Trim**: Optimize SSD performance via `fstrim`.
15-
- **Storage Reporting**: Tracks and reports exactly how much disk space was reclaimed after every session.
16-
- **Auto-Updates**:
17-
- **Self-Update**: Built-in weekly check for new versions.
18-
- **APT Hook**: Optional integration to check for Bleach updates whenever you run `sudo apt update`.
19-
- **Logging**: Detailed logs of every action kept in `~/.local/share/bleach/logs`.
1+
# Bleach (Go Version)
202

21-
## 🚀 Installation
22-
23-
### One-Line Installer
24-
This will install Bleach to `/opt/bleach`, create a symlink at `/usr/local/bin/bleach`, and install the `gum` dependency automatically.
25-
26-
```bash
27-
curl -fsSL https://raw.githubusercontent.com/maruf-pfc/bleach/main/install.sh | sudo bash
28-
```
3+
A lightning-fast, terminal-based system cleaner and dashboard for Linux, rewritten in **Go** using the **Bubble Tea** framework.
294

30-
*(Note: If you are running from a local clone, just run `sudo ./install.sh`)*
5+
![License](https://img.shields.io/badge/license-MIT-blue.svg)
6+
![Go](https://img.shields.io/badge/go-1.23+-00ADD8.svg?logo=go&logoColor=white)
317

32-
### Prerequisites
33-
Bleach uses **[gum](https://github.com/charmbracelet/gum)** for its UI. The installer handles this for you on Debian/Ubuntu systems.
8+
## Features
349

35-
## 🛠 Usage
10+
- **Unified Dashboard**: Real-time "Command Center" view with live CPU, RAM, and Disk usage bars.
11+
- **System Operations**:
12+
- **Cleanup**: One-click `apt clean`, `autoremove`, and log rotation.
13+
- **Updates**: streamlining `apt update && upgrade`.
14+
- **Maintenance**: Automated system maintenance tasks.
15+
- **Responsive TUI**: Adapts layout automatically (Side-by-side or Stacked) based on terminal window size.
16+
- **Safe & Transparent**: Executes standard Linux commands (`sudo apt ...`) and streams output directly to you.
3617

37-
Run the tool anytime from your terminal:
18+
## 🚀 Installation
3819

20+
### From Source (Recommended)
21+
22+
Requires [Go 1.23+](https://go.dev/dl/) installed.
23+
24+
1. Clone the repository:
25+
```bash
26+
git clone https://github.com/maruf-pfc/bleach.git
27+
cd bleach
28+
```
29+
2. Build the binary:
30+
```bash
31+
go build ./cmd/bleach
32+
```
33+
3. Run:
34+
```bash
35+
./bleach
36+
```
37+
38+
### Optional: Install Globally
3939
```bash
40-
bleach
40+
sudo mv bleach /usr/local/bin/
4141
```
4242

43-
### Modes
44-
- **System Cleanup**: Quick access to disk space recovery tools.
45-
- **System Updates**: Centralized update management for APT, Flatpak, and Snap.
46-
- **Maintenance**: Utilities for long-term health (SSD Trim, etc.).
47-
- **View Logs**: Read what Bleach has done recently.
43+
## 🎮 Usage
4844

49-
### Auto-Update
50-
Bleach checks for updates weekly. You can also manually trigger a check:
45+
Launch Bleach from your terminal:
5146
```bash
52-
bleach --check-update
47+
./bleach
5348
```
5449

55-
## 🤝 Contributing
56-
57-
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to add new modules or improve existing ones.
58-
59-
## 📜 License
60-
61-
MIT License. See [LICENSE](LICENSE) for details.
50+
### Interface
51+
- **Dashboard (Top)**: Shows your System Info (Hostname, Kernel) and Live Resource Usage.
52+
- **Menu (Bottom Left)**: Navigate using partially `Up` / `Down` arrows.
53+
- **Output (Bottom Right)**: Displays real-time logs of actions performed.
54+
55+
### Controls
56+
| Key | Action |
57+
| :--- | :--- |
58+
| `` / `` / `k` / `j` | Navigate Menu |
59+
| `Enter` | Select Action |
60+
| `q` / `Ctrl+C` | Quit |
61+
62+
## 🛠 Tech Stack
63+
- **Language**: Go (Golang)
64+
- **Framework**: [Bubble Tea](https://github.com/charmbracelet/bubbletea) (The Elm Architecture for TUI)
65+
- **Styling**: [Lip Gloss](https://github.com/charmbracelet/lipgloss)
66+
- **System Stats**: [gopsutil](https://github.com/shirou/gopsutil)
67+
68+
## License
69+
MIT License. Use at your own risk.

bleach

Lines changed: 0 additions & 223 deletions
This file was deleted.

0 commit comments

Comments
 (0)