用途:通过命令行(COM 自动化)操控 WPS Office,覆盖 WPS 文字(Writer)、表格(Calc)、演示(Impress),适合脚本化文档生成与 AI Agent 调用。
主要能力:文档管理(new/open/save/info);Writer 支持 add-paragraph、add-heading、add-list、add-table、add-page-break、add-image、set-text、find-replace 等;Calc 支持 add-sheet、set-cell、get-cell、set-range、merge-cells 等;Impress 支持 add-slide、set-content、add-element 等;另有 style、preset、export、session(status/undo/redo/history)命令。内置 4 套设计预设、14 种布局模板、4 种演讲类型预设与 5 维度质量审查。
使用方式:前置条件为 Windows、WPS Office 12.0+、Python 3.10+、pywin32(pip install pywin32)。安装:pip install -e .;验证:cli-anything-wps --help。命令均支持 --json;用 --project 加载项目后链式执行;也可进入 REPL 模式。示例:cli-anything-wps document new --type writer --name "报告" -o report.json;cli-anything-wps --project report.json writer add-heading -t "年度报告" -l 1;cli-anything-wps --project report.json export render report.docx -p docx。
适用场景:批量生成文档、表格与幻灯片,Agent 自动化办公,导出 docx/pdf/xlsx/pptx 等格式。
限制:仅支持 Windows,依赖已安装的 WPS Office 与 COM 接口;其他平台或版本要求以外的细节、收费与价格信息暂未提供。