Metadata-Version: 2.4
Name: toolbox-universal
Version: 0.3.0.dev0
Summary: A universal high-performance CLI command tool for offline file processing, AI tasks, and automation.
Author: CrystalDust - The Creator Of ToolBox (toolbox-universal)
License: MIT
Project-URL: Homepage, https://github.com/CrystalDustt-V2/toolbox
Project-URL: Repository, https://github.com/CrystalDustt-V2/toolbox
Project-URL: Issues, https://github.com/CrystalDustt-V2/toolbox/issues
Project-URL: Changelog, https://github.com/CrystalDustt-V2/toolbox/blob/master/CHANGELOG.md
Keywords: cli,file-processing,automation,workflow,ai,security
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Utilities
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.1.7
Requires-Dist: rich>=13.7.0
Requires-Dist: pydantic>=2.5.3
Requires-Dist: pyyaml>=6.0.1
Requires-Dist: pillow>=10.1.0
Requires-Dist: pypdf>=3.17.1
Requires-Dist: qrcode>=7.4.2
Requires-Dist: pytesseract>=0.3.10
Requires-Dist: pdf2image>=1.17.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: rembg>=2.0.53
Requires-Dist: onnxruntime>=1.16.0
Requires-Dist: watchdog>=3.0.0
Requires-Dist: schedule>=1.2.1
Requires-Dist: opencv-python>=4.8.0
Requires-Dist: openai-whisper>=20231117
Requires-Dist: soundfile>=0.12.1
Requires-Dist: torch>=2.0.0
Requires-Dist: numpy>=1.24.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4.3; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: pyinstaller>=6.3.0; extra == "dev"
Requires-Dist: mkdocs>=1.5.3; extra == "dev"
Requires-Dist: mkdocs-material>=9.5.3; extra == "dev"
Dynamic: license-file

# 🛠️ ToolBox CLI

A powerful, universal, and offline CLI utility suite for file processing, conversion, and management. Designed for engineers, researchers, and power users who need a robust toolset that works anywhere.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)

## 🌟 Key Features

- **Universal Input**: Every command supports both **local files** and **direct web links** (URLs).
- **High-Performance Concurrency**: Built-in parallel processing for batch operations via `--parallel`.
- **AI-Powered Capabilities**: Integrated AI tools for background removal and advanced OCR.
- **Privacy & Security**: Secure file shredding, metadata sanitization, and AES-256-GCM encryption.
- **Modular Plugin Architecture**: Easily extendable with a clean plugin system.
- **Workflow Automation**: Run, watch, or schedule complex sequences of commands via YAML.
- **Dry-Run Mode**: Every command supports `--dry-run` to validate operations without making changes.

## 🧩 Plugins & Capabilities

### 📁 File & Security
- **`hash`**: Calculate MD5, SHA1, SHA256, or SHA512.
- **`shred`**: Securely overwrite files (DoD 5220.22-M) to prevent recovery.
- **`encrypt` / `decrypt`**: AES-256-GCM file protection.
- **`batch-rename`**: Advanced renaming with parallel support.
- **`info`**: Detailed file statistics and metadata.

### 🖼️ Image Processing
- **`remove-bg`**: **AI-powered** background removal using `rembg`.
- **`convert` / `resize` / `crop`**: Standard image manipulations.
- **`ocr`**: Extract text with advanced preprocessing.
- **`to-sticker`**: Create WhatsApp-ready stickers.
- **`exif-strip`**: Remove privacy-sensitive metadata.

### 🎥 Video & Audio
- **`watermark` / `remove-watermark`**: Add or remove logos/text from video.
- **`to-sticker`**: Convert videos directly to WhatsApp stickers.
- **`extract-frames`**: Pull high-quality frames from video.
- **`normalize`**: Level audio volume using `loudnorm`.
- **`trim` / `merge` / `compress`**: Core media editing tools.

