Merge PDF files from the command line
deft pdf merge joins PDFs into one, in the order you give them.
deft pdf merge fw9.pdf f1040.pdf -o tax-forms.pdf
Options
deft pdf merge a.pdf b.pdf -o all.pdf- The files are joined in the order given.
deft pdf merge *.pdf -o book.pdf- A glob is joined in the order the shell lists it, which is alphabetical.
--password TEXT- Opens an encrypted input.
-o FILE- Where to write. Without it the result is named after the first input, as
a.merged.pdf.
All options: deft pdf merge --help. Add --json for a structured result.
A real run
The released deft on a real file. This is exactly what it printed:
$ deft pdf merge fw9.pdf f1040.pdf -o tax-forms.pdf
ok pdf.merge fw9.pdf f1040.pdf -> tax-forms.pdf 8 pages 0.02s
fw9.pdf: IRS Form W-9, a real fillable form. The file, Public domain (US government work).f1040.pdf: IRS Form 1040. The file, Public domain (US government work).
Limits
- Pages are copied as they are; to drop, reorder or rotate pages first, use
deft pdf select,deft pdf deleteordeft pdf rotate. - An encrypted file needs its password, or
deft pdf decryptfirst. - No other program is needed; it runs on macOS and Linux.
What it saves an AI agent
Every task in the deft benchmark that uses this command, run by Claude Code (Opus 5.5, medium effort) once without deft and once with deft and its skill installed. The prompt never mentions deft. Each cell reads without → with deft; click a task for the agent's full trace.
| Task | Solved | Time | New tokens | Failed commands |
|---|---|---|---|---|
| Assemble an application from mixed filesPut together one application.pdf for a portal: letter.docx first, then the photo DSCN0010.jpg, then fw9.pdf. Number the pages at the bottom. The portal rejects anything over 1MB. | yes → yes | 95 s → 29 s | 30.3k → 14.6k | 1 → 0 |
| Merge invoices in date order and number the pagesMy accountant wants coolblue.pdf, azure-interior.pdf and quality-hosting.pdf as one file, oldest invoice first by invoice date, with page numbers so she can refer to pages. Save it as invoices.pdf. | yes → yes | 54 s → 26 s | 21.3k → 18.9k | 2 → 0 |
| Merge two real formsCombine fw9.pdf and f1040.pdf, in that order, into tax-forms.pdf. | yes → yes | 26 s → 9 s | 10.5k → 9.6k | 1 → 0 |
| Prepare a numbered, titled and locked packet for signatureSend-out for a new supplier: combine nda.pdf and then fw9.pdf into one file, number the pages like Page 3 of 8, set the PDF title to Northwind Labs onboarding, and protect it with the password Sign2026. Save it as onboarding.pdf. | no → yes | 43 s → 28 s | 15.7k → 14.7k | 1 → 0 |
| Merge, number and stamp in one goCombine fw9.pdf and f1040.pdf, number the pages like 1/8, stamp every page with the word DRAFT, and save the result as packet.pdf. | yes → yes | 99 s → 35 s | 27.9k → 17.0k | 4 → 0 |
| Unlock a PDF, merge it and lock it with a new passwordlocked.pdf opens with the password openpassword. Put it together with fw9.pdf (locked.pdf first) into hr-packet.pdf for HR, and protect the packet with their password HR-2026 instead of the old one. | yes → yes | 47 s → 18 s | 14.8k → 12.6k | 2 → 2 |
| All 6 tasks | 5 → 6 | 364 s → 146 s | 120.5k → 87.3k | 11 → 2 |
One run per task and arm, on 2026-11-15. Deft was improved against these same tasks, so this is a development benchmark, not a held-out test. New tokens are input not served from the prompt cache, plus output. Failed commands are the agent's tool calls that returned an error: shell commands, and file reads and writes. All tasks: the benchmark.
Install
curl -fsSL https://deftcli.com/install.sh | sh
Or brew install firstprayer/tap/deft. One binary for macOS and Linux;
the script also sets up the skill for Claude Code and Codex. Install guide.