Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By jjchen17v0.2.0MIT
Drives a local WPS Office install from the terminal to fill Word templates, edit Excel sheets and charts, manage PowerPoint slides and export PDFs. Works through WPS's COM automation, so it needs Windows and WPS Office 2019+ installed.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
Of the plugin's README
Chinese
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
在终端里指挥 WPS Office 干活 — 真格式、真排版、76 条命令。
不是"所见即所猜",是所见即所得。 不模拟文件格式,直接驱动真实的 WPS 引擎。
Disclaimer / 免责声明:wps-cli 是社区维护的非官方项目,与金山办公(Kingsoft Office)没有任何隶属、授权或赞助关系。"WPS"、"WPS Office" 是其各自所有者的商标。本项目通过调用本地已安装的 WPS Office COM 自动化接口工作,不分发、不修改、不打包 WPS 二进制。
如果你用 python-docx 生成过带中文的 Word 文档,大概经历过这样的时刻:
这些库本质上是在解析和拼接 XML 文件格式,它们不知道"这个字体在 WPS 里实际渲染出来是什么样",自然就无法保证最终效果。
wps-cli 走了另一条路:不模拟文件格式,而是通过 COM 自动化直接驱动你电脑上正在运行的 WPS Office 本体。
你设置"黑体三号加粗",它就真的在 WPS 里执行一遍设置黑体三号加粗的操作。字体、间距、页码、目录、页眉页脚,每一个像素都和手动操作完全一致——因为本来就是同一个程序在干活。你调试时甚至可以盯着屏幕,看文档一步步"长出来"。
| 100% 格式保真 | 不是解析文件,是直接指挥 WPS 引擎干活 | 所见即所得,不是所见即所猜 |
| AI Agent 原生支持 | 所有命令支持 --json 输出,统一 schema | 天生适配 LLM Agent 和自动化流水线 |
| 一把梭四件套 | Writer / Calc / Impress / PDF,76 条命令 | 办公自动化一个工具全搞定 |
系统要求:Windows 10/11 · WPS Office 2019+ · Python 3.10+
pip install wps-cli
# 验证安装
wps doctor
国内网络环境推荐使用清华源加速:
pip install wps-cli -i https://pypi.tuna.tsinghua.edu.cn/simple
用三行命令,让 budget.xlsx 自动生成图表 + 提取数据 + 导出 PDF:
# Step 1: 一行命令,自动打开 Excel 插入柱状图
wps calc chart-create budget.xlsx --data "A1:C10" --type bar --title "2026年销售趋势"
# Step 2: 提取汇总数据,结构化 JSON 喂给下游脚本或 LLM
wps calc cell-get budget.xlsx C12 --json
# → {"success": true, "command": "calc.cell_get", "data": {"ref": "C12", "value": 285600}}
# Step 3: 一键导出 PDF,格式与 WPS 手动导出完全一致
wps export convert budget.xlsx pdf
三行命令,Excel 进去,图表 + 结构化数据 + PDF 出来 — 没有 GUI 点击,没有格式丢失。
wps
├── writer Word 文档
│ ├── new / info
│ ├── replace / count
│ ├── table-insert / table-get
│ ├── image-insert
│ ├── page-setup
│ ├── style-apply
│ ├── merge ★ 模板合并:{{key}} 占位符替换
│ ├── view ★ 语义视图:summary / issues / outline / annotated / stats
│ ├── validate ★ 文档验证:拼写/链接/字段完整性
│ ├── refresh ★ 刷新字段:TOC / PAGE / 交叉引用
│ ├── formfield-* ★ 表单域:list / get / set
│ ├── contentcontrol-* ★ 内容控件:list / set
│ ├── get ★ 路径定位:/section[1]/paragraph[3]
│ └── export-pdf
├── calc Excel 表格
│ ├── new / info
│ ├── sheet-list
│ ├── cell-get / cell-set / cell-range / cell-formula
│ ├── chart-create
│ ├── sort
│ ├── view ★ 语义视图:summary / issues / sheets
│ ├── validate ★ 文档验证
│ ├── refresh ★ 刷新公式 / 透视表
│ ├── conditional-format-* ★ 条件格式
│ ├── data-validation-* ★ 数据验证
│ ├── sparkline-add ★ 迷你图
│ ├── get ★ 路径定位:/sheet["Sheet1"]/cell["A1"]
│ └── export-csv
├── impress PPT 演示
│ ├── new / info
│ ├── slide-list / slide-add / slide-delete
│ ├── text-set / text-get / image-insert
│ ├── view ★ 语义视图:summary / issues / slides
│ ├── validate ★ 文档验证
│ ├── refresh ★ 刷新链接
│ ├── get ★ 路径定位:/slide[1]/shape[2]
│ └── export-pdf
├── pdf PDF 处理
│ ├── info
│ ├── merge / extract-pages / split
│ └── watermark
├── export 格式转换
│ ├── convert
│ └── batch
├── resident ★ 驻留模式:保持 COM 进程存活,加速连续操作
│ ├── start / stop / status / sessions
│ └── open / close
├── mcp ★ MCP 服务器:供 AI Agent 通过 JSON-RPC 调用
│ ├── serve / install / status
├── batch ★ 批量命令:JSON 数组批量执行
├── dump ★ 文档序列化:生成可重放 batch JSON
├── install ★ AI 工具集成:自动安装 SKILL.md 和 MCP 配置
│ ├── skill / mcp / all-tools
├── version 版本信息
└── doctor 环境诊断
| 全局选项 | 说明 |
|---|---|
--json / -j | 结构化 JSON 输出(适合 AI Agent / 管道) |
JSON 输出统一为:
{
"success": true,
"command": "calc.cell_get",
"data": { "...": "..." }
}
错误时:
{
"success": false,
"command": "calc.cell_set",
"error": {
"type": "ValidationError",
"message": "...",
"code": 50,
"suggestion": "...",
"context": { "...": "..." }
}
}
| 退出码 | 含义 |
|---|---|
| 0 | 成功 |
| 1 | 通用错误 |
| 10 | WPS 未安装或未检测到 |
| 11 | 会话管理错误 |
| 20 | 文件操作失败 |
| 21 | 文件不存在 |
| 30 | COM 调用失败 |
| 40 | 不支持的格式 |
| 50 | 参数校验失败 |
| 60 | 操作超时 |
| 61 | 批量操作部分失败 |
wps-cli 是一个标准的 Claude Code Skill — 安装后 Claude Code 可在你需要操作办公文档时自动加载全部 76 条命令的知识。
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: author: Invalid input: expected object, received string, skills: Invalid input
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Plugins from other owners that cover similar ground