| name | officecli-office-automation |
| description | Use OfficeCLI to create, read, and edit Word, Excel, and PowerPoint files from the command line with AI-friendly commands. |
| triggers | ["create a Word document","edit an Excel spreadsheet","make a PowerPoint presentation","modify Office files","automate document generation","convert Office files to HTML","add slides to presentation","update spreadsheet formulas"] |
OfficeCLI Office Automation Skill
Skill by ara.so — Devtools Skills collection.
OfficeCLI is an Office suite purpose-built for AI agents to create, read, and edit Word (.docx), Excel (.xlsx), and PowerPoint (.pptx) files. It's a single binary with no Office installation required, featuring a unified CLI interface and built-in rendering to HTML/PNG.
Installation
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/iOfficeAI/OfficeCLI/main/install.ps1 | iex
Manual installation:
- Download the binary for your platform from GitHub Releases
- Run
officecli install to add to PATH
Verify installation:
officecli --version
Core Commands
File Operations
Create a new document:
officecli create document.docx
officecli create spreadsheet.xlsx
officecli create presentation.pptx
officecli create report.docx --prop title="Q4 Report"
View document content:
officecli view document.docx outline
officecli view document.docx text
officecli view document.docx html
officecli view document.docx json
Get specific elements:
officecli get document.docx '/paragraph[1]' --json
officecli get spreadsheet.xlsx '$Sheet1:A1' --json
officecli get presentation.pptx '/slide[1]/shape[2]' --json
Live Preview
Watch mode (auto-refresh in browser):
officecli watch presentation.pptx
officecli watch presentation.pptx --port 8080
Word Documents (.docx)
Path Syntax
/paragraph[N] - Nth paragraph (1-indexed)
/paragraph[N]/run[M] - Mth run in Nth paragraph
/table[N] - Nth table
/table[N]/row[R]/cell[C] - Cell in table
Add Content
Add paragraphs:
officecli add report.docx / --type paragraph --prop text="Executive Summary"
officecli add report.docx / --type paragraph \
--prop text="Quarterly Revenue Analysis" \
--prop style=Heading1 \
--prop align=center
officecli add report.docx / --type paragraph \
--prop text="Important notice" \
--prop bold=true \
--prop color=FF0000 \
--prop size=14
Add runs (inline formatting):
officecli add report.docx '/paragraph[1]' --type run \
--prop text="bold text" \
--prop bold=true
Add tables:
officecli add report.docx / --type table \
--prop rows=3 \
--prop cols=3
officecli set report.docx '/table[1]/row[1]/cell[1]' \
--prop text="Header 1"
Add images:
officecli add report.docx / --type picture \
--prop src=chart.png \
--prop width=15cm \
--prop height=10cm
Add headers/footers:
officecli add report.docx '/section[1]' --type header \
--prop type=default
officecli add report.docx '/section[1]/header[1]' --type paragraph \
--prop text="Confidential Report" \
--prop align=right
Modify Content
Set paragraph properties:
officecli set report.docx '/paragraph[1]' \
--prop text="Updated title" \
--prop style=Heading1 \
--prop align=center \
--prop spaceBefore=240 \
--prop spaceAfter=120
Set run properties:
officecli set report.docx '/paragraph[2]/run[1]' \
--prop bold=true \
--prop italic=true \
--prop font=Arial \
--prop size=12 \
--prop color=0000FF
Remove Content
officecli remove report.docx '/paragraph[3]'
officecli remove report.docx '/table[1]'
RTL and i18n Support
officecli add report.docx / --type paragraph \
--prop text="مرحبا بك" \
--prop direction=rtl \
--prop lang.cs=ar-SA
officecli add report.docx / --type paragraph \
--prop text="Hello 世界 مرحبا" \
--prop font.latin=Arial \
--prop font.ea="MS Gothic" \
--prop font.cs="Arial Unicode MS"
Excel Spreadsheets (.xlsx)
Cell Addressing
$SheetName:A1 - Cell A1 in named sheet
$Sheet1:B2:D4 - Range B2:D4
/sheet[1]/cell[A1] - Path-based addressing
Add Content
Add sheets:
officecli add budget.xlsx / --type sheet --prop name="Q1 Budget"
officecli add budget.xlsx / --type sheet \
--prop name="Summary" \
--prop tabColor=FF0000 \
--prop state=visible
Add cells:
officecli add budget.xlsx '$Sheet1:A1' --type cell \
--prop value="Revenue"
officecli add budget.xlsx '$Sheet1:B1' --type cell \
--prop value=125000 \
--prop format='$#,##0.00'
officecli add budget.xlsx '$Sheet1:C1' --type cell \
--prop formula='=SUM(B1:B10)'
officecli add budget.xlsx '$Sheet1:D1' --type cell \
--prop value=2024-01-15 \
--prop format='yyyy-mm-dd'
Batch add cells:
officecli add budget.xlsx '$Sheet1:A1' --type cell --prop value="Name"
officecli add budget.xlsx '$Sheet1:B1' --type cell --prop value="Amount"
officecli add budget.xlsx '$Sheet1:A2' --type cell --prop value="Sales"
officecli add budget.xlsx '$Sheet1:B2' --type cell --prop value=50000
Add tables:
officecli add budget.xlsx '$Sheet1:A1:C10' --type table \
--prop name="SalesData" \
--prop style=TableStyleMedium2 \
--prop showHeader=true
Add charts:
officecli add budget.xlsx '$Sheet1' --type chart \
--prop chartType=column \
--prop dataRange='$Sheet1:A1:B10' \
--prop title="Sales by Region" \
--prop x=5cm \
--prop y=2cm
officecli add budget.xlsx '$Sheet1' --type chart \
--prop chartType=pie \
--prop dataRange='$Sheet1:A1:B5' \
--prop title="Market Share"
Add pivot tables:
officecli add budget.xlsx '$Sheet2:A1' --type pivottable \
--prop sourceRange='$Sheet1:A1:D100' \
--prop rowFields=Region \
--prop dataFields=Sales \
--prop name="SalesByRegion"
Modify Content
Set cell values:
officecli set budget.xlsx '$Sheet1:A1' --prop value="Updated"
officecli set budget.xlsx '$Sheet1:B2' \
--prop value=75000 \
--prop format='$#,##0.00' \
--prop bold=true \
--prop color=FF0000
Set sheet properties:
officecli set budget.xlsx '/sheet[1]' \
--prop name="Renamed Sheet" \
--prop tabColor=00FF00 \
--prop direction=rtl
Formulas
150+ built-in functions with auto-evaluation:
officecli add budget.xlsx '$Sheet1:C1' --type cell \
--prop formula='=SUM(A1:A10)'
officecli add budget.xlsx '$Sheet1:D1' --type cell \
--prop formula='=IF(B1>1000,"High","Low")'
officecli add budget.xlsx '$Sheet1:E1' --type cell \
--prop formula='=VLOOKUP(A1,$Sheet2:A:B,2,FALSE)'
officecli add budget.xlsx '$Sheet1:F1' --type cell \
--prop formula='=TODAY()'
Sort Data
officecli add budget.xlsx '$Sheet1:A1:C10' --type sort \
--prop key1=B \
--prop order1=desc
officecli add budget.xlsx '$Sheet1:A1:D20' --type sort \
--prop key1=A \
--prop order1=asc \
--prop key2=B \
--prop order2=desc
Conditional Formatting
officecli add budget.xlsx '$Sheet1:B2:B10' --type conditionalformatting \
--prop type=colorScale \
--prop minColor=FF0000 \
--prop maxColor=00FF00
PowerPoint Presentations (.pptx)
Path Syntax
/slide[N] - Nth slide
/slide[N]/shape[M] - Mth shape on slide
/slide[N]/table[M] - Mth table on slide
Add Content
Add slides:
officecli add deck.pptx / --type slide
officecli add deck.pptx / --type slide \
--prop title="Introduction"
officecli add deck.pptx / --type slide \
--prop title="Dark Theme" \
--prop background=1A1A2E
Add shapes (text boxes):
officecli add deck.pptx '/slide[1]' --type shape \
--prop text="Hello World" \
--prop x=2cm \
--prop y=3cm \
--prop width=10cm \
--prop height=2cm
officecli add deck.pptx '/slide[1]' --type shape \
--prop text="Key Findings" \
--prop x=1cm \
--prop y=2cm \
--prop font=Arial \
--prop size=32 \
--prop color=FFFFFF \
--prop bold=true \
--prop align=center
Add images:
officecli add deck.pptx '/slide[1]' --type picture \
--prop src=logo.png \
--prop x=1cm \
--prop y=1cm \
--prop width=5cm \
--prop height=3cm
officecli add deck.pptx '/slide[1]' --type picture \
--prop src=photo.jpg \
--prop x=5cm \
--prop y=5cm \
--prop brightness=20 \
--prop contrast=10 \
--prop shadow=true
Add tables:
officecli add deck.pptx '/slide[1]' --type table \
--prop rows=3 \
--prop cols=3 \
--prop x=2cm \
--prop y=5cm
officecli set deck.pptx '/slide[1]/table[1]/row[1]/cell[1]' \
--prop text="Header 1" \
--prop bold=true
Add charts:
officecli add deck.pptx '/slide[1]' --type chart \
--prop chartType=column \
--prop title="Sales Growth" \
--prop x=2cm \
--prop y=5cm \
--prop width=20cm \
--prop height=10cm
Add 3D models:
officecli add deck.pptx '/slide[1]' --type 3dmodel \
--prop src=model.glb \
--prop x=5cm \
--prop y=5cm \
--prop width=10cm \
--prop height=10cm
Slide Transitions and Animations
Add transitions:
officecli set deck.pptx '/slide[2]' \
--prop transition=morph \
--prop duration=1000
Add animations:
officecli add deck.pptx '/slide[1]/shape[1]' --type animation \
--prop effect=fadeIn \
--prop duration=500
Modify Content
Set shape properties:
officecli set deck.pptx '/slide[1]/shape[1]' \
--prop text="Updated text" \
--prop font=Calibri \
--prop size=28 \
--prop color=333333 \
--prop fill=F0F0F0
Set slide properties:
officecli set deck.pptx '/slide[1]' \
--prop title="New Title" \
--prop background=FFFFFF \
--prop hidden=false
Speaker Notes
officecli add deck.pptx '/slide[1]' --type notes \
--prop text="Remember to mention the Q3 results"
Common Patterns
Batch Document Generation
#!/bin/bash
for month in Jan Feb Mar Apr; do
officecli create "report-${month}.docx"
officecli add "report-${month}.docx" / --type paragraph \
--prop text="${month} Report" \
--prop style=Heading1
officecli add "report-${month}.docx" / --type paragraph \
--prop text="Generated on $(date)"
done
CSV to Excel
officecli create data.xlsx
officecli add data.xlsx '$Sheet1' --type import \
--prop src=data.csv \
--prop format=csv
Multi-slide Presentation from Template
#!/bin/bash
officecli create pitch.pptx
officecli add pitch.pptx / --type slide \
--prop title="Product Launch" \
--prop background=1A1A2E
for topic in "Problem" "Solution" "Market" "Team"; do
officecli add pitch.pptx / --type slide \
--prop title="$topic" \
--prop background=1A1A2E
officecli add pitch.pptx '/slide[-1]' --type shape \
--prop text="Content for $topic" \
--prop x=2cm \
--prop y=5cm \
--prop color=FFFFFF
done
Automated Report with Charts
#!/bin/bash
officecli create sales.xlsx
officecli add sales.xlsx '$Sheet1:A1' --type cell --prop value="Month"
officecli add sales.xlsx '$Sheet1:B1' --type cell --prop value="Revenue"
officecli add sales.xlsx '$Sheet1:A2' --type cell --prop value="January"
officecli add sales.xlsx '$Sheet1:B2' --type cell --prop value=50000
officecli add sales.xlsx '$Sheet1:A3' --type cell --prop value="February"
officecli add sales.xlsx '$Sheet1:B3' --type cell --prop value=65000
officecli add sales.xlsx '$Sheet1:A4' --type cell --prop value="March"
officecli add sales.xlsx '$Sheet1:B4' --type cell --prop value=72000
officecli add sales.xlsx '$Sheet1' --type chart \
--prop chartType=line \
--prop dataRange='$Sheet1:A1:B4' \
--prop title="Monthly Revenue" \
--prop x=5cm \
--prop y=2cm
Extract and Transform
#!/bin/bash
text=$(officecli view input.docx text)
processed=$(echo "$text" | tr '[:lower:]' '[:upper:]')
officecli create output.docx
officecli add output.docx / --type paragraph --prop text="$processed"
Integration with Scripts
Python Integration
import subprocess
import json
def create_report(title, content):
"""Create a Word document using OfficeCLI."""
filename = f"{title}.docx"
subprocess.run(["officecli", "create", filename])
subprocess.run([
"officecli", "add", filename, "/",
"--type", "paragraph",
"--prop", f"text={title}",
"--prop", "style=Heading1"
])
for paragraph in content:
subprocess.run([
"officecli", "add", filename, "/",
"--type", "paragraph",
"--prop", f"text={paragraph}"
])
return filename
def get_cell_value(filename, cell):
"""Get cell value from Excel file."""
result = subprocess.run([
"officecli", "get", filename, cell, "--json"
], capture_output=True, text=True)
data = json.loads(result.stdout)
return data.get("attributes", {}).get("value")
create_report(, [
,
,
])
value = get_cell_value(, )
()
Node.js Integration
const { execSync } = require('child_process');
function createPresentation(title, slides) {
const filename = `${title}.pptx`;
execSync(`officecli create "${filename}"`);
slides.forEach(slide => {
execSync(`officecli add "${filename}" / --type slide --prop title="${slide.title}"`);
if (slide.content) {
execSync(`officecli add "${filename}" '/slide[-1]' --type shape --prop text="${slide.content}" --prop x=2cm --prop y=5cm`);
}
});
return filename;
}
function viewAsHTML(filename) {
execSync(`officecli view "${filename}" html`);
}
const slides = [
{ title: "Introduction", content: "Welcome to our presentation" },
{ title: "Main Points", content: "Key findings and results" },
{ title: "Conclusion", content: "Thank you" }
];
const file = (, slides);
(file);
Troubleshooting
Binary not found after installation
which officecli
officecli install
export PATH="$PATH:$HOME/.officecli/bin"
File not opening in Office
officecli view document.docx outline
file document.docx
Preview not refreshing in watch mode
officecli watch document.docx
officecli watch document.docx --port 8081
Permission denied errors
ls -l document.docx
chmod 644 document.docx
Invalid path errors
officecli view document.docx outline
officecli get document.docx / --json
Formula not calculating in Excel
officecli get spreadsheet.xlsx '$Sheet1:A1' --json
RTL text not rendering correctly
officecli set document.docx '/paragraph[1]' \
--prop direction=rtl \
--prop lang.cs=ar-SA
officecli set document.docx '/paragraph[1]' \
--prop font.cs="Arial Unicode MS"
Image not appearing
ls -l image.png
file image.png
officecli add doc.docx / --type picture --prop src=/full/path/to/image.png
Configuration
OfficeCLI is designed to work out-of-the-box with no configuration needed. All settings are passed as command-line flags.
Common flags:
--json - Output as JSON
--port PORT - Custom port for watch server (default: 26315)
--prop key=value - Set element properties
Documentation
Key Concepts
- XPath-like addressing: All elements use path notation (
/paragraph[1], $Sheet1:A1, /slide[1]/shape[2])
- Unified interface: Same
add, set, get, remove, view verbs across all formats
- Live preview:
watch command provides real-time browser preview with auto-refresh
- No dependencies: Single binary, no Office installation needed
- AI-first design: Commands optimized for LLM generation and automation
- Format preservation: Edit documents without breaking complex formatting
- Rich i18n: Full RTL support, per-script fonts, locale-aware rendering
When helping users with OfficeCLI, focus on the unified command structure and path-based addressing. The same patterns work across Word, Excel, and PowerPoint with format-specific properties.