返回顶部
o

officecli-docxOffice文档处理

Use this skill any time a .docx file is involved -- as input, output, or both. This includes: creating Word documents, reports, letters, memos, or proposals; reading, parsing, or extracting text from any .docx file; editing, modifying, or updating existing documents; working with templates, tracked changes, comments, headers/footers, or tables of contents. Trigger whenever the user mentions 'Word doc', 'document', 'report', 'letter', 'memo', or references a .docx filename.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.2
安全检测
已通过
134
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

officecli-docx

officecli: v1.0.23

OfficeCLI DOCX 技能

开始之前(关键)

每次使用 officecli 之前,请运行此检查:

bash
if ! command -v officecli &> /dev/null; then
echo 正在安装 officecli...
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.sh -o /tmp/officecliinstall.sh && bash /tmp/officecliinstall.sh && rm -f /tmp/officecli_install.sh
# Windows: irm https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.ps1 -OutFile $env:TEMP\officecliinstall.ps1; & $env:TEMP\officecliinstall.ps1
else
CURRENT=$(officecli --version 2>&1 | grep -oE [0-9]+\.[0-9]+\.[0-9]+ | head -1)
LATEST=$(curl -fsSL https://api.github.com/repos/iOfficeAI/OfficeCLI/releases/latest | grep tag_name | sed -E s/.v?([0-9.]+)./\1/)
if [ $CURRENT != $LATEST ]; then
echo 正在升级 officecli $CURRENT → $LATEST...
curl -fsSL https://raw.githubusercontent.com/iOfficeAI/OfficeCli/main/install.sh -o /tmp/officecliinstall.sh && bash /tmp/officecliinstall.sh && rm -f /tmp/officecli_install.sh
else
echo officecli $CURRENT 已是最新版本
fi
fi
officecli --version



officecli: v1.0.23

快速参考

任务操作
读取/分析内容使用下面的 view 和 get 命令
编辑现有文档
阅读 editing.md | | 从头创建 | 阅读 creating.md |

officecli: v1.0.23

读取与分析

文本提取

bash
officecli view doc.docx text
officecli view doc.docx text --max-lines 200
officecli view doc.docx text --start 1 --end 50

text 模式显示 [/body/p[N]] 文本内容,表格显示为 [Table: N rows],公式显示为可读的数学表达式。对于大型文档,使用 --max-lines 或 --start/--end 以避免转储全部内容。

结构概览

bash
officecli view doc.docx outline

输出显示文件统计信息(段落数、表格、图片、公式)、水印存在情况、页眉/页脚以及标题层级树。

详细检查

bash
officecli view doc.docx annotated

显示每个运行(run)的样式、字体、大小、粗体/斜体;公式显示为 LaTeX;图片显示替代文本。空段落显示为 [] <-- empty paragraph。

统计信息

bash
officecli view doc.docx stats

段落数、样式分布、字体使用情况、字号使用情况、空段落数。

元素检查

bash

文档根节点(元数据、页面设置)


officecli get doc.docx /

列出深度为1的 body 子元素

officecli get doc.docx /body --depth 1

特定段落

officecli get doc.docx /body/p[1]

特定运行

officecli get doc.docx /body/p[1]/r[1]

表格结构

officecli get doc.docx /body/tbl[1] --depth 3

样式定义

officecli get doc.docx /styles

特定样式

officecli get doc.docx /styles/Heading1

页眉/页脚

officecli get doc.docx /header[1] officecli get doc.docx /footer[1]

编号定义

officecli get doc.docx /numbering

用于脚本的 JSON 输出

officecli get doc.docx /body/p[1] --json

CSS 风格查询

bash

按样式查找段落


officecli query doc.docx paragraph[style=Heading1]

查找包含文本的段落

officecli query doc.docx p:contains(quarterly)

查找空段落

officecli query doc.docx p:empty

查找没有替代文本的图片

officecli query doc.docx image:no-alt

查找居中段落中的粗体运行

officecli query doc.docx p[alignment=center] > r[bold=true]

查找大号文本

officecli query doc.docx paragraph[size>=24pt]

按类型查找域

officecli query doc.docx field[fieldType!=page]

officecli: v1.0.23

设计原则

专业文档需要清晰的结构和一致的格式。

文档结构

每个文档都需要清晰的层级——标题、一级标题、二级标题、正文。不要创建一堵未设置样式的普通段落墙。

排版

选择可读性强的正文字体(Calibri、Cambria、Georgia、Times New Roman)。正文保持 11-12pt。标题应逐步增大:H1=16-18pt 粗体,H2=14pt 粗体,H3=12pt 粗体。

间距

使用段落间距(spaceBefore/spaceAfter)而不是空段落。正文行距为 1.15x-1.5x。

页面设置

始终显式设置页边距。美国信纸默认值:pageWidth=12240,pageHeight=15840,页边距=1440(1 英寸)。

页眉与页脚

专业文档至少包含页码。考虑在页眉中添加公司名称,在页脚中添加第 X 页,共 Y 页。

表格设计

交替行底纹以提高可读性。标题行使用对比背景色。一致的单元格内边距。

颜色使用

在文档中谨慎使用颜色——用于标题或表格表头的强调色,而不是彩虹格式。

内容到元素映射

内容类型推荐元素原因
顺序项目项目符号列表(listStyle=bullet)扫描比内联逗号更快
分步过程
编号列表(listStyle=numbered) | 数字传达顺序 | | 比较数据 | 带标题行的表格 | 列支持并排比较 | | 趋势数据 | 嵌入式图表(chartType=line/column) | 视觉模式识别 | | 关键定义 | 悬挂缩进段落 | 将术语与定义分开 | | 法律/合同条款 | 带书签的编号列表 | 通过书签进行交叉引用 | | 数学内容 | 公式元素(formula=LaTeX) | 正确的 OMML 渲染 | | 引用/参考文献 | 脚注或尾注 | 保持正文整洁 | | 引文/标注 | 带边框和底纹的段落 | 与正文视觉区分 | | 多节布局 | 带分栏的分节符 | 每节独立控制分栏 |

officecli: v1.0.23

质量保证(必需)

假设存在问题。你的任务是找到它们。

问题检测

bash

自动检查格式、内容和结构问题


officecli view doc.docx issues

按问题类型筛选

officecli view doc.docx issues --type format officecli view doc.docx issues --type content officecli view doc.docx issues --type structure

内容质量保证

bash

提取所有文本,检查缺失内容、拼写错误、顺序错误


officecli view doc.docx text

检查结构

officecli view doc.docx outline

检查空段落(常见杂乱内容)

officecli query doc.docx p:empty

检查没有替代文本的图片

officecli query doc.docx image:no-alt

编辑模板时,检查残留的占位符文本:

bash
officecli query doc.docx p:contains(lorem)
officecli query doc.docx p:contains(xxxx)
officecli query doc.docx p:contains(placeholder)

验证

bash
officecli validate doc.docx

交付前检查清单

  • - [ ] 元数据已设置(标题、作者)
  • [ ] 页码已存在(页眉或页脚中的域)
  • [ ] 标题层级正确(没有跳级,例如 H1 -> H3)
  • [ ] 没有使用空段落作为间距(改用 spaceBefore/spaceAfter)
  • [ ] 所有图片都有替代文本
  • [ ] 表格有标题行
  • [ ] 如果文档有 3 个以上标题,则存在目录
  • [ ]

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 officecli-docx-1775935022 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 officecli-docx-1775935022 技能

通过命令行安装

skillhub install officecli-docx-1775935022

下载

⬇ 下载 officecli-docx v1.0.2(免费)

文件大小: 20.57 KB | 发布时间: 2026-4-12 10:45

v1.0.2 最新 2026-4-12 10:45
- Added two new guide files: creating.md and editing.md
- Quick reference table now links to detailed guides for creating and editing documents
- No changes to commands or core functionality—documentation improvement only

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部