officecli-docx

A set of instructions for working with Microsoft Word documents, which use the .docx format. It covers creating, reading, editing, and reviewing reports, letters, proposals, templates, tracked changes, comments, and document fields.

In plain words
What is it for?
Use it to create or revise Word documents, extract their content, manage headings and numbering, add fields or tables of contents, and review comments or tracked changes.
Why use it?
It helps preserve document structure and presentation details that can be lost when Word files are treated as plain text.

Skill for Claude CodeCodex

▶ OfficeCLI Hit 13,000 Stars: AI Agents Now Run Office Prism Labs · about iOfficeAI/OfficeCLI · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/iofficeai/officecli/officecli-docx
Any agent
npx skills add iOfficeAI/OfficeCLI --skill officecli-docx
Clone the repo
git clone --depth 1 https://github.com/iOfficeAI/OfficeCLI

Made for: Claude Code, Codex.

Per session 114 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 11,635 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00114 $0.11635
Opus 5 $0.00057 $0.05817
Sonnet 5 $0.00023 $0.02327
Haiku 4.5 $0.00011 $0.01163

Measured 3d ago against content hash 1da56ed53a30, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

officecli-docx scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

- **macOS / Linux**: `curl -fsSL https://d.officecli.ai/install.sh | bash`

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- **macOS / Linux**: `curl -fsSL https://d.officecli.ai/install.sh | bash`
skills/officecli-docx/SKILL.md · 563 lines

How it starts

The opening of the file, as written. The whole thing — 563 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OfficeCLI DOCX Skill

Setup

If officecli is missing:

  • macOS / Linux: curl -fsSL https://d.officecli.ai/install.sh | bash
  • Windows (PowerShell): irm https://d.officecli.ai/install.ps1 | iex

Verify with officecli --version (open a new terminal if PATH hasn't picked up). If install fails, download a binary from https://github.com/iOfficeAI/OfficeCLI/releases.

⚠️ Help-First Rule

This skill teaches what good docx looks like, not every command flag. When a property name, enum value, or alias is uncertain, consult help BEFORE guessing.

officecli help docx                         # List all docx elements
officecli help docx <element>               # Full element schema (e.g. paragraph, field, numbering, watermark, toc)
officecli help docx <verb> <element>        # Verb-scoped (e.g. add field, set section)
officecli help docx <element> --json        # Machine-readable schema

Help is pinned to the installed CLI version. When this skill and help disagree, help is authoritative.

Mental Model

A .docx is a ZIP of XML parts (document.xml, styles.xml, numbering.xml, header*.xml, footer*.xml, comments.xml, …). Everything the user sees — headings, tables, page numbers, TOC, tracked changes — is XML inside that ZIP. officecli gives you a semantic-path API (/body/p[1]/r[2]) over it, so you almost never touch raw XML; when you must, use raw-set (see the XML appendix).

Shell & Execution Discipline

docx paths contain []; some prop values contain $. Both are shell metacharacters. Escaping happens at three layers — keep them separate.

  1. Shell. ALWAYS quote element paths: "/body/p[1]", not /body/p[1] (zsh/bash glob [N]). Single-quote any value containing $: --prop text='$50M' — at any length, the whole value inside one pair of single quotes. Unquoted $50M is stripped to M; mixing '…$var…' and "…$50…" on one long string is where the $50 silently vanishes.
  2. CLI (text=). The two-char escapes \n and \t ARE interpreted in --prop text=\n becomes a <w:br/> soft line break, \t a <w:tab/> — consistently across docx / pptx / xlsx. Double them (\\n) for a literal backslash-n (rarely wanted). This applies to row-level table c1…cN shortcuts too (\n<w:br/> within the cell).
  3. JSON (batch). A real newline can also be passed as "\n" in the JSON string of a batch heredoc; same result.

Read the full file on GitHub · 563 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 563 lines · 114 tokens per session scan C 1da56ed53a30

Subscribe to this mod's changes

officecli-docx is a skill published in the GitHub repository iOfficeAI/OfficeCLI (29,674 stars, last pushed yesterday), licensed Apache-2.0. It adds 114 tokens to every session and 11,635 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

chinese-pdf-report

Create professional Chinese PDF reports with reliable font rendering on macOS, especially when previous HTML-to-PDF output produced garbled Chinese text, missing glyphs, or ugly default typography. Use when asked to generate or re-export Chinese-heavy PDFs, fix Chinese font issues, improve typography for formal…

davidtoby/agent-skills · 80 tokens

youtube-bilingual-subtitle-delivery

Download a YouTube video, convert to MP4 if needed, build bilingual English/Chinese subtitles, audit completeness, and export softsub + hardcode MP4 deliverables. Includes fallback paths when YouTube auto-captions are partial or Chinese caption download is rate-limited, and notes a hardcode duration drift fix.

davidtoby/agent-skills · 73 tokens

precise-bilingual-subtitle

Produce bilingual (EN+ZH) hardcoded-subtitle videos with Whisper word-level timing accuracy, customizable font/color/size, and the full pipeline from raw YouTube video to yellow-subtitle MP4. Use when YouTube auto-captions drift, when the user wants specific subtitle styling (color, size, font), or when subtitle…

davidtoby/agent-skills · 83 tokens

youtube-bilingual-transcript-report

Download a YouTube video, build English and Chinese timestamped transcripts, create a structured summary with independent insights, and export a professional Chinese PDF report. Includes fallback when Chinese subtitle download hits HTTP 429 and when full-resolution video download is unnecessarily heavy.

davidtoby/agent-skills · 57 tokens

gmail

Gmail API integration with managed OAuth. Read, send, and manage emails, threads, labels, and drafts. Use this skill when users want to interact with Gmail. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).

davidtoby/agent-skills · 63 tokens

hermes-manual-update-and-report

Manually update a local Hermes Agent checkout and generate a maintenance report when hermes update is blocked by approval issues or hangs.

davidtoby/agent-skills · 35 tokens