360 Secure SkillHub
360 安全技能中心

Nested PDF Merger

该 Skill 自身不实现合并逻辑,只调用外部 nestedpdfmerger 命令行工具,把嵌套目录树中的 PDF 按指定排序合并为单个 PDF,并将文件夹层级写为书签;支持 dry-run 预览合并顺序,以及排除目录、关闭书签等选项;需先安装该工具并使其在 PATH 中可用。

lyutenant
lyutenant
热度 80.18
最近更新 2026-05-11 17:31:50
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add nested-pdf-merger
Metadata
name
nested-pdf-merger
description
Use this skill when the task is to merge PDFs from a nested directory tree into a single PDF with hierarchical bookmarks by invoking the external `nestedpdfmerger` CLI. This skill depends on the `nestedpdfmerger` binary being installed and available on PATH.
metadata
{"openclaw":{"requires":{"bins":["nestedpdfmerger"]},"homepage":"https://github.com/Lyutenant/nested-pdf-merger"}}

Nested PDF Merger

This repository wraps the external nestedpdfmerger CLI.

Do not implement PDF merging logic in this repository. Do not modify anything under reference/.

Requirements

This skill requires the nestedpdfmerger command to be installed and available on PATH.

Expected installation command:

pip install nestedpdfmerger

Expected CLI entrypoint:

nestedpdfmerger INPUT_DIR -o OUTPUT.pdf [options]

Alternative module invocation:

python -m nestedpdfmerger INPUT_DIR -o OUTPUT.pdf [options]

When to use

Use this skill when the user wants to:

  • Merge PDF files from a folder tree into one output PDF.
  • Preserve the folder hierarchy as PDF bookmarks.
  • Preview merge order with --dry-run.
  • Exclude directories, change sort order, or disable bookmarks.

Workflow

  1. Confirm the input directory and desired output path.
  2. Prefer --dry-run first when the user wants to validate merge order.
  3. Run the CLI with the smallest set of flags needed.
  4. If the command fails because the binary is missing, tell the user to install it with pip install nestedpdfmerger.

Supported flags

  • -o, --output PATH
  • --sort {natural,alpha,mtime}
  • --reverse
  • --exclude NAME [NAME ...]
  • --exclude-hidden
  • --no-bookmarks
  • --dry-run
  • --strict
  • --verbose
  • --quiet
  • --version

Examples

Preview merge order:

nestedpdfmerger ./reports --dry-run

Merge with explicit output:

nestedpdfmerger ./reports --output merged.pdf

Merge while excluding folders:

nestedpdfmerger ./reports --output merged.pdf --exclude Backup Data