### 📄 Document & PDF
- **`sanitize`**: Remove metadata and hidden information from PDFs.
- **`convert`**: Universal document conversion via LibreOffice.
- **`merge` / `split` / `rotate`**: Robust PDF management.
- **`extract-text`**: OCR-based text extraction from PDFs.

### 📊 Data & Utilities
- **`sql-export`**: Export JSON/CSV/YAML datasets to SQLite.
- **`convert`**: Seamlessly switch between JSON, CSV, and YAML.
- **`qr`**: Generate QR codes from any text or link.
- **`network info/scan`**: Connection diagnostics and port scanning.

## 🚀 Getting Started

### Prerequisites

ToolBox relies on specialized engines:
- **FFmpeg**: Video/Audio processing.
- **Tesseract**: OCR capabilities.
- **LibreOffice**: Document conversion.
- **Poppler**: PDF processing.

### Installation

#### 🚀 Recommended: Using pipx (Automatic PATH setup)
`pipx` is the best way to install ToolBox. It installs the tool in an isolated environment and **automatically handles your system PATH** so the `toolbox` command works immediately.

```bash
# If you don't have pipx yet:
python -m pip install --user pipx
python -m pipx ensurepath

# Install ToolBox:
pipx install toolbox-universal
```
*Note: You may need to restart your terminal after installing `pipx` for the first time.*

#### Alternative: Using pip
```bash
pip install toolbox-universal
```

#### Portable: Run via Python
If you don't want to install it:
```bash
python -m toolbox --help
```

2. **Setup Engines (Windows)**:
   ```bash
   toolbox check  # Check current status
   python setup_engines.py  # Auto-download portable engines
   ```

## 📖 Advanced Usage

### Parallel Batch Processing
```bash
# Resize all JPEGs in a folder using 8 worker threads
toolbox image resize --glob "*.jpg" -w 800 --parallel --workers 8
```

### Automation (Workflows)
```bash
# Run a sequence of commands
toolbox workflow run process_images.yaml

# Watch a directory for new files and auto-trigger a workflow
toolbox workflow watch ./incoming my_workflow.yaml --ext .pdf

# Schedule a workflow to run every 60 minutes
toolbox workflow schedule maintenance.yaml --interval 60 --immediate
```

### Logging
```bash
# Run a command and save detailed logs to a file
toolbox file hash large_file.iso --log-file ./logs/audit.log
```
toolbox file batch-rename ./docs --prefix "v1_" --dry-run
```

### Workflow Automation
```bash
# Run a complex automation sequence
toolbox workflow run examples/universal_demo.yaml
```

### Advanced Media
```bash
# Extract frames every 0.5 seconds
toolbox video extract-frames my_video.mp4 --interval 0.5

# Normalize audio volume
toolbox audio normalize recording.mp3 -o balanced.mp3
```

### **Workflow Automation**
Automate complex tasks using YAML workflows:
```bash
# Interactively create a new workflow
toolbox workflow init my_tasks.yaml

# Run the workflow
toolbox workflow run my_tasks.yaml

# Run with variable overrides and dry-run
toolbox workflow run my_tasks.yaml -v input_file=photo.jpg --dry-run
```

### **Batch Processing**
Many commands now support processing multiple files at once using glob patterns:
```bash
# Resize all JPEGs in a folder
toolbox image resize --glob "*.jpg" -w 800

# Convert all videos in a folder to GIF
toolbox video to-gif --glob "videos/*.mp4"
```

### **Global Engine Path**
You can now set a global directory where ToolBox will look for engine binaries (ffmpeg, tesseract, etc.):
```bash
toolbox config set global_bin_path "C:\MyTools\bin"
```

## 🛠️ Configuration

Settings are stored in `config.yaml`. Manage them via CLI:
```bash
toolbox config list
toolbox config set engine_paths.ffmpeg "C:\ffmpeg\bin\ffmpeg.exe"
```

## 🤝 Contributing

Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.

## 📜 License

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