From wps-cli
CLI for automating WPS Office documents (Word, Excel, PPT, PDF) via COM with format fidelity, template filling, batch conversion, and environment diagnostics.
How this skill is triggered — by the user, by Claude, or both
Slash command
/wps-cli:wps-cliThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
在终端里指挥 WPS Office 干活 — **真格式、真排版**。不模拟文件格式,直接驱动真实的 WPS 引擎。
在终端里指挥 WPS Office 干活 — 真格式、真排版。不模拟文件格式,直接驱动真实的 WPS 引擎。
用户请求操作办公文档?
├── Word (.docx/.doc/.wps) → writer 子命令
│ ├── 查看/诊断 → writer view <file> [summary|issues|outline|annotated|stats]
│ ├── 模板填充 → writer merge template.docx --data '{...}'
│ ├── 查找替换 → writer replace <file> <old> <new>
│ ├── 表格操作 → writer table-get / table-insert
│ ├── 路径定位 → writer get <file> "<path>"
│ ├── 表单域/控件 → writer formfield-* / contentcontrol-*
│ └── 文档验证 → writer validate <file>
├── Excel (.xlsx/.xls/.csv) → calc 子命令
│ ├── 查看/诊断 → calc view <file> [summary|issues|sheets]
│ ├── 单元格读写 → calc cell-get / cell-set / cell-range
│ ├── 公式设置 → calc cell-formula
│ ├── 图表创建 → calc chart-create
│ ├── 条件格式 → calc conditional-format-*
│ ├── 数据验证 → calc data-validation-*
│ ├── 迷你图 → calc sparkline-add
│ └── 排序 → calc sort
├── PPT (.pptx/.ppt) → impress 子命令
│ ├── 查看/诊断 → impress view <file> [summary|issues|slides]
│ ├── 幻灯片管理 → impress slide-list / slide-add / slide-delete
│ ├── 文本/图片 → impress text-get / text-set / image-insert
│ └── 导出 → impress export-pdf
├── PDF (.pdf) → pdf 子命令
│ ├── 合并/拆分 → pdf merge / split / extract-pages
│ ├── 水印 → pdf watermark
│ └── 信息 → pdf info
├── 格式转换 → export 子命令
│ ├── 单文件 → export convert <file> <format>
│ └── 批量 → export batch "*.docx" -t pdf
├── 批量执行 → batch 子命令
│ └── JSON数组 → wps batch -c '[...]'
└── 环境诊断 → wps doctor / version
CLI 层 (typer) → Service 层 (业务逻辑) → COM Backend (win32com) → WPS Office 桌面应用
管理 WPS 进程生命周期(启动/关闭/复用),线程安全(RLock),UUID 会话 ID。
统一 1-based 路径,支持三种风格:
/section[1]/paragraph[3] # Word:第1节第3段
/sheet["Sheet1"]/cell["C12"] # Excel:Sheet1 的 C12
$Sheet1:A1 # Excel 风格简写
/slide[1]/shape[2] # PPT:第1张第2个形状
.doc/.docx/.wps/.rtf/.txt/.html;calc 仅接受 .xls/.xlsx/.xlsm/.et/.csv;impress 仅接受 .ppt/.pptx/.pps/.dps。calc cell-formula 禁止 SHELL/DDE/HYPERLINK/WEBSERVICE 等危险函数。--json / -j 输出机器可读 JSON;--help 查看帮助。遇到问题时按此顺序排查:
wps doctor — 环境诊断(Python/pywin32/WPS 版本/COM 注册表)wps doctor --fix — 自动修复 COM 注册问题(需管理员权限)wps doctor --report — 生成脱敏报告粘贴到 GitHub Issuewps writer|calc|impress validate <file> — 文档级验证以下参考文档按需加载,避免占用上下文窗口:
npx claudepluginhub jjchen17/wps-cliRoutes Office document and image tasks (PPTX, DOCX, XLSX, report, IMG) through the OfficeCLI tool for creation, modification, and format conversion.
Create, edit, analyze office documents (PDF, DOCX, PPTX, XLSX): extract text/tables, merge/split, fill forms, data analysis using pdfplumber, pypdf, pandas, openpyxl.
Creates and automates office documents, spreadsheets, and presentations, with format conversion support for LibreOffice and Microsoft Office formats.