
Mineru Pdf
- 14 installs
- 638 repo stars
- Updated March 7, 2026
- sundial-org/awesome-openclaw-skills
Helps with ai & agent building tasks during AI-assisted development.
About
mineru-pdf is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- mineru-pdf
- AI & Agent Building
- AI-coding skill
Mineru Pdf by the numbers
- 14 all-time installs (skills.sh)
- Ranked #11,296 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sundial-org/awesome-openclaw-skills --skill mineru-pdfAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 14 |
|---|---|
| repo stars | ★ 638 |
| Last updated | March 7, 2026 |
| Repository | sundial-org/awesome-openclaw-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
MinerU PDF
Overview
Parse a PDF locally with MinerU (CPU). Default output is Markdown + JSON. Use tables/images only when requested.
Quick start (single PDF)
# Run from the skill directory
./scripts/mineru_parse.sh /path/to/file.pdfOptional examples:
./scripts/mineru_parse.sh /path/to/file.pdf --format json
./scripts/mineru_parse.sh /path/to/file.pdf --tables --imagesWhen to read references
If flags differ from your wrapper or you need advanced defaults (backend/method/device/threads/format mapping), read:
references/mineru-cli.md
Output conventions
- Output root defaults to
./mineru-output/. - MinerU creates the per-document subfolder under the output root (e.g.,
./mineru-output/<basename>/...).
Batching
Default is single-PDF parsing. Only implement batch folder parsing if explicitly requested.
MinerU PDF Parser - Clawdbot Skill
A Clawdbot skill for parsing PDFs locally using MinerU (CPU). Produces rich structured output including Markdown, JSON with layout data, and extracted images.
Features
- Local CPU processing — No GPU required; runs entirely on your machine
- Rich structured output — Markdown + detailed JSON with layout information
- Image extraction — Automatically extracts embedded images
- Table support — Optional table extraction (if supported by your MinerU version)
- Configurable — Flexible env overrides for different MinerU wrappers
Installation
Prerequisites
1. MinerU CLI installed and accessible (see MinerU installation) 2. Clawdbot installed
Install the skill
# Clone the repo
git clone https://github.com/kesslerio/MinerU-PDF-Parser-Clawdbot-Skill.git
# Or copy the mineru-pdf/ folder to your Clawdbot skills directory
cp -r MinerU-PDF-Parser-Clawdbot-Skill/mineru-pdf ~/.clawdbot/skills/Usage
Quick start
# Run from the skill directory
./scripts/mineru_parse.sh /path/to/document.pdfOptions
./scripts/mineru_parse.sh /path/to/document.pdf --format json
./scripts/mineru_parse.sh /path/to/document.pdf --tables --images
./scripts/mineru_parse.sh /path/to/document.pdf --outroot ./my-output| Option | Default | Description |
|---|---|---|
--format | both | Output format: md, json, or both |
--outroot | ./mineru-output | Output root directory |
--tables | off | Extract tables (if supported) |
--images | off | Extract images (if supported) |
--threads | 4 | Thread count (OMP_NUM_THREADS) |
--lang | en | Language |
--backend | pipeline | MinerU backend |
--method | auto | Processing method |
--device | cpu | Device (cpu/gpu) |
Configuration
If your MinerU wrapper uses different flags, set env overrides. See mineru-pdf/references/mineru-cli.md for full documentation.
export MINERU_CMD=~/.local/bin/mineru
export MINERU_INPUT_FLAG=-p
export MINERU_OUTPUT_FLAG=-oOutput
MinerU creates a per-document subfolder under the output root:
./mineru-output/
└── document-name/
└── auto/
├── document-name.md # Markdown output
├── document-name_middle.json # Rich structured JSON (~50KB+)
├── document-name_layout.pdf # Layout visualization
└── images/ # Extracted imagesOutput quality
MinerU produces rich structured output including:
- Layout-aware text extraction
- Detailed JSON with position/structure metadata
- Extracted images and layout PDFs
Best for: Documents requiring accurate layout preservation, image extraction, or structured data output.
Comparison with PyMuPDF
| Aspect | MinerU | PyMuPDF |
|---|---|---|
| Speed | Slower (~15-30s/page) | Fast (~1s/page) |
| JSON output | Rich (~50KB+, layout data) | Minimal (~1KB, text only) |
| Image extraction | Yes (automatic) | Yes (optional) |
| Layout preservation | Excellent | Basic |
| Dependencies | Heavy (~20GB models) | Light (pip install) |
Use MinerU when: Quality and structure matter more than speed. Use PyMuPDF when: Speed matters or for simple text extraction.
License
Apache 2.0
Contributing
Issues and PRs welcome. Please test with a variety of PDFs before submitting changes.
Related
- PyMuPDF PDF Parser Skill — Fast, lightweight alternative
- MinerU — The underlying PDF parser
- Clawdbot — The AI agent framework
MinerU CLI Configuration
This skill assumes the MinerU wrapper described by Martin:
mineru -p <path_to_pdf> -o <output_dir> -b pipeline -l en -d cpu [-m auto]Defaults (wrapper-based)
- Input flag:
-p - Output flag:
-o - Backend flag:
-b - Language flag:
-l - Device flag:
-d(cpu) - Method flag:
-m(auto) - Threads:
OMP_NUM_THREADS=4(set by wrapper or this script)
Output
MinerU will create a per-document directory under the output root. Typical outputs:
<doc>.md<doc>_middle.json<doc>/(images/tables)
Format mapping
The wrapper supports --format md|json|both and maps to MinerU values:
md→markdownjson→jsonboth→markdown,json
If your wrapper uses different values, override:
export MINERU_FORMAT_FLAG=--format
export MINERU_FORMAT_VALUE_MD=markdown
export MINERU_FORMAT_VALUE_JSON=json
export MINERU_FORMAT_VALUE_BOTH=markdown,jsonAdvanced defaults
Defaults used by the wrapper:
backend=pipelinemethod=autodevice=cputhreads=OMP_NUM_THREADS(default 4)
Override flags/values via env vars as needed:
export MINERU_CMD=~/.local/bin/mineru
export MINERU_INPUT_FLAG=-p
export MINERU_OUTPUT_FLAG=-o
export MINERU_BACKEND_FLAG=-b
export MINERU_LANG_FLAG=-l
export MINERU_DEVICE_FLAG=-d
export MINERU_METHOD_FLAG=-m
export MINERU_THREADS_FLAG=OMP_NUM_THREADSTest
./scripts/mineru_parse.sh /path/to/file.pdf --format both --threads 4 --lang en --backend pipeline --method auto --device cpu#!/usr/bin/env bash
set -euo pipefail
usage() {
cat <<'EOF'
Usage: mineru_parse.sh <input.pdf> [options]
Options:
--outroot DIR Root output directory (default: ./mineru-output)
--format FMT md | json | both (default: both)
--tables Extract tables (if supported)
--images Extract images (if supported)
--threads N Thread count (default: 4)
--lang LANG Language (default: en)
--backend NAME Backend (default: pipeline)
--method NAME Method (default: auto)
--device NAME Device (default: cpu)
-h, --help Show help
Environment overrides:
MINERU_CMD MinerU CLI command (default: mineru)
MINERU_INPUT_FLAG Input flag (default: -p)
MINERU_OUTPUT_FLAG Output flag (default: -o)
MINERU_FORMAT_FLAG Format flag (default: --format)
MINERU_FORMAT_VALUE_MD Value for md (default: markdown)
MINERU_FORMAT_VALUE_JSON Value for json (default: json)
MINERU_FORMAT_VALUE_BOTH Value for both (default: markdown,json)
MINERU_TABLES_FLAG Tables flag (default: --tables)
MINERU_IMAGES_FLAG Images flag (default: --images)
MINERU_THREADS_FLAG Threads env var name (default: OMP_NUM_THREADS)
MINERU_LANG_FLAG Language flag (default: -l)
MINERU_BACKEND_FLAG Backend flag (default: -b)
MINERU_METHOD_FLAG Method flag (default: -m)
MINERU_DEVICE_FLAG Device flag (default: -d)
MINERU_EXTRA_ARGS Extra raw args appended as-is
EOF
}
if [[ $# -lt 1 ]]; then
usage
exit 1
fi
input=""
outroot="./mineru-output"
format="both"
tables=false
images=false
threads="4"
lang="en"
backend="pipeline"
method="auto"
device="cpu"
while [[ $# -gt 0 ]]; do
case "$1" in
-h|--help)
usage; exit 0;;
--outroot)
outroot="$2"; shift 2;;
--format)
format="$2"; shift 2;;
--tables)
tables=true; shift;;
--images)
images=true; shift;;
--threads)
threads="$2"; shift 2;;
--lang)
lang="$2"; shift 2;;
--backend)
backend="$2"; shift 2;;
--method)
method="$2"; shift 2;;
--device)
device="$2"; shift 2;;
*)
if [[ -z "$input" ]]; then
input="$1"; shift
else
echo "Unknown argument: $1" >&2
usage
exit 1
fi
;;
esac
done
if [[ -z "$input" ]]; then
echo "Missing input PDF" >&2
usage
exit 1
fi
if [[ ! -f "$input" ]]; then
echo "Input not found: $input" >&2
exit 1
fi
cmd="${MINERU_CMD:-mineru}"
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "MinerU CLI not found: $cmd" >&2
echo "Set MINERU_CMD or install MinerU CLI." >&2
exit 1
fi
outdir="$outroot"
mkdir -p "$outdir"
input_flag="${MINERU_INPUT_FLAG:--p}"
output_flag="${MINERU_OUTPUT_FLAG:--o}"
format_flag="${MINERU_FORMAT_FLAG:---format}"
fmt_md="${MINERU_FORMAT_VALUE_MD:-markdown}"
fmt_json="${MINERU_FORMAT_VALUE_JSON:-json}"
fmt_both="${MINERU_FORMAT_VALUE_BOTH:-markdown,json}"
tables_flag="${MINERU_TABLES_FLAG:---tables}"
images_flag="${MINERU_IMAGES_FLAG:---images}"
threads_env="${MINERU_THREADS_FLAG:-OMP_NUM_THREADS}"
lang_flag="${MINERU_LANG_FLAG:--l}"
backend_flag="${MINERU_BACKEND_FLAG:--b}"
method_flag="${MINERU_METHOD_FLAG:--m}"
device_flag="${MINERU_DEVICE_FLAG:--d}"
case "$format" in
md) fmt_val="$fmt_md";;
json) fmt_val="$fmt_json";;
both) fmt_val="$fmt_both";;
*)
echo "Invalid format: $format (use md|json|both)" >&2
exit 1;;
esac
args=("$input_flag" "$input" "$output_flag" "$outdir" "$backend_flag" "$backend" \
"$lang_flag" "$lang" "$device_flag" "$device" "$method_flag" "$method")
if $tables; then
args+=("$tables_flag")
fi
if $images; then
args+=("$images_flag")
fi
# Include format if flag is supported by wrapper/CLI
if [[ -n "$format_flag" ]]; then
args+=("$format_flag" "$fmt_val")
fi
if [[ -n "${MINERU_EXTRA_ARGS:-}" ]]; then
# shellcheck disable=SC2206
extra=( ${MINERU_EXTRA_ARGS} )
args+=("${extra[@]}")
fi
echo "Running: $threads_env=$threads $cmd ${args[*]}"
env "$threads_env=$threads" "$cmd" "${args[@]}"
echo "Done. Output root: $outdir"