4.19 plugins命令

openclaw plugins 命令用于管理在 Gateway 进程内运行的插件和扩展。

概述

此命令用于管理 Gateway 插件和扩展,这些插件和扩展在进程内运行。通过该命令,您可以安装、启用、禁用和更新各种插件。

可用命令

命令 说明
list 显示所有插件
info 查看插件详情
enable 启用插件
disable 禁用插件
doctor 诊断插件问题
update 升级插件(单个或全部)
install 从路径或包规范添加新插件

安装详情

可以通过以下方式安装插件:

openclaw plugins install <path-or-spec>

支持的归档格式

  • ZIP
  • TAR
  • TAR.GZ
  • TGZ

开发者链接模式

--link 标志允许开发者引用本地目录而无需复制文件:

# 链接本地插件目录(开发模式)
openclaw plugins install -l ./my-plugin

依赖项与安全性

  • 每个插件需要一个 openclaw.plugin.json 清单文件
  • 清单必须在 configSchema 字段中包含有效的 JSON Schema(可以为空)
  • 无效或缺失的清单会阻止插件加载
  • 安装被视为代码执行 - 建议使用固定版本
  • 内置插件默认禁用,需要显式激活
安全提示
插件安装等同于代码执行。为确保安全,建议使用固定版本(pinned versions)而非最新版本。

更新机制

--dry-run 标志允许在不实际应用更改的情况下测试更新。更新仅适用于在配置中跟踪的 npm 安装的插件。

# 预览更新(不实际执行)
openclaw plugins update --dry-run

# 更新所有插件
openclaw plugins update

# 更新特定插件
openclaw plugins update <plugin-name>

使用示例

列出所有插件

openclaw plugins list

启用插件

openclaw plugins enable <plugin-name>

诊断插件问题

openclaw plugins doctor
提示
更多详情请参考 官方英文文档