officecli-docx — office命令行工具-docx
v1.0.23Use this 技能 any time a .docx file is involved -- as 输入, 输出, or 机器人h. This includes: creating Word documents, 报告s, letters, memos, or proposals; reading, parsing, or 提取ing text from any .docx file; editing, modifying, or updating existing documents; working with templates, 追踪ed changes, comments, headers/footers, or tables of contents. Trigger whenever the user mentions 'Word doc', 'document', '报告', 'letter', 'memo', or references a .docx filename.
运行时依赖
安装命令
点击复制技能文档
office命令行工具: v1.0.23 Office命令行工具 DOCX 技能 BEFORE YOU 启动 (CRITICAL)
Every time before using office命令行工具, 运行 this 检查:
if ! command -v office命令行工具 &> /dev/null; then echo "安装ing office命令行工具..." curl -fsSL https://raw.githubusercontent.com/iOfficeAI/Office命令行工具/mAIn/安装.sh -o /tmp/office命令行工具_安装.sh && bash /tmp/office命令行工具_安装.sh && rm -f /tmp/office命令行工具_安装.sh # Windows: irm https://raw.githubusercontent.com/iOfficeAI/Office命令行工具/mAIn/安装.ps1 -OutFile "$env:TEMP\office命令行工具_安装.ps1"; & "$env:TEMP\office命令行工具_安装.ps1" else CURRENT=$(office命令行工具 --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1) LATEST=$(curl -fsSL https://API.github.com/repos/iOfficeAI/Office命令行工具/releases/latest | grep '"tag_name"' | sed -E 's/."v?([0-9.]+)"./\1/') if [ "$CURRENT" != "$LATEST" ]; then echo "Upgrading office命令行工具 $CURRENT → $LATEST..." curl -fsSL https://raw.githubusercontent.com/iOfficeAI/Office命令行工具/mAIn/安装.sh -o /tmp/office命令行工具_安装.sh && bash /tmp/office命令行工具_安装.sh && rm -f /tmp/office命令行工具_安装.sh else echo "office命令行工具 $CURRENT is up to date" fi fi office命令行工具 --version
office命令行工具: v1.0.23 Quick Reference Task Action Read / analyze content Use view and 获取 commands below Edit existing document Read editing.md 创建 from scratch Read creating.md office命令行工具: v1.0.23 Reading & Analyzing Text 提取ion office命令行工具 view doc.docx text office命令行工具 view doc.docx text --max-lines 200 office命令行工具 view doc.docx text --启动 1 --end 50
text mode shows [/body/p[N]] text content, tables as [Table: N rows], equations as readable math. Use --max-lines or --启动/--end for large documents to avoid dumping entire content.
Structure Overview office命令行工具 view doc.docx outline
输出 shows file stats (paragraph count, tables, images, equations), watermark presence, headers/footers, and heading hierarchy tree.
DetAIled Inspection office命令行工具 view doc.docx annotated
Shows style, font, size, bold/italic per 运行; equations as LaTeX; images with alt text. Empty paragraphs shown as [] <-- empty paragraph.
Statistics office命令行工具 view doc.docx stats
Paragraph count, style distribution, font usage, font size usage, empty paragraph count.
Element Inspection # Document root (metadata, page 设置up) office命令行工具 获取 doc.docx /
# 列出 body children at depth 1 office命令行工具 获取 doc.docx /body --depth 1
# Specific paragraph office命令行工具 获取 doc.docx "/body/p[1]"
# Specific 运行 office命令行工具 获取 doc.docx "/body/p[1]/r[1]"
# Table structure office命令行工具 获取 doc.docx "/body/tbl[1]" --depth 3
# Style definitions office命令行工具 获取 doc.docx /styles
# Specific style office命令行工具 获取 doc.docx "/styles/Heading1"
# Header/footer office命令行工具 获取 doc.docx "/header[1]" office命令行工具 获取 doc.docx "/footer[1]"
# Numbering definitions office命令行工具 获取 doc.docx /numbering
# JSON 输出 for scripting office命令行工具 获取 doc.docx "/body/p[1]" --json
CSS-like Queries # Find paragraphs by style office命令行工具 查询 doc.docx 'paragraph[style=Heading1]'
# Find paragraphs contAIning text office命令行工具 查询 doc.docx 'p:contAIns("quarterly")'
# Find empty paragraphs office命令行工具 查询 doc.docx 'p:empty'
# Find images without alt text office命令行工具 查询 doc.docx 'image:no-alt'
# Find bold 运行s in centered paragraphs office命令行工具 查询 doc.docx 'p[alignment=center] > r[bold=true]'
# Find large text office命令行工具 查询 doc.docx 'paragraph[size>=24pt]'
# Find fields by type office命令行工具 查询 doc.docx 'field[fieldType!=page]'
office命令行工具: v1.0.23 De签名 Principles
Professional documents need clear structure and consistent 格式化ting.
Document Structure
Every document needs clear hierarchy -- title, headings, subheadings, body text. Don't 创建 a wall of unstyled Normal paragraphs.
Typography
Choose a readable body font (Calibri, Cambria, Georgia, Times New Roman). Keep body at 11-12pt. Headings should step up: H1=16-18pt bold, H2=14pt bold, H3=12pt bold.
Spacing
Use paragraph spacing (spaceBefore/spaceAfter) instead of empty paragraphs. Line spacing of 1.15x-1.5x for body text.
Page 设置up
Always 设置 margins explicitly. US Letter default: pageWidth=12240, pageHeight=15840, margins=1440 (1 inch).
Headers & Footers
Professional documents include page numbers at minimum. Consider company name in header, page X of Y in footer.
Table De签名
Alternate row shading for readability. Header row with contrasting background. Consistent cell p添加ing.
Color Usage
Use color sparingly in documents -- accent color for headings or table headers, not rAInbow 格式化ting.
Content-to-Element M应用ing Content Type Recommended Element(s) Why Sequential items Bulleted 列出 (列出Style=bullet) 扫描ning is faster than inline commas Step-by-step process Numbered 列出 (列出Style=numbered) Numbers communicate order Comparative data Table with header row Columns enable side-by-side comparison Trend data Embedded 图表 (图表Type=line/column) Visual pattern recognition Key definition Hanging indent paragraph Off设置 term from definition Legal/contract clause Number