SuperAPI AI 工具集

wps-airpage

办公与效率

查看项目

更新于 10-16 06:20

技能介绍

用途:通过本地 CLI 操作 WPS 365 AirPage / 智能文档 / kdocs 在线文档,适合需要修改、检查、搜索或创建 AirPage 文档的场景,如加段落、改标题、加评论、传图、查块结构、找块 ID、转换 Markdown/HTML、编辑表格。不适用于本地 .docx/.xlsx、WPS 桌面排障、Notion/Google Docs 或与 AirPage 无关的浏览器自动化。

主要能力:auth 检查与刷新凭据;search 搜索文档返回数字 file_id;new-doc 新建文档并返回 file_id 与 doc_url;query 查询根节点或指定块;insert-markdown 插入 Markdown;outline 查看目录;update 更新块;insert 精细插入;upload-image 上传图片;comments / comment-add 管理评论。

使用方式:先 node scripts/cli.js auth 检查凭据;凭据缺失或过期(>8h)时自动刷新。再确认 file_id:可接受数字 ID、短链(365.kdocs.cn/l/xxx)或文档链接(365.kdocs.cn/office/o/xxx),CLI 自动解析;按关键词搜索用 search <keyword>,无目标时询问搜索或新建。然后执行操作,最后用 query 回读验证,评论变更用 comments 复查。常用命令:node scripts/cli.js auth;node scripts/cli.js search <keyword>;node scripts/cli.js new-doc --name <名称>;node scripts/cli.js insert-markdown <file_id> --content text|@file [--pos begin|end];node scripts/cli.js query <file_id> [block_id]。

限制:insert --index 必须 >=1;update --body 必须是数组,单对象报错 -152;inline 文本字段用 content 而非 text;rangeMarkBegin/rangeMarkEnd 非真实块,计算 index 时需跳过,更新含评论块时需保留;comment-update 必须同时传 comment_id 与 selection_id;insert-markdown --pos 仅支持 begin/end;outline 对新建文档有索引延迟,验证内容用 query 过滤 heading 块。凭据存于 ~/.claude/secrets/wps365.json(0600),wps_sid 为 HttpOnly,CSRF token 仅在编辑页 window.WPSENV.csrf_token 可用。