← 返回 Skills 市场
joergbot-cloud

Libreoffice Cli

cross-platform ⚠ suspicious
178
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install libreoffice-cli-pro
功能描述
Comprehensive document conversion, creation and editing via LibreOffice CLI (Headless-Modus). Use for: PDF export, format conversion (doc↔odt↔pdf, xls↔ods↔xl...
使用说明 (SKILL.md)

LibreOffice CLI Pro

Comprehensive LibreOffice 24.2+ management in headless mode with wrapper scripts, batch processing, and integration capabilities.

Quick Start

1. Check Installation

./scripts/libreoffice-check.sh health

2. Convert Single Document

./scripts/libreoffice-convert.sh document.docx pdf

3. Batch Convert Documents

./scripts/libreoffice-batch.sh ./documents/ pdf --recursive

Available Scripts

Script Description Usage
libreoffice-check.sh Health check and installation verification ./libreoffice-check.sh health
libreoffice-convert.sh Convert single document between formats ./libreoffice-convert.sh input.docx pdf
libreoffice-batch.sh Batch convert multiple documents ./libreoffice-batch.sh ./docs/ pdf --recursive
libreoffice-extract.sh Extract text from documents ./libreoffice-extract.sh document.pdf --format txt
libreoffice-pdf.sh PDF-specific operations ./libreoffice-pdf.sh merge *.docx output.pdf
libreoffice-merge.sh Merge multiple documents ./libreoffice-merge.sh *.odt combined.pdf

Complete Script Reference

libreoffice-check.sh

Health check and installation verification for LibreOffice.

# Comprehensive health check
./scripts/libreoffice-check.sh health

# Check specific components
./scripts/libreoffice-check.sh installed
./scripts/libreoffice-check.sh version
./scripts/libreoffice-check.sh headless
./scripts/libreoffice-check.sh conversion
./scripts/libreoffice-check.sh filters

# Installation help
./scripts/libreoffice-check.sh install-help

libreoffice-convert.sh

Convert single documents between various formats.

# Basic conversion
./scripts/libreoffice-convert.sh document.docx pdf

# With quality settings
./scripts/libreoffice-convert.sh presentation.pptx pdf --quality high

# Specific output directory
./scripts/libreoffice-convert.sh spreadsheet.xlsx ods --output ./converted/

# Verbose output for debugging
./scripts/libreoffice-convert.sh report.odt docx --verbose

libreoffice-batch.sh

Batch convert multiple documents with parallel processing.

# Convert all documents in directory
./scripts/libreoffice-batch.sh ./documents/ pdf

# Recursive conversion
./scripts/libreoffice-batch.sh ./project/ pdf --recursive

# Specific file pattern
./scripts/libreoffice-batch.sh . docx --pattern "*.odt"

# Parallel processing (4 threads)
./scripts/libreoffice-batch.sh ./large_collection/ pdf --threads 4

# Dry run (show what would be converted)
./scripts/libreoffice-batch.sh ./docs/ pdf --dry-run

libreoffice-extract.sh

Extract text content from various document formats.

# Extract text to console
./scripts/libreoffice-extract.sh document.pdf

# Extract to file with specific format
./scripts/libreoffice-extract.sh report.docx --format txt --output extracted.txt

# Extract as HTML
./scripts/libreoffice-extract.sh manual.odt --format html --output manual.html

# Extract as JSON with metadata
./scripts/libreoffice-extract.sh data.pdf --format json --output data.json

# Extract with cleaning and line limit
./scripts/libreoffice-extract.sh long_document.pdf --clean --lines 100 --output summary.txt

libreoffice-pdf.sh

PDF-specific operations including merge, split, optimize, and conversion.

# Merge documents into PDF
./scripts/libreoffice-pdf.sh merge chapter1.docx chapter2.odt --output book.pdf

# Split PDF into pages
./scripts/libreoffice-pdf.sh split document.pdf --output-dir ./pages

# Optimize PDF file size
./scripts/libreoffice-pdf.sh optimize large.pdf --compress 9 --remove-metadata

# Convert to PDF with quality settings
./scripts/libreoffice-pdf.sh convert presentation.pptx --output slides.pdf --quality high

# Show PDF information
./scripts/libreoffice-pdf.sh info document.pdf

# Extract content from PDF
./scripts/libreoffice-pdf.sh extract scanned.pdf --text --images --output-dir ./extracted

libreoffice-merge.sh

Merge multiple documents into a single document.

# Merge ODT files
./scripts/libreoffice-merge.sh chapter1.odt chapter2.odt --output book.odt

# Merge different formats with page breaks
./scripts/libreoffice-merge.sh intro.docx content.odt appendix.rtf --output complete.pdf --page-break

# Merge with table of contents
./scripts/libreoffice-merge.sh *.md --output documentation.odt --toc --title "User Manual"

# Merge sorted alphabetically
./scripts/libreoffice-merge.sh *.txt --output combined.odt --sort --author "Documentation Team"

Kernbefehle

Konvertierung (--convert-to)

# Basis-Syntax
libreoffice --headless --convert-to \x3CZielformat[:Filter]> --outdir \x3CVerzeichnis> \x3CDatei(en)>

# PDF aus verschiedenen Formaten
libreoffice --headless --convert-to pdf *.odt
libreoffice --headless --convert-to pdf *.docx
libreoffice --headless --convert-to pdf:writer_pdf_Export --outdir ./output *.doc

# Office-Formate
libreoffice --headless --convert-to docx *.odt
libreoffice --headless --convert-to odt *.docx
libreoffice --headless --convert-to xlsx *.ods
libreoffice --headless --convert-to xlsx:"Calc MS Excel 2007 XML" *.csv
libreoffice --headless --convert-to pptx *.odp

# Text extrahieren
libreoffice --headless --convert-to "txt:Text (encoded):UTF8" *.pdf
libreoffice --headless --convert-to html *.odt
libreoffice --headless --convert-to epub *.doc

Text-Anzeige (--cat)

# Textinhalt direkt auf Konsole ausgeben (kein Output-File)
libreoffice --headless --cat dokument.odt
libreoffice --headless --cat tabelle.xlsx

Drucken (--print-to-file)

libreoffice --headless --print-to-file --outdir ./output *.odt
libreoffice --headless --print-to-file --printer-name "PDF" --outdir ./output *.doc

Präsentationen anzeigen (--show)

libreoffice --show praesentation.odp  # startet Diashow

Dokumente öffnen (--view)

libreoffice --view dokument.odt  # schreibgeschützt

Format-Referenz

Eingabe → PDF → Modern → Text
.odt / .doc / .docx pdf docx / odt txt, html, epub
.ods / .xls / .xlsx pdf xlsx / ods csv, html
.odp / .ppt / .pptx pdf pptx / odp html, png
.csv pdf xlsx / ods -
.txt pdf odt / docx -
.html pdf odt txt

Wichtige Filter

  • writer_pdf_Export — Writer→PDF mit Kontrolle
  • calc_pdf_Export — Calc→PDF
  • impress_pdf_Export — Impress→PDF
  • Text (encoded):UTF8 — UTF-8 Text-Export
  • MS Word 2007 XML — docx (Writer)
  • Calc MS Excel 2007 XML — xlsx (Calc)

Flags

  • --headless — Kein GUI (impliziert bei --convert-to)
  • --outdir \x3Cpath> — Ausgabeverzeichnis (sonst cwd)
  • --infilter=\x3Cfilter> — Eingabe-Filter erzwingen (z.B. für CSV-Encoding)
  • --convert-images-to \x3Cfmt> — Bilder im Dokument konvertieren
  • -env:UserInstallation=file:///tmp/loprofile — Eigenes Profil nutzen

Beispiele

CSV → Excel mit korrektem Encoding

libreoffice --headless --infilter="Text - txt - csv (StarCalc):44,34,0,1,1" \
  --convert-to xlsx:"Calc MS Excel 2007 XML" daten.csv --outdir ./export/

Batch: Alle ODT → PDF

libreoffice --headless --convert-to pdf *.odt --outdir ./pdfs/

HTML mit Bildkonvertierung

libreoffice --headless --convert-to "html:XHTML Writer File:UTF8" \
  --convert-images-to "jpg" bericht.docx

Text aus PDF extrahieren

libreoffice --headless --cat dokument.pdf | head -100

Mehrere Ordner gleichzeitig

find ./docs -name "*.doc" -exec \
  libreoffice --headless --convert-to pdf --outdir ./pdfs/ {} \;

Reference Documentation

Complete reference documentation is available in the references/ directory:

Format Reference

references/format-reference.md - Complete format support matrix with conversion options, MIME types, and compatibility information.

Filter Reference

references/filter-reference.md - Detailed filter parameters, options syntax, JSON configuration, and advanced usage examples.

Examples Collection

references/examples.md - Practical examples and real-world workflows including batch processing, automation, and integration patterns.

Integration with Other Skills

Joplin Notes Integration

#!/bin/bash
# Convert Joplin notes to PDF
joplin export --format md notes.md
./scripts/libreoffice-convert.sh notes.md pdf --output joplin_notes.pdf

Gmail Attachment Processing

#!/bin/bash
# Process email attachments automatically
gog mail get \x3Cemail_id> --save-attachments ./attachments
./scripts/libreoffice-batch.sh ./attachments/ pdf --pattern "*.docx"

Web Content Conversion

#!/bin/bash
# Convert web articles to readable formats
web_fetch "https://example.com/article" --extractMode markdown > article.md
./scripts/libreoffice-convert.sh article.md pdf --quality high

Automated Document Pipeline

#!/bin/bash
# Complete document processing pipeline
INPUT_DIR="./incoming"
PROCESSED_DIR="./processed"

# 1. Health check
./scripts/libreoffice-check.sh health

# 2. Batch convert to PDF
./scripts/libreoffice-batch.sh "$INPUT_DIR" pdf --recursive --output "$PROCESSED_DIR"

# 3. Extract text for search indexing
find "$PROCESSED_DIR" -name "*.pdf" | while read pdf; do
    ./scripts/libreoffice-extract.sh "$pdf" --output "${pdf%.pdf}.txt" --clean
done

# 4. Create combined index
./scripts/libreoffice-merge.sh "$PROCESSED_DIR"/*.pdf --output "$PROCESSED_DIR/index.pdf" --toc

Tipps

  • Java-Warnungen (javaldx) können ignoriert werden — Grundfunktionen gehen ohne Java
  • Für parallele Konvertierungen: eigene Profile nutzen (-env:UserInstallation=...)
  • CSV: --infilter nutzen um Trennzeichen/Encoding zu setzen
  • Bei Fehlern: Dateiname ohne Leerzeichen/Sonderzeichen testen
  • Use the reference documentation for advanced filter options and JSON configuration
  • Check examples.md for complete automation workflows and integration patterns
安全使用建议
This skill appears to do what it says (LibreOffice headless wrappers) and contains useful scripts and documentation. However: 1) Inspect the scripts before use — they construct shell commands and call eval, which can be exploited if file names or inputs are attacker-controlled; avoid running them on untrusted directories. 2) Run the skill in a sandboxed environment (container or unprivileged user) and set LIBREOFFICE_PROFILE_DIR to an isolated temp directory. 3) If you plan to process files from external sources, sanitize filenames or modify the scripts to avoid eval/concatenation (use arrays and pass arguments safely). 4) The README shows example integrations that call external tools (gog, drive, network uploads) — those are examples only, but confirm you want any downstream upload actions. If you are not comfortable auditing shellcode, run conversions on a disposable VM/container.
功能分析
Type: OpenClaw Skill Name: libreoffice-cli-pro Version: 1.0.0 The skill bundle contains several shell scripts (libreoffice-batch.sh, libreoffice-convert.sh, and libreoffice-merge.sh) that are vulnerable to Shell Injection. These scripts use 'eval' on command strings constructed from unsanitized user input, such as file paths and patterns, which could allow an attacker to execute arbitrary commands. Additionally, libreoffice-merge.sh starts a LibreOffice instance with a network-listening UNO bridge on localhost, which is a functional but high-risk automation method. While these appear to be unintentional security flaws (vulnerabilities) rather than intentional malware, they pose a significant risk to the environment where the agent operates.
能力评估
Purpose & Capability
Name, description, and included scripts (convert, batch, extract, pdf, merge, health checks) match: the bundle implements LibreOffice headless CLI workflows and documentation aligns with that purpose. The package.json lists libreoffice as a prerequisite which is appropriate. Minor metadata inconsistency: registry lists source/homepage as unknown/none while package.json contains repo/homepage fields.
Instruction Scope
SKILL.md instructs the agent to run the included shell scripts and examples are limited to local conversions and integrations. However the scripts build and execute commands via eval and string concatenation (e.g., constructing find and libreoffice command strings and calling eval), which can be unsafe when processing untrusted filenames or arguments and may allow shell injection. Scripts create temporary files in /tmp and call external programs (parallel, jq, gog in examples) — examples reference network integrations but those are not executed automatically. No instructions request unrelated secrets or system-wide config.
Install Mechanism
No install spec is provided (instruction-only publish with bundled scripts), so nothing will be downloaded/installed by the platform. This is lower risk. package.json lists libreoffice dependency (informational) but there is no automatic installer; user must install LibreOffice separately.
Credentials
The skill does not request credentials or require environment variables. README documents optional env vars (LIBREOFFICE_PATH, LIBREOFFICE_PROFILE_DIR, LIBREOFFICE_MEMORY_LIMIT) which are reasonable for configuring local LibreOffice usage. No unrelated secrets or config paths are required.
Persistence & Privilege
always is false and the skill does not request persistent elevated privileges. Scripts operate on local files and /tmp profile dirs but do not modify other skills or agent configuration. There is no autonomous-install behavior in the files provided.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install libreoffice-cli-pro
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /libreoffice-cli-pro 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
libreoffice-cli-pro 1.0.0 - Initial release offering comprehensive document management via the LibreOffice CLI in headless mode. - Includes scripts for document conversion, batch processing, PDF operations, text extraction, merging, and health checks. - Supports a wide range of formats: doc/odt/pdf, xls/ods/xlsx, ppt/odp/pptx, and more. - Provides automation workflows and integration points for use with other tools or skills. - Features detailed script usage examples and reference commands for advanced document handling.
元数据
Slug libreoffice-cli-pro
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Libreoffice Cli 是什么?

Comprehensive document conversion, creation and editing via LibreOffice CLI (Headless-Modus). Use for: PDF export, format conversion (doc↔odt↔pdf, xls↔ods↔xl... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 178 次。

如何安装 Libreoffice Cli?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install libreoffice-cli-pro」即可一键安装,无需额外配置。

Libreoffice Cli 是免费的吗?

是的,Libreoffice Cli 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Libreoffice Cli 支持哪些平台?

Libreoffice Cli 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Libreoffice Cli?

由 Waltraud by joerg - Human-AI Collaboration(@joergbot-cloud)开发并维护,当前版本 v1.0.0。

💬 留言讨论