一键导入
kreuzberg
Extract text, tables, metadata, and images from 91+ document formats (PDF, Office, images, HTML, email, archives, academic) using Kreuzberg CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract text, tables, metadata, and images from 91+ document formats (PDF, Office, images, HTML, email, archives, academic) using Kreuzberg CLI.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | kreuzberg |
| description | Extract text, tables, metadata, and images from 91+ document formats (PDF, Office, images, HTML, email, archives, academic) using Kreuzberg CLI. |
| license | Elastic-2.0 |
| metadata | {"author":"kreuzberg-dev","version":"1.0","repository":"https://github.com/kreuzberg-dev/kreuzberg"} |
Kreuzberg extracts text, tables, metadata, and images from 91+ file formats. Use it for document processing, OCR, batch extraction, structured LLM extraction, and embeddings.
Run kreuzberg --help for all commands, kreuzberg <command> --help for full flag reference.
# Single file → stdout (text) or JSON
kreuzberg extract document.pdf
kreuzberg extract document.pdf --content-format markdown --format json
# Batch
kreuzberg batch *.pdf --content-format markdown
# Detect MIME type
kreuzberg detect unknown-file
Extracts typed JSON from a document using a schema + LLM model. API key falls back to OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.
kreuzberg extract-structured invoice.pdf \
--schema schema.json \
--model openai/gpt-4o \
--strict
Local ONNX (no API key) or provider-hosted. Not available in Homebrew — use Docker.
kreuzberg embed --text "hello world" --preset balanced
echo "some text" | kreuzberg embed --provider llm --model openai/text-embedding-3-small
kreuzberg chunk --text "..." --chunk-size 500 --chunk-overlap 50
kreuzberg chunk --chunker-type markdown --text "# Heading\n\nParagraph..."
cat file.txt | kreuzberg chunk --chunker-type semantic --topic-threshold 0.8
Only kreuzberg.toml is auto-discovered. YAML/JSON require --config <path>.
kreuzberg extract doc.pdf # finds kreuzberg.toml automatically
kreuzberg extract doc.pdf --config my.yaml # explicit for non-TOML
kreuzberg extract doc.pdf --config-json '{"ocr":{"language":"deu"}}'
Config file skeleton (field names are snake_case — max_chars not max_characters):
use_cache = true
enable_quality_processing = true
output_format = "markdown" # content format for file output
[ocr]
backend = "tesseract" # tesseract | paddle-ocr | easyocr
language = "eng" # ISO 639-3 for tesseract; short codes for paddle/easyocr
[chunking]
max_chars = 1000 # NOT max_characters
max_overlap = 200 # NOT overlap
[pdf_options]
extract_images = true
[server] # for `kreuzberg serve`
host = "127.0.0.1"
port = 8000
Images are not written to disk — they come back as byte arrays in JSON output. Two-step process required:
# Step 1: capture JSON
kreuzberg extract doc.pdf --pdf-extract-images true --format json > out.json
# Step 2: save images
python3 -c "
import json, pathlib
d = json.load(open('out.json'))
pathlib.Path('images').mkdir(exist_ok=True)
for img in d.get('images', []):
pathlib.Path(f'images/image_{img[\"image_index\"]}.{img[\"format\"]}').write_bytes(bytes(img['data']))
"
| Flag | Note |
|---|---|
--format | Wire format for CLI output: text (default for extract), json, toon (token-efficient JSON) |
--content-format | Format of extracted text: plain, markdown, djot, html. --output-format is a deprecated alias. |
--token-reduction | off/light/moderate/aggressive/maximum — reduce tokens before LLM consumption |
--acceleration | ONNX provider: auto, cpu, coreml (macOS), cuda, tensorrt |
--pdf-extract-images | Embeds image bytes in JSON result (see above) |
--format ≠ --content-format: one controls the serialization envelope, the other the text inside it.kreuzberg.toml — not YAML or JSON.result.images[] as byte arrays; nothing is written to disk automatically.embed is excluded from the Homebrew build; use Docker or cargo install.extract-structured, use --token-reduction to stay within LLM context limits.references/supported-formats.md instead of reading it whole
e.g. grep '.mdoc' references/supported-formats.mdMaintain the nmem knowledge base — a lint pass that hunts contradictions, duplicates, dead references, and expired entries, plus a synthesis pass that reports what changed and what is drifting. Use when the user says "lint my memory", "curate", "整理知识库", "nmem 维护", suspects memories have gone stale, or on a scheduled maintenance run.
Delegate a self-contained task to a separate streaming agent session, then summarize the result. The backend (Claude Code or Pi) is chosen automatically from the model you name — say "let opus/sonnet/claude look at it" to route to Claude Code, or "let codex/gpt look at it" to route to Pi. Use when the user wants delegation, subagents, parallel research, isolated context, resuming a delegated task, or running a task on a specific model regardless of which runtime backs it.
Multi-perspective code review using adversarial subagent debate. First gives the user a simple but detailed What/Why/How/Refs brief: what changed, why it exists, how it works, and which files, commits, or PR references support the explanation. Then spawns parallel reviewer agents (bug hunter, security auditor, architecture critic, correctness prover) that independently analyze the current branch diff, consolidates and debates findings, and produces a machine-readable review bundle plus human-readable HTML report with near-zero false positives. The report opens with a reviewer-facing overview of the PR — its purpose, what changed and why, whether the changes are necessary, and the regression and security risk — before the debated findings. Use when the user says "review", "code review", "review my changes", "check this PR", "find bugs", "audit this branch", or wants a thorough quality check before merging.
Write a decision-first implementation plan as plan.md — design decisions with alternatives and tradeoffs, phased tasks with acceptance blocks, inline review threads, and per-phase handoff notes. Use when the user wants an implementation plan, says "write a plan", "plan this out", "写个计划", wants a plan reviewed or review threads resolved, or as the Plan step of the spec-dev workflow.
Execute an existing plan.md phase by phase — catch up from the prior handoff, implement, verify the Acceptance block, review if warranted, commit, write the next handoff. Use when the user says "implement the plan", "execute the plan", "continue the plan", "next phase", "按计划实现", picks up a stalled plan in a fresh session, or as the Impl step of the spec-dev workflow.
Scout the territory before building — a map-vs-territory diagnostic plus eight lightweight techniques (blindspot pass, brainstorm prototypes, interview, references, decision-first plans, deviation notes, explainers, quizzes) for finding your unknowns before they get expensive, applied inline with no workflow ceremony. Use when the user starts unfamiliar work, says "scout this", "blindspot pass", "unknown unknowns", "我不熟这块", "帮我找盲区", can't articulate what they want, or a long-horizon task came back wrong and planning harder isn't helping.