Phase 5 / Ep 27: Plugin 发布与生命周期管理

⏱ 预计阅读 3 分钟 更新于 2026/4/13

🎯 学习目标:发布 Plugin 并管理完整生命周期。

1. 发布到 ClawHub

cd ~/.openclaw/plugins/notion-sync
npx clawhub publish --type plugin

2. 更新策略

热更新(推荐)

不需要重启 Gateway,Plugin 自动检测并加载新版本:

openclaw plugins update notion-sync

冷重启

需要重启 Gateway:

openclaw plugins install [email protected]
openclaw gateway restart

3. 生命周期

stateDiagram-v2
    [*] --> Developing: 开发
    Developing --> Testing: 本地测试
    Testing --> Published: 发布到 ClawHub
    Published --> Active: 用户安装
    Active --> Updated: 发布新版本
    Updated --> Active: 用户更新
    Active --> Deprecated: 标记废弃
    Deprecated --> Archived: 6 个月后归档
    Archived --> [*]

4. 版本管理

版本类型 格式 影响
Patch 1.0.x Bug 修复,自动更新
Minor 1.x.0 新功能,通知更新
Major x.0.0 破坏性变更,手动更新

5. 废弃和迁移

# 标记 Plugin 为废弃
npx clawhub deprecate notion-sync --message "请迁移到 notion-sync-v2"

# 提供迁移指南
npx clawhub deprecate notion-sync --alternative notion-sync-v2

下节预告: Phase 6 开始!Ep 28,Telegram 深度集成——从 BotFather 到生产级机器人的完整旅程。