Office & Productivity
LibreOffice CLI
Writer, Calc, Impress headless — real PDF export
✓ 158 tests passed
Install
$ pip install cli-anything-libreoffice
About
Generate and convert Office documents headlessly. Create Writer documents, Calc spreadsheets and Impress presentations programmatically. Export real PDFs with full formatting preservation.
Requirements
LibreOffice
Command Reference
| Command | Arguments | Description |
|---|---|---|
detect |
Check LibreOffice installation | |
version |
Show LibreOffice version | |
convert |
INPUT --format pdf|docx|odt|xlsx|pptx --output OUT |
Convert document format |
create-doc |
--content TEXT --output OUT |
Create Writer document |
create-sheet |
--csv DATA --output OUT |
Create Calc spreadsheet from CSV |
info |
FILE |
Get document metadata |
batch-convert |
DIR --from-format odt --to-format pdf |
Batch convert directory |
Usage Examples
# Install
$ pip install cli-anything-libreoffice
# Health check
$ libreoffice-cli detect
# Get capabilities schema (Agent-ready, no token needed)
$ libreoffice-cli schema
# Run with JSON output (for AI Agent integration)
$ libreoffice-cli --json detect
# Example JSON response:
{"pages":5,"words":1250,"author":"AgentPuter","created":"2026-03-15","format":"pdf"}
Agent Integration
# Python — call from AI Agent
import subprocess, json
result = subprocess.run(
["libreoffice-cli", "--json", "detect"],
capture_output=True, text=True
)
data = json.loads(result.stdout)
print(data)
# Discover all commands without credentials:
schema = subprocess.run(
["libreoffice-cli", "schema"],
capture_output=True, text=True
)
capabilities = json.loads(schema.stdout)