Building Plugins
plugin은 OpenClaw에 새로운 capability를 추가합니다: channel, model provider, speech, image generation, web search, agent tool, 또는 그 조합입니다. plugin을 OpenClaw 저장소에 직접 추가할 필요는 없습니다. ClawHub 또는 npm에 publish하면 사용자는openclaw plugins install <package-name>으로 설치할 수 있습니다. OpenClaw는 먼저 ClawHub를 확인하고, 없으면 npm으로 fallback합니다.
필요 조건
- Node >= 22 및 package manager(npm 또는 pnpm)
- TypeScript(ESM) 기본 이해
- 저장소 내부 plugin이라면 repository clone +
pnpm install
어떤 종류의 plugin인가
Channel plugin
OpenClaw를 새로운 메시징 플랫폼(Discord, IRC 등)에 연결
Provider plugin
새로운 모델 provider(LLM, proxy, custom endpoint) 추가
Tool / hook plugin
agent tool, event hook, service 등록
빠른 시작: tool plugin
최소 plugin 하나를 만들어 agent tool을 등록하는 예시입니다.패키지와 manifest 만들기
Plugin capability
하나의 plugin은api 객체를 통해 여러 capability를 등록할 수 있습니다:
| Capability | Registration method | Detailed guide |
|---|---|---|
| Text inference (LLM) | api.registerProvider(...) | Provider Plugins |
| Channel / messaging | api.registerChannel(...) | Channel Plugins |
| Speech (TTS/STT) | api.registerSpeechProvider(...) | Provider Plugins |
| Media understanding | api.registerMediaUnderstandingProvider(...) | Provider Plugins |
| Image generation | api.registerImageGenerationProvider(...) | Provider Plugins |
| Web search | api.registerWebSearchProvider(...) | Provider Plugins |
| Agent tools | api.registerTool(...) | 아래 설명 |
| Event hooks | api.registerHook(...) | Entry Points |
| HTTP routes | api.registerHttpRoute(...) | Internals |
| CLI subcommands | api.registerCli(...) | Entry Points |
Agent tool 등록
tool은 LLM이 호출할 수 있는 typed function입니다. 항상 사용 가능한 필수 tool도 있고, 사용자가 allowlist로 켜야 하는 optional tool도 있습니다.Import 규칙
항상openclaw/plugin-sdk/<subpath>의 좁은 경로에서 import하세요:
api.ts, runtime-api.ts)로 정리하고, 자기 plugin을 SDK 경로로 다시 import하지 마세요.
제출 전 체크리스트
package.json에 올바른 openclaw metadata가 있는가openclaw.plugin.json manifest가 유효한가entry point가
defineChannelPluginEntry 또는 definePluginEntry를 쓰는가import가 모두
plugin-sdk/<subpath>를 쓰는가테스트가 통과하는가