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.
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 pythonClone the repository and make the scripts executable:
git clone https://github.com/ohhmkar/local-cli-toolkit.git
cd local-cli-toolkit
chmod +x */*.shScripts are organized by domain. They generally accept standard input/output file paths or directory targets as arguments.
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/.docxfiles 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.shorconvert.sh: Converts.ppt/.pptxto PDF.
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 macOSsips.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.
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).
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 usingjq.
System administration utilities.
find-large-files.sh [dir]: Recursively sums directory entries and returns the top 20 largest paths.
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.
- 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.
- macOS bias: Tools like
heic-to-jpg.shuse Apple-specific binaries (sips).sofficepaths in the LibreOffice scripts are hardcoded to the default macOS.appbundle path. - Error handling: Edge cases regarding corrupted input files or unsupported encodings depend entirely on the upstream tool's stderr output and exit behavior.