File contents WPS Office Skill
简介
WPS Office 自动化操作 Skill,支持本地文档操作和 WPS 365 云端协作功能。
⚠️ 安全警告
本地自动化风险
GUI 自动化 :本 Skill 使用 pyautogui 进行键盘输入模拟,可能会与当前活动窗口交互
文件操作 :Skill 会创建、打开和修改文件,请确保在受信任的环境中使用
权限要求 :macOS 需要授予辅助功能权限才能使用自动化功能
云端凭证安全
凭证存储 :WPS 365 功能需要配置 app_id 和 app_secret,建议:
不要在公共设备或共享环境中配置
定期更换凭证
使用环境变量而非明文配置文件(即将支持)
API 调用 :所有 WPS 365 API 调用使用 HTTPS 加密传输
建议
首次使用建议在沙盒环境或虚拟机中测试
审查 scripts/main.py 源码确认功能符合预期
如不需要 WPS 365 功能,可留空 app_id 和 app_secret
功能特性
本地文档操作(无需凭证)
📄 创建文档 - 创建 Word、Excel、PPT 文档
📂 打开文档 - 打开已有文档
📋 文档列表 - 列出文档目录中的文件
🔄 格式转换 - 支持 MD 转 Word/RTF/HTML
📦 批量处理 - 批量转换文档格式
WPS 365 云端功能(需要凭证)
📊 智能表单 - 表单创建、数据收集
📄 智能文档 - 在线协作文档
📊 多维表格 - 视图管理、字段管理、高级查询
📊 流程图 - 流程图创建和导出
🧠 思维导图 - 思维导图创建和导出
安装
1. 安装依赖
pip install requests pyautogui pyperclip Pillow
2. 配置 Skill
编辑 config.json:
{
"default_save_path": "~/Documents/WPS",
"wps_path": "",
"app_id": "",
"app_secret": ""
}
3. 获取 WPS 开放平台凭证(可选)
仅在使用 WPS 365 功能时需要:
访问 https://open.wps.cn
注册开发者账号
创建应用获取 App ID 和 App Secret
将凭证填入 config.json
使用方法
本地文档操作
# 创建 Word 文档
python scripts/main.py create type=writer filename=报告.docx
# Markdown 转 Word
python scripts/main.py convert file=文档.md format=docx
# 批量转换
python scripts/main.py batch_convert dir=~/Documents format=pdf
WPS 365 云端功能
# 智能表单
python scripts/main.py form_list
# 智能文档
python scripts/main.py doc_list
# 多维表格
python scripts/main.py sheet_list
python scripts/main.py sheet_views sheet_id=sheet_001
# 流程图
python scripts/main.py flow_list
# 思维导图
python scripts/main.py mind_list
API 实现说明
本地功能实现
使用 subprocess 调用 WPS Office 应用程序
使用 pyautogui 模拟键盘输入(创建带内容的文档)
文件格式转换使用本地 WPS 引擎或 Python 库
WPS 365 云端功能实现
使用 WPS 开放平台 REST API
OAuth 2.0 认证流程
所有 API 调用使用 HTTPS 加密
支持自动 token 刷新
API 端点
认证: POST /auth/v1/token
表单: /forms/v1/*
文档: /docs/v1/*
表格: /sheets/v1/*
流程图: /flows/v1/*
思维导图: /minds/v1/*
故障排除
本地功能问题
WPS 无法打开 :检查 WPS 是否已安装
自动化无响应 :检查 macOS 辅助功能权限
格式转换失败 :确保文件格式受支持
WPS 365 功能问题
API 调用失败 :检查 app_id 和 app_secret 是否正确
网络超时 :检查网络连接,API 服务器是否可访问
权限不足 :检查应用是否有足够的 API 权限
版本信息
1 --- 2 name: wps-office-2 3 description: WPS Office Skill 4 --- 5 # WPS Office Skill 6 7 ## 简介 8 9 WPS Office 自动化操作 Skill,支持本地文档操作和 WPS 365 云端协作功能。 10 11 ## ⚠️ 安全警告 12 13 ### 本地自动化风险 14 - **GUI 自动化**:本 Skill 使用 `pyautogui` 进行键盘输入模拟,可能会与当前活动窗口交互 15 - **文件操作**:Skill 会创建、打开和修改文件,请确保在受信任的环境中使用 16 - **权限要求**:macOS 需要授予辅助功能权限才能使用自动化功能 17 18 ### 云端凭证安全 19 - **凭证存储**:WPS 365 功能需要配置 `app_id` 和 `app_secret`,建议: 20 - 不要在公共设备或共享环境中配置 21 - 定期更换凭证 22 - 使用环境变量而非明文配置文件(即将支持) 23 - **API 调用**:所有 WPS 365 API 调用使用 HTTPS 加密传输 24 25 ### 建议 26 - 首次使用建议在沙盒环境或虚拟机中测试 27 - 审查 `scripts/main.py` 源码确认功能符合预期 28 - 如不需要 WPS 365 功能,可留空 `app_id` 和 `app_secret` 29 30 ## 功能特性 31 32 ### 本地文档操作(无需凭证) 33 - 📄 **创建文档** - 创建 Word、Excel、PPT 文档 34 - 📂 **打开文档** - 打开已有文档 35 - 📋 **文档列表** - 列出文档目录中的文件 36 - 🔄 **格式转换** - 支持 MD 转 Word/RTF/HTML 37 - 📦 **批量处理** - 批量转换文档格式 38 39 ### WPS 365 云端功能(需要凭证) 40 - 📊 **智能表单** - 表单创建、数据收集 41 - 📄 **智能文档** - 在线协作文档 42 - 📊 **多维表格** - 视图管理、字段管理、高级查询 43 - 📊 **流程图** - 流程图创建和导出 44 - 🧠 **思维导图** - 思维导图创建和导出 45 46 ## 安装 47 48 ### 1. 安装依赖 49 50 ```bash 51 pip install requests pyautogui pyperclip Pillow 52 ``` 53 54 ### 2. 配置 Skill 55 56 编辑 `config.json`: 57 58 ```json 59 { 60 "default_save_path": "~/Documents/WPS", 61 "wps_path": "", 62 "app_id": "", 63 "app_secret": "" 64 } 65 ``` 66 67 ### 3. 获取 WPS 开放平台凭证(可选) 68 69 仅在使用 WPS 365 功能时需要: 70 71 1. 访问 https://open.wps.cn 72 2. 注册开发者账号 73 3. 创建应用获取 App ID 和 App Secret 74 4. 将凭证填入 config.json 75 76 ## 使用方法 77 78 ### 本地文档操作 79 80 ```bash 81 # 创建 Word 文档 82 python scripts/main.py create type=writer filename=报告.docx 83 84 # Markdown 转 Word 85 python scripts/main.py convert file=文档.md format=docx 86 87 # 批量转换 88 python scripts/main.py batch_convert dir=~/Documents format=pdf 89 ``` 90 91 ### WPS 365 云端功能 92 93 ```bash 94 # 智能表单 95 python scripts/main.py form_list 96 97 # 智能文档 98 python scripts/main.py doc_list 99 100 # 多维表格 101 python scripts/main.py sheet_list 102 python scripts/main.py sheet_views sheet_id=sheet_001 103 104 # 流程图 105 python scripts/main.py flow_list 106 107 # 思维导图 108 python scripts/main.py mind_list 109 ``` 110 111 ## API 实现说明 112 113 ### 本地功能实现 114 - 使用 `subprocess` 调用 WPS Office 应用程序 115 - 使用 `pyautogui` 模拟键盘输入(创建带内容的文档) 116 - 文件格式转换使用本地 WPS 引擎或 Python 库 117 118 ### WPS 365 云端功能实现 119 - 使用 WPS 开放平台 REST API 120 - OAuth 2.0 认证流程 121 - 所有 API 调用使用 HTTPS 加密 122 - 支持自动 token 刷新 123 124 ### API 端点 125 - 认证: `POST /auth/v1/token` 126 - 表单: `/forms/v1/*` 127 - 文档: `/docs/v1/*` 128 - 表格: `/sheets/v1/*` 129 - 流程图: `/flows/v1/*` 130 - 思维导图: `/minds/v1/*` 131 132 ## 故障排除 133 134 ### 本地功能问题 135 - **WPS 无法打开**:检查 WPS 是否已安装 136 - **自动化无响应**:检查 macOS 辅助功能权限 137 - **格式转换失败**:确保文件格式受支持 138 139 ### WPS 365 功能问题 140 - **API 调用失败**:检查 app_id 和 app_secret 是否正确 141 - **网络超时**:检查网络连接,API 服务器是否可访问 142 - **权限不足**:检查应用是否有足够的 API 权限 143 144 ## 版本信息 145 146 - **版本**: 1.0.0 147 - **作者**: MaxStorm Team 148 - **许可证**: MIT 149 - **源码**: https://github.com/maxstorm/wps-skill
johnalbertini14-glitch/openclaw-skills/tree/main/skills/lilei0311/wps-office commit 75ea61a7de
Frequently asked questions How do I install the Wps Office skill? Run npx skillmds@latest add johnalbertini14-glitch/wps-office-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Wps Office skill do? WPS Office Skill It is listed under Coding & Dev Tools on SkillMD.
Is Wps Office safe to use? This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. Capability flags: executes scripts, makes network calls, reads secrets. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Wps Office? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Wps Office free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Wps Office? johnalbertini14-glitch (@johnalbertini14-glitch) published this skill. Their other Agent Skills are listed on their SkillMD profile.