CLI tool to compress images, PDFs, and videos
Project description
🚀 ilovecli (v1.0.0)
Compress smarter. From your terminal.
ilovecli is a fast, cross-platform command-line tool to compress Images, PDFs, and Videos directly from your terminal.
Built with an unapologetic focus on performance, the engine dynamically utilizes multi-threading, hardware-accelerated HEVC encoding, and RAM-disk buffering to guarantee blazing-fast execution times while maintaining beautiful, context-aware console output.
✨ Features
- 🖼 Images (JPG, PNG, WEBP): Multi-core parallel compression with
io.BytesIO()RAM-buffering. - 📄 PDFs: Ghostscript-powered size reduction utilizing
/tmp/TMPFS RAM-disks to eliminate slow I/O. - 🎬 Videos: Next-gen
libx265HEVC FFmpeg conversion dynamically mapping to 100% of CPU threads. - 🎯 Target-size Compression: Feed a precise KB target, and the binary-search algorithm guarantees a fit.
- ⚡ Lightning Fast Aliases: Trigger any command with single keystrokes (
c,f,t,cv,u,d). - 🎨 Gorgeous UI: Fully mapped
Richterminal integration with contextual progress spinners. - 🐳 Docker Support: Run effortlessly inside lightweight, pre-configured containers.
📦 Installation
Install from PyPI
pip install ilovecli
(Note: ilovecli relies on system implementations of FFmpeg and Ghostscript)
Install from Source
git clone https://github.com/Dhabaldeep/ilovecli.git
cd ilovecli
pip install .
🔧 System Diagnostics
Make sure the following engines are installed on your OS:
- Python 3.8+
- FFmpeg (for video compression)
- Ghostscript (for PDF compression)
You can run our built-in doctor command to verify your secure toolchains:
ilovecli doctor # or: ilovecli d
🚀 Usage Guide
All commands support Short Aliases for massive speed typing improvements. Run ilovecli --help anytime for a gorgeous, color-coded manual!
🔹 Compress Any Supported File (compress / c)
ilovecli c file.jpg # Image
ilovecli c document.pdf # PDF
ilovecli c video.mp4 # Video
The system automatically detects the file MIME-type and routes it to the correct multi-threaded compression engine.
🎯 Compress to a Precise Target Size (target / t)
Need a PDF below 2MB for an email attachment? Just specify the KB:
ilovecli t image.jpg 300
ilovecli t document.pdf 1500 --quality ebook
Our engine calculates the file differential on the fly, rendering beautiful context-aware spinners:
⠼ Compressing document.pdf (14.20 MB) to 1500 KB...
📁 Parallel Folder Compression (folder / f)
ilovecli f ./images --smart
Shrink thousands of images at once utilizing 100% of your CPU cores.
🌐 Direct URL Processing (url / u)
ilovecli u https://example.com/massive_image.png
Downloads the file to a standard path and instantly executes the compression flow.
🔄 Format Converter (convert / cv)
ilovecli cv raw_photo.png optimized.webp
📄 PDF Quality Profiles (-p / -q)
When compressing PDFs, you no longer have to guess what quality you are exporting. We map directly to structured DPI variants:
screen: Fast compression, extremely low quality (72 DPI). Best for emails and web.ebook: Good balance of quality and size (150 DPI). General reading default.printer: High quality for physical printing (300 DPI).prepress: Lossless, exceptionally high quality (300 DPI+). Minimal size reduction.
Example:
ilovecli c report.pdf -p prepress
🎬 Video Compression Engine
By default, ilovecli runs all video compression using libx265 (HEVC). This yields incredibly small file sizes with no perceptible loss compared to legacy h264.
Control the Constant Rate Factor (--crf / -c):
- Lower CRF → Better quality
- Higher CRF → Smaller file (Recommended range:
18–35)
ilovecli c video.mp4 -c 24
🐳 Docker Deployment
Don't want to install FFmpeg or Ghostscript locally? No problem.
docker build -t ilovecli .
docker run --rm -v $(pwd):/data ilovecli c /data/huge_file.pdf
🛠 Advanced Tech Stack
- Typer & Rich: Next-generation CLI routing and gorgeous rendering frameworks.
- io.BytesIO & tempfile.tmpfs: Complete removal of disk I/O chokepoints during deep binary searches.
- Pillow-SIMD & Multiprocessing: Heavily optimized concurrent graphical transformations.
- HEVC / FFmpeg: Fully threaded video crunching.
📄 License & Contributing
Licensed under the MIT License. Contributions are absolutely welcome! Support the project by dropping a ⭐ on the repository if this tool saved your hard drive!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ilovecli-1.0.0.tar.gz.
File metadata
- Download URL: ilovecli-1.0.0.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
249c4d0460021616a74b2fd27a2265d9d39d265fe220402ba472209278781bf0
|
|
| MD5 |
2da60d17dbae5eb65d2563caf0aff527
|
|
| BLAKE2b-256 |
139a0ce7a2855c2f3152e43d176940bb56f07f6f65dfd2a3e0ec210a9afae9b4
|
File details
Details for the file ilovecli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: ilovecli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f20db34f9ad01e4b216e792f8f426d8c1d28ef90617e0bcbbabda6e3d71af20
|
|
| MD5 |
2098e9e79ae1f3657d5d31431da2852f
|
|
| BLAKE2b-256 |
c5991c497a0eddeb73789084e1d2c44d08d158ffeffd72f4589e4154e7be3ddd
|