v0.3.1 now available

PDF manipulation for the command line

Split, merge, and manage PDFs with precision. A fast, type-safe CLI built with Bun. Includes an interactive TUI for visual page selection.

$ bun add -g @k-dang/pdf-tools

Split

Extract pages with surgical precision. Single pages, ranges, or complex selections.

Merge

Combine documents seamlessly while preserving quality and metadata.

TUI

Interactive

Interactive visual interface for browsing and selecting pages.

Extract What You Need

Precise page extraction with flexible range syntax. Single pages, ranges, or complex selections — all in one command.

6Single page
6-8Page range
1,3,5-8Mixed selection
# Extract a single page
$ pdf-tools split report.pdf --pages "6"
✓ Created report_pages_6.pdf
# Extract a range of pages
$ pdf-tools split book.pdf -p "1-10"
✓ Created book_pages_1-10.pdf
# Complex selection with custom output
$ pdf-tools split doc.pdf -p "1,3,5-8" -o selected.pdf
✓ Created selected.pdf (6 pages)
# Merge two documents
$ pdf-tools merge intro.pdf content.pdf
✓ Created merged.pdf (24 pages)
# Merge multiple files with custom output
$ pdf-tools merge ch1.pdf ch2.pdf ch3.pdf -o book.pdf
✓ Created book.pdf (156 pages)
# Use glob patterns
$ pdf-tools merge ./chapters/*.pdf -o complete.pdf
✓ Merged 12 files → complete.pdf

Combine with Confidence

Merge multiple PDFs into a single document. Works with any number of files, preserving quality and metadata.

  • Preserves hyperlinks and bookmarks
  • Maintains document metadata
  • Smart output naming by default
  • Glob pattern support for batch operations
Interactive Mode

When You Want More Control

Launch the interactive TUI for visual file browsing and page selection. Perfect for complex selections or when you need to preview before extracting.

pdf-tools tui
PDF Tools interactive TUI mode

Keyboard Navigation

Arrow keys to navigate, Space to toggle selection

Visual Selection

See your selection in real-time before extraction

Range Input Mode

Press 'r' to enter ranges like '1-5,8,10'

Bun-Powered

Lightning-fast runtime for instant operations

TypeScript

Type-safe CLI with full IntelliSense support

Dual Interface

Command-line and interactive TUI modes

Smart Defaults

Auto-naming and sensible output conventions

Get Started

Install globally and start manipulating PDFs in seconds.

$ bun add -g @k-dang/pdf-tools