外掛程式
外掛程式透過新功能擴充 OpenClaw:頻道、模型提供者、工具、技能、語音、圖像生成等。部分外掛程式為核心(隨 OpenClaw 附帶),其他則為外部(由社群發布於 npm)。
See what is loaded
Terminal window openclaw plugins list安裝外掛程式
Terminal window # From npmopenclaw plugins install @openclaw/voice-call# From a local directory or archiveopenclaw plugins install ./my-pluginopenclaw plugins install ./my-plugin.tgz重新啟動閘道
Terminal window openclaw gateway restart然後在設定檔中的 `plugins.entries.\
.config` 下進行設定。
如果您偏好聊天原生的控制方式,請啟用 commands.plugins: true 並使用:
/plugin install clawhub:@openclaw/voice-call/plugin show voice-call/plugin enable voice-call安裝路徑使用與 CLI 相同的解析器:本機路徑/封存、明確的 clawhub:<pkg>,或純套件規格(優先 ClawHub,其次為 npm 後備)。
外掛程式類型
Section titled “外掛程式類型”OpenClaw 可識別兩種外掛程式格式:
| 格式 | 運作方式 | 範例 |
|---|---|---|
| 原生 | openclaw.plugin.json + 執行時間模組;於進程內執行 | 官方外掛程式、社群 npm 套件 |
| 套件組合 | Codex/Claude/Cursor 相容的佈局;對應至 OpenClaw 功能 | .codex-plugin/、.claude-plugin/、.cursor-plugin/ |
兩者都顯示在 openclaw plugins list 下。有關套件的詳細資訊,請參閱 Plugin Bundles。
如果您正在編寫原生插件,請從 Building Plugins 和 Plugin SDK Overview 開始。
官方外掛程式
Section titled “官方外掛程式”| 外掛程式 | 套件 | 文件 |
|---|---|---|
| Matrix | @openclaw/matrix | Matrix |
| Microsoft Teams | @openclaw/msteams | Microsoft Teams |
| Nostr | @openclaw/nostr | Nostr |
| Voice Call | @openclaw/voice-call | Voice Call |
| Zalo | @openclaw/zalo | Zalo |
| Zalo 個人版 | @openclaw/zalouser | Zalo Personal |
核心 (隨 OpenClaw 附帶)
Section titled “核心 (隨 OpenClaw 附帶)”Model providers (enabled by default)
anthropic, byteplus, cloudflare-ai-gateway, github-copilot, google,
huggingface, kilocode, kimi-coding, minimax, mistral, modelstudio,
moonshot, nvidia, openai, opencode, opencode-go, openrouter,
qianfan, synthetic, together, venice,
vercel-ai-gateway, volcengine, xiaomi, zai
記憶體外掛
memory-core— 內建記憶體搜尋(預設透過plugins.slots.memory) -memory-lancedb— 按需安裝的長期記憶體,具備自動回憶/捕獲功能(設定plugins.slots.memory = "memory-lancedb")
語音提供商(預設啟用)
elevenlabs, microsoft
Other
browser— 瀏覽器工具的內建瀏覽器插件、openclaw browserCLI、browser.request網關方法、瀏覽器執行時和預設瀏覽器控制服務(預設啟用;更換前請先停用)copilot-proxy— VS Code Copilot Proxy 橋接器(預設停用)
尋找第三方插件?請參閱 Community Plugins。
{ plugins: { enabled: true, allow: ["voice-call"], deny: ["untrusted-plugin"], load: { paths: ["~/Projects/oss/voice-call-extension"] }, entries: { "voice-call": { enabled: true, config: { provider: "twilio" } }, }, },}| 欄位 | 說明 |
|---|---|
enabled | 主切換開關(預設:true) |
allow | 外掛程式允許清單 (選用) |
deny | 外掛程式拒絕清單 (選用;拒絕優先) |
load.paths | 額外的外掛程式檔案/目錄 |
slots | 專屬插槽選擇器(例如 memory、contextEngine) |
entries.\<id\> | 各外掛程式開關 + 設定 |
設定變更需要重新啟動閘道。如果 Gateway 在啟用設定監看 + 程序內重新啟動(預設的 openclaw gateway 路徑)的情況下運行,該重新啟動通常會在設定寫入完成後自動執行。
Plugin states: disabled vs missing vs invalid
Disabled
:外掛程式存在但啟用規則將其關閉。設定會被保留。 -
Missing
:設定參照了一個探索未找到的外掛程式 ID。 -
Invalid
:外掛程式存在,但其設定不符合宣告的結構描述。
探索與優先順序
Section titled “探索與優先順序”OpenClaw 會依照以下順序掃描外掛程式(符合者優先):
Config paths
plugins.load.paths— 明確的檔案或目錄路徑。Workspace extensions
`\
/.openclaw/
/*.ts
和\/.openclaw/
/*/index.ts`。
Global extensions
`~/.openclaw/
/*.ts
和~/.openclaw//*/index.ts`。
內建外掛程式
隨 OpenClaw 附帶。許多外掛程式預設為啟用(模型提供者、語音)。 其他則需要明確啟用。
plugins.enabled: false停用所有外掛plugins.deny優先於 allowplugins.entries.\<id\>.enabled: false停用該外掛- 來自工作區的外掛程式預設為已停用(必須明確啟用)
- 內建外掛程式遵循內建的預設啟用集合,除非被覆寫
- 獨佔插槽可以強制啟用該插槽的選取外掛程式
外掛程式插槽(獨佔類別)
Section titled “外掛程式插槽(獨佔類別)”某些類別是獨佔的(一次只能有一個啟用):
{ plugins: { slots: { memory: "memory-core", // or "none" to disable contextEngine: "legacy", // or a plugin id }, },}| 插槽 | 控制內容 | 預設值 |
|---|---|---|
memory | 啟用的記憶體外掛程式 | memory-core |
contextEngine | 啟用的情境引擎 | legacy (內建) |
CLI 參考資料
Section titled “CLI 參考資料”openclaw plugins list # compact inventoryopenclaw plugins inspect <id> # deep detailopenclaw plugins inspect <id> --json # machine-readableopenclaw plugins status # operational summaryopenclaw plugins doctor # diagnostics
openclaw plugins install <package> # install (ClawHub first, then npm)openclaw plugins install clawhub:<pkg> # install from ClawHub onlyopenclaw plugins install <path> # install from local pathopenclaw plugins install -l <path> # link (no copy) for devopenclaw plugins install <spec> --dangerously-force-unsafe-installopenclaw plugins update <id> # update one pluginopenclaw plugins update --all # update all
openclaw plugins enable <id>openclaw plugins disable <id>--dangerously-force-unsafe-install 是針對內建危險代碼掃描器誤報的緊急覆蓋選項。它允許安裝繼續進行,忽略內建的 critical 發現結果,但仍不會繞過插件 before_install 策略封鎖或掃描失敗封鎖。
此 CLI 標誌僅適用於插件安裝。由 Gateway 支援的技能相依性安裝則改用相符的 dangerouslyForceUnsafeInstall 請求覆蓋選項,而 openclaw skills install 則仍是獨立的 ClawHub 技能下載/安裝流程。
有關完整詳情,請參閱 openclaw plugins CLI reference。
Plugin API 概覽
Section titled “Plugin API 概覽”插件會匯出一個函式或一個具有 register(api) 的物件:
export default definePluginEntry({ id: "my-plugin", name: "My Plugin", register(api) { api.registerProvider({ /* ... */ }); api.registerTool({ /* ... */ }); api.registerChannel({ /* ... */ }); },});常見註冊方法:
| 方法 | 註冊內容 |
|---|---|
registerProvider | 模型提供者 (LLM) |
registerChannel | 聊天頻道 |
registerTool | 代理工具 |
registerHook / on(...) | 生命週期鉤子 |
registerSpeechProvider | 文字轉語音 / STT |
registerMediaUnderstandingProvider | 影像/音訊分析 |
registerImageGenerationProvider | 影像生成 |
registerWebSearchProvider | 網路搜尋 |
registerHttpRoute | HTTP 端點 |
registerCommand / registerCli | CLI 指令 |
registerContextEngine | 脈絡引擎 |
registerService | 背景服務 |
型別化生命週期掛鉤的掛鉤守衛行為:
before_tool_call:{ block: true }為終止狀態;將跳過較低優先級的處理程式。before_tool_call:{ block: false }為無操作,並不會清除先前的阻擋。before_install:{ block: true }為終止狀態;將跳過較低優先級的處理程式。before_install:{ block: false }為無操作,並不會清除先前的阻擋。message_sending:{ cancel: true }為終止狀態;將跳過較低優先級的處理程式。message_sending:{ cancel: false }為無操作,並不會清除先前的取消。
如需完整的型別化掛鉤行為,請參閱 SDK 概觀。