npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wpsam

v2.0.4

Published

WPS Office JS Addon Controller - A CLI tool for managing WPS Office JS plugins via publish.xml

Readme

wpsam

wpsam, WPS Office 客户端加载项(插件)管理器。

WPS Office JS 插件管理工具 - 通过 publish.xml 管理 WPS Office JS 插件。

关于加载项名称

使用 wpsam 安装 WPS Office 客户端加载项时,加载项名称不影响实际加载项本身,你可以使用任何名称。

wpsam 的冲突检测规则为:仅当名称和类型都相同时才会提示冲突。如果确实存在同名同类型加载项需要同时安装,可以自行更改名称来完成安装。

安装

npm install -g wpsam

功能特性

  • 添加、删除、更新和列出 WPS Office JS 插件
  • 单个或批量启用/禁用插件
  • 删除操作前自动备份
  • 跨平台支持(Windows、macOS、Linux)
  • 启用/禁用命令支持交互式选择
  • MCP(Model Context Protocol)服务器支持,可用于 AI 集成

MCP 服务器

wpsam 可作为 MCP 服务器使用,支持与 Claude、Cursor 等支持 Model Context Protocol 的 AI 助手集成。

启动 MCP 服务器

npm run mcp
# 或
node lib/mcp-server.js

可用 MCP 工具

| 工具 | 描述 | |------|-------------| | install_plugin | 安装(添加)新插件到 publish.xml | | delete_plugin | 从 publish.xml 删除插件 | | update_plugin | 更新 publish.xml 中的插件 | | list_plugins | 列出 publish.xml 中的所有插件 | | enable_plugin | 启用 publish.xml 中的插件 | | disable_plugin | 禁用 publish.xml 中的插件 | | enable_all_plugins | 启用 publish.xml 中的所有插件 | | disable_all_plugins | 禁用 publish.xml 中的所有插件 | | delete_all_plugins | 删除 publish.xml 中的所有插件 | | create_publish_xml | 创建新的 publish.xml 文件 | | server_request | 向 WPS 服务器发送 HTTP 请求 |

Claude Desktop 配置

添加到 claude_desktop_config.json

{
  "mcpServers": {
    "wpsam": {
      "command": "node",
      "args": ["/path/to/wpsam/lib/mcp-server.js"]
    }
  }
}

或使用 npx:

{
  "mcpServers": {
    "wpsam": {
      "command": "npx",
      "args": ["-y", "wpsam"]
    }
  }
}

MCP 使用示例

MCP 服务器运行后,你可以使用自然语言管理 WPS 插件:

  • "安装一个名为 my-plugin,URL 为 http://localhost:3000/ 的插件"
  • "列出所有插件"
  • "启用 vue-demo 插件"
  • "删除 test-plugin"

使用方法

wpsam [命令] [选项]

命令

  • install: 添加新插件到 publish.xml,支持参数:--name, --type, --url, --debug, --enable, --install, --enable-dev,缺失参数默认值为 null。还支持 --json 选项传入 JSON 字符串格式的插件信息。冲突规则:仅当名称和类型都相同时才会视为冲突,如果只名称相同但类型不同可以正常安装。如果发生冲突,请使用 update 指令更新,或修改名称后重新安装。
  • delete: 从 publish.xml 删除插件,--name(必需),可选参数:--type
  • update: 更新 publish.xml 中的插件,--name(必需),可选参数:--type, --url, --debug, --enable, --install, --enable-dev。未声明的参数保持不变。
  • list: 列出 publish.xml 中的所有插件,格式化输出。
  • enable: 启用 publish.xml 中的插件,--name(必需),可选参数:--type。
  • disable: 禁用 publish.xml 中的插件,--name(必需),可选参数:--type。
  • enable-all: 启用 publish.xml 中的所有插件。
  • disable-all: 禁用 publish.xml 中的所有插件。
  • delete-all: 删除 publish.xml 中的所有插件。
  • server: 向服务器发送 HTTP 请求并显示结果,支持 --url, --https。默认 HTTP: http://127.0.0.1:58890/version,默认 HTTPS: https://127.0.0.1:58891/version。
  • create: 创建新的 publish.xml 文件,支持 --path(默认值为 publish.xml)。

type(插件类型)

  • et: 插件类型,默认值为 表格
  • wps: 插件类型,默认值为 文字
  • wpp: 插件类型,默认值为 演示

publish.xml 结构

CLI 管理的 publish.xml 文件结构如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jsplugins>
  <jspluginonline name="vue-demo" type="et" url="http://127.0.0.1:3889/" debug="" enable="enable_dev" install="null"/>
</jsplugins>

平台特定路径

CLI 会自动检测平台并使用正确的 publish.xml 路径:

  • Windows: %APPDATA%/kingsoft/wps/jsaddons/publish.xml
  • macOS: ~/Library/Containers/com.kingsoft.wpsoffice.mac/Data/.kingsoft/wps/jsaddons/publish.xml
  • Linux: ~/.local/share/Kingsoft/wps/jsaddons/publish.xml

如果没有这些路径,可能是 WPS 未安装,或 publish.xml 不存在,可通过 create 命令创建。

如果你的 WPS 安装路径非默认,可以手动指定 publish.xml 路径,使用 --path 选项。当然,你也可以联系我将你的 WPS 安装路径添加到平台特定路径中。

备份

deletedelete-all 命令在执行删除操作前会自动创建 publish.xml 的备份,备份文件名带有时间戳:

publish.xml.backup.2026-02-15T12-40-02

这样可以在需要时恢复原始文件。

示例

创建新的 publish.xml 文件

wpsam create --path publish.xml

安装新插件

# 使用独立选项
wpsam install --name vue-demo --type et --url http://127.0.0.1:3889/ --enable enable_dev

# 使用 JSON 字符串
wpsam install --json '{"name":"example","type":"wps","url":"http://example.com/","debug":null,"install":null,"enable":null}'

列出所有插件

wpsam list

更新插件

wpsam update --name vue-demo --url http://new-url.com

启用指定插件

wpsam enable --name vue-demo

禁用指定插件

wpsam disable --name vue-demo

启用所有插件

wpsam enable-all

禁用所有插件

wpsam disable-all

删除指定插件

wpsam delete --name vue-demo

删除所有插件

wpsam delete-all

发送 HTTP 请求到服务器

# 默认 HTTP(端口 58890)
wpsam server

# 默认 HTTPS(端口 58891)
wpsam server --https

# 自定义 URL
wpsam server --url http://example.com/api/version

# 自定义 HTTPS URL
wpsam server --url https://example.com/api/version