officecli
AI-friendly CLI for .docx, .xlsx, .pptx.
Install
if ! command -v officecli >/dev/null 2>&1; then
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.sh | bash
fi
if (-not (Get-Command officecli -ErrorAction SilentlyContinue)) {
irm https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.ps1 | iex
}
Verify with officecli --version.
Strategy
Prefer higher-level operations first:
L1readL2DOM editL3raw XML
Use --json when you need structured output.
Help First
If you are unsure about paths or property names, run help instead of guessing:
officecli pptx set
officecli pptx set shape
officecli pptx set shape.fill
Swap pptx for docx or xlsx.
Core Workflow
For multi-step edits, keep the file resident:
officecli open report.docx
officecli set report.docx ...
officecli close report.docx
For visual review and targeted edits, use watch/selection/marks:
officecli watch report.docx
officecli get report.docx selected --json
officecli mark report.docx /body/p[3] --prop find=foo --prop tofix=bar
officecli get-marks report.docx --json
officecli unmark report.docx --all
officecli unwatch report.docx
Main Commands
createviewgetqueryvalidatesetaddmoveswapremovebatchrawraw-set
Notes
- Paths are
1-based;--indexis0-based. - Prefer stable IDs like
@id=or@paraId=when a path must survive insert/delete. - Use
view issuesto catch formatting, content, and structure problems early. - For large documents, limit output with
--max-lines. - Close the file in Office/WPS before editing it.
Related Skills
officecli-docxofficecli-pptxofficecli-xlsxofficecli-academic-paperofficecli-pitch-deckofficecli-data-dashboardmorph-ppt