yourpdf
v0.1.0
Published
Offline-first PDF CLI toolkit with optional macOS Finder Quick Action setup
Maintainers
Readme
YourPDF
YourPDF is an offline-first PDF toolkit currently focused on:
- Rust (processing engine)
- Rust CLI
Monorepo layout
pdfkit/
cli/ # Rust CLI wrapper (binary: yourpdf)
shared/ # Core PDF engine used by CLICore MVP features
- Merge PDFs (ordered input)
- Split PDFs (range and single-page mode)
- Compress PDFs (low/medium/high presets, Ghostscript with internal fallback)
- Convert image -> PDF
- Convert PDF -> PNG (via
pdftoppm) - Batch processing with parallel execution (
rayon) and per-file fault isolation
Advanced features (implemented)
- Folder watcher:
- Monitors a folder locally with
notify - Auto-runs a named saved workflow when new/modified files are detected
- Debounces duplicate file change bursts
- Monitors a folder locally with
- Saved workflows:
- Persisted locally at
~/.yourpdf/workflows.json - Supports multi-step pipelines (merge, split, compress, convert)
- Available in CLI
- Persisted locally at
Privacy model
- Fully local processing
- No telemetry
- No network calls in app runtime
- No cloud upload paths
Requirements
- Rust toolchain (stable)
- Optional but recommended:
- Ghostscript (
gs) for higher quality compression - Poppler (
pdftoppm) for multi-page PDF -> PNG conversion - On macOS, PDF -> PNG has a built-in
sipsfallback (single output image) when Poppler is not installed
- Ghostscript (
macOS helpers
brew install ghostscript popplerSetup
cd /Users/user11/Desktop/pdf-toolkit/pdfkit
cargo build -p pdfkit-clinpm Distribution (Global CLI + Optional Finder Setup)
Install globally:
npm install -g yourpdfWhat this gives users:
yourpdfcommand in terminal- Optional macOS Finder setup command:
yourpdf setup-macosyourpdf uninstall-macos
Notes:
- On install, npm runs a local Rust release build (
cargo build -p pdfkit-cli --release) if needed. - Rust toolchain is required for npm install from source.
Run CLI
cd /Users/user11/Desktop/pdf-toolkit/pdfkit
cargo run -p pdfkit-cli -- --helpmacOS Finder Quick Action (YourPDF option, Preview stays default)
This adds a YourPDF action in Finder context actions for PDF files without changing the default app association.
Install:
cd /Users/user11/Desktop/pdf-toolkit/pdfkit
./macos/finder-quick-action/install_all_macos.shUninstall:
cd /Users/user11/Desktop/pdf-toolkit/pdfkit
./macos/finder-quick-action/uninstall_quick_action.shBehavior:
- Right-click one or more PDFs in Finder ->
Quick Actions->YourPDF - Native prompt lets you choose: Merge, Compress, Split, Convert PDF to PNG
- Output is written to
yourpdf-outputnext to the selected file - Preview (or any current default app) remains the default double-click handler
Examples:
yourpdf merge file1.pdf file2.pdf -o output.pdf
yourpdf split file.pdf --range 1-5 -o output
yourpdf split file.pdf --single -o output
yourpdf compress "*.pdf" --preset medium -o output
yourpdf convert input.pdf --to png -o output
yourpdf convert image.png --to pdf -o output/converted.pdf
yourpdf workflow save --from-json workflow.json
yourpdf workflow list
yourpdf workflow run --name quick-compress file1.pdf file2.pdf
yourpdf watch --folder /path/to/inbox --workflow quick-compress --recursiveworkflow.json example:
{
"name": "quick-compress",
"steps": [
{
"Compress": {
"preset": "Medium",
"output_dir": "output/workflow"
}
}
]
}Engine design notes
- Shared core logic lives in
shared/src/*and is used by CLI commands. - Batch processing is parallelized with
rayon::into_par_iter. - Errors are strongly typed (
PdfKitError) and surfaced with readable messages.
Testing
cd /Users/user11/Desktop/pdf-toolkit/pdfkit
cargo test -p pdfkit-shared
cargo test -p pdfkit-cliCurrent tests include:
- shared engine unit tests for merge + split paths
- CLI integration test validating help output and command surface
Advanced features roadmap
- Metadata cleaner
- Basic editing (annotations/text/highlight)
