Local-first media and PDF toolkit. Fast, lightweight, and privacy-focused.
- Install dependencies (see Installation section below)
- Download the latest release from GitHub Releases
- Extract and add to your PATH
PDF Operations:
# Merge multiple PDFs
forgekit pdf merge doc1.pdf doc2.pdf --output merged.pdf
# Merge with linearization (fast web view)
forgekit pdf merge *.pdf --output all.pdf --linearize
# Split PDF by pages
forgekit pdf split book.pdf --output-dir pages/ --pages 1-5,10-20
# Extract odd pages
forgekit pdf split book.pdf --output-dir pages/ --pages odd
# See what commands would run (without executing)
forgekit pdf merge a.pdf b.pdf --output c.pdf --plan
# JSON output for scripting
forgekit pdf merge *.pdf --output out.pdf --json | jq -r '.result.output'Page Specification:
- Numbers:
1,42 - Ranges:
1-5,10-20,7-(7 to end),-10(1 to 10) - Keywords:
odd,even,first,last - Exclusions:
!2,!5-10 - Combined:
1-3,5,7-,odd,even,1-10,!2,!5
ForgeKit requires external tools to be installed. Check if all dependencies are available:
forgekit check-depsbrew install qpdf pdfcpu tesseract ffmpeg libvips exiftool
pip3 install ocrmypdfwinget install qpdf qpdf
winget install pdfcpu pdfcpu
winget install tesseract-ocr
winget install ffmpeg
scoop install libvips exiftool
pip install ocrmypdfDebian/Ubuntu:
sudo apt install qpdf pdfcpu tesseract-ocr ffmpeg libvips-tools libimage-exiftool-perl
pip3 install ocrmypdfArch:
sudo pacman -S qpdf pdfcpu tesseract ffmpeg libvips perl-image-exiftool
pip3 install ocrmypdf- Merge: Combine multiple PDFs into one
- Split: Extract pages by ranges or keywords
- Linearize: Optimize for fast web view
- Compress: Reduce file size with presets (coming soon)
- OCR: Add searchable text layer (coming soon)
- Metadata: View/edit PDF metadata (coming soon)
- Convert formats (WebP, AVIF, JPEG)
- Resize with aspect ratio preservation
- Strip EXIF metadata
- Video transcoding (H.264)
- Audio conversion and normalization
--json: Output progress as NDJSON (one event per line)--plan: Show underlying commands without executing--dry-run: Validate inputs and show plan, don't execute--log-level <level>: Set log level (debug|info|warn|error)--force: Overwrite existing files--tools.<name>=path: Override tool path (e.g.,--tools.qpdf=/usr/local/bin/qpdf)
0: Success1: General error (processing failed)2: Missing tool (with install hint)3: Invalid input (file not found, invalid pages spec, etc.)4: Permission denied5: Disk full130: Cancelled (SIGINT)
When using --json, ForgeKit outputs NDJSON (newline-delimited JSON) events:
{"type":"progress","job_id":"abc123","progress":{"current":1,"total":3,"percent":33},"message":"Merging page 1/3"}
{"type":"progress","job_id":"abc123","progress":{"current":2,"total":3,"percent":67},"message":"Merging page 2/3"}
{"type":"complete","job_id":"abc123","result":{"output":"merged.pdf","size_bytes":123456,"duration_ms":1234}}If you see "Tool 'qpdf' not found", install the required dependencies (see Installation).
You can also override tool paths:
forgekit pdf merge a.pdf b.pdf --output c.pdf --tools.qpdf=/custom/path/to/qpdfEnsure you have read access to input files and write access to output directories.
Page numbers must be >= 1. Ranges must have start <= end. Use --help for examples.
Contributions welcome! Please open an issue or pull request.
MIT OR Apache-2.0