Skip to main content

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 libx265 HEVC 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 Rich terminal integration with contextual progress spinners.
  • 🐳 Docker Support: Run effortlessly inside lightweight, pre-configured containers.

📦 Installation

Install the CLI Core

pip install ilovecli

Auto-Install System Dependencies (Magic! ✨)

ilovecli requires FFmpeg and Ghostscript to perform video and PDF compressions. Instead of installing these manually, simply run our auto-installer and we will provision everything for your specific OS (Linux/macOS/Windows):

ilovecli install

That's it! You are now ready to compress.


🔧 System Diagnostics

If you ever need to verify the integrity of your installed compression engines:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ilovecli-1.0.1.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ilovecli-1.0.1-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file ilovecli-1.0.1.tar.gz.

File metadata

  • Download URL: ilovecli-1.0.1.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ilovecli-1.0.1.tar.gz
Algorithm Hash digest
SHA256 328015c3e716e602fc3dc859c639a6f530be706092b642741ea7e2e8b89ebdf2
MD5 8fe2c82c88adad565967d644f091f53b
BLAKE2b-256 a7c0b157cb560ae98de13d1c71b689a80d599bc47221ecd2da1e9688cff23d69

See more details on using hashes here.

File details

Details for the file ilovecli-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ilovecli-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ilovecli-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5a3bd8d9aad59cbaeffa6850dfa53d0fd13672531978f43c8925121663a8339
MD5 052afd7e0d7c16b1b15ffdd8f29840b7
BLAKE2b-256 34d6089ff437e67d0c4c03f958e35c64378fe7fd2d9abe1643e2b743d322fad4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page