Skip to content

ohhmkar/local-cli-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local CLI Toolkit

A collection of Unix bash scripts for local file formatting, extraction, and system operations.

These scripts serve as lightweight wrappers around established command-line utilities (Ghostscript, FFmpeg, ImageMagick, poppler). They execute entirely on the local filesystem, avoiding external network dependencies.

Installation

Install the required underlying binaries using Homebrew:

# PDF dependencies
brew install imagemagick pandoc ghostscript poppler ocrmypdf qpdf tesseract
brew install --cask libreoffice wkhtmltopdf

# Media dependencies
brew install ffmpeg

# Dev/Data dependencies
brew install jq python

Clone the repository and make the scripts executable:

git clone https://github.com/ohhmkar/local-cli-toolkit.git
cd local-cli-toolkit
chmod +x */*.sh

Structure & Usage

Scripts are organized by domain. They generally accept standard input/output file paths or directory targets as arguments.

pdf-tools

Wrappers for PDF manipulation, text extraction, and OCR.

  • compress-pdf.sh <input.pdf> <output.pdf> [quality]: Downsamples PDF assets using Ghostscript.
  • decrypt-pdf.sh <password> <input.pdf> <output.pdf>: Removes PDF password protection via qpdf.
  • doc-to-pdf.sh: Converts .doc/.docx files in the current directory to PDF using LibreOffice headless mode.
  • encrypt-pdf.sh <password> <input.pdf> <output.pdf>: Applies 256-bit AES encryption.
  • images-to-pdf.sh <output.pdf> <input1.jpg> <input2.png> ...: Combines images into a paginated PDF.
  • md-to-pdf.sh <input.md> [output.pdf]: Renders Markdown to PDF via Pandoc and wkhtmltopdf.
  • merge-pdfs.sh <output.pdf> <input1.pdf> ...: Concatenates PDFs in specified order.
  • ocr-pdf.sh <input.pdf> [output.pdf] [lang]: Applies OCR to scanned documents.
  • pdf-to-png.sh <input.pdf> [prefix]: Renders each PDF page to PNG format.
  • pdf-to-text.sh <input.pdf> [output.txt]: Extracts text content from a PDF.
  • pptx-to-pdf.sh or convert.sh: Converts .ppt/.pptx to PDF.

media-tools

Scripts for audio/video extraction and image conversion.

  • convert-to-mp4.sh <input.video> [output.mp4]: Re-encodes video to H.264/AAC MP4.
  • heic-to-jpg.sh <input.heic> [output.jpg]: Converts HEIC images using macOS sips.
  • video-to-gif.sh <input.mp4> [output.gif]: Generates a scaled, looped GIF.
  • video-to-mp3.sh <input.video> [output.mp3]: Demuxes audio track out of video formats.

data-tools

Archive and data format parsing.

  • csv-to-json.sh <input.csv> [output.json]: Parses CSV to an array of JSON objects via Python.
  • extract-any.sh <archive>: Dispatches the correct extraction utility based on file extension (zip, tar, bz2, rar).

dev-tools

Developer environment helpers.

  • kill-port.sh <port>: Identifies and sends SIGKILL to the process bound to the specified port.
  • pretty-json.sh <input.json> [output.json]: Formats minified JSON using jq.

sys-tools

System administration utilities.

  • find-large-files.sh [dir]: Recursively sums directory entries and returns the top 20 largest paths.

Architecture

These scripts rely on positional arguments and standard POSIX shell conditional logic to validate inputs before delegating execution to the target binaries. There is no state persistence or shared configuration.

Development & Testing

  • Add new scripts to the appropriate domain directory.
  • Ensure the script halts with a non-zero exit code if required dependencies (command -v <tool>) are missing.
  • No automated test suite is configured. Validate scripts against dummy files manually before committing.

Limitations

  • macOS bias: Tools like heic-to-jpg.sh use Apple-specific binaries (sips). soffice paths in the LibreOffice scripts are hardcoded to the default macOS .app bundle path.
  • Error handling: Edge cases regarding corrupted input files or unsupported encodings depend entirely on the upstream tool's stderr output and exit behavior.

About

got annoyed with online tools having stupid limits so made local tools that do anything I need, if anything else should be added raise an Issue.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages