Lesson 4. Creating Plugins#
Why you need this#
A plugin is an “add-on” for OpenClaw that adds new capabilities: tools, communication channels, commands. If the basic features aren’t enough, you can install a ready-made plugin or create your own. It’s like apps on your phone — basic features are there, but the App Store makes the phone truly useful.
What plugins can do#
Plugins can add:
- Tools for the assistant (e.g., voice calls)
- Communication channels (new messengers)
- CLI commands (new text commands)
- Background services (run continuously)
- Skills (instructions for the assistant)
- Auto-responses to slash commands (without calling AI)
Installing ready-made plugins#
View installed plugins#
openclaw plugins listInstall from npm#
openclaw plugins install @openclaw/voice-callEnable/disable#
openclaw plugins enable voice-call
openclaw plugins disable voice-callAfter changes, you need to restart Gateway:
openclaw gateway restartOfficial plugins#
| Plugin | What it does |
|---|---|
@openclaw/voice-call |
Voice calls via Twilio |
@openclaw/matrix |
Connection to Matrix |
@openclaw/msteams |
Microsoft Teams |
@openclaw/nostr |
Decentralized Nostr network |
@openclaw/zalouser |
Zalo messenger |
Plugin manifest#
Every plugin must have an openclaw.plugin.json file in its root folder. This is the plugin’s “passport” that describes what it is.
Minimal manifest:
{
"id": "my-plugin",
"configSchema": {
"type": "object",
"additionalProperties": false,
"properties": {}
}
}Extended version:
{
"id": "my-plugin",
"name": "My Plugin",
"description": "Adds useful features",
"version": "1.0.0",
"configSchema": {
"type": "object",
"additionalProperties": false,
"properties": {
"apiKey": { "type": "string" }
}
},
"uiHints": {
"apiKey": { "label": "API Key", "sensitive": true }
}
}Required fields:
id— unique plugin nameconfigSchema— JSON Schema for settings (even if there are no settings)
Optional fields:
name— display namedescription— brief descriptionkind— plugin type (e.g.,"memory")channels— which channels it registersskills— folders with skills
Simple plugin structure#
my-plugin/
├── openclaw.plugin.json ← manifest (required)
├── index.ts ← plugin code
└── package.json ← dependencies (if needed)Code example (index.ts)#
The simplest plugin — adds a command:
export default function(api) {
// Register a slash command
api.registerCommand({
name: "ping",
description: "Check that the plugin works",
handler: () => ({
text: "Pong! Plugin is working 🎉"
})
});
}Plugin with a tool for the assistant#
export default function(api) {
// Register an RPC method (remote call)
api.registerGatewayMethod("myplugin.weather", ({ respond }) => {
respond(true, { temperature: 22, city: "Moscow" });
});
}Plugin with a background service#
export default function(api) {
api.registerService({
id: "my-monitor",
start: () => api.logger.info("Monitoring started"),
stop: () => api.logger.info("Monitoring stopped")
});
}How to add a plugin to OpenClaw#
Option 1: Local plugin#
Place the files in the extensions folder:
~/.openclaw/extensions/my-plugin/
├── openclaw.plugin.json
└── index.tsOpenClaw will find it automatically.
Option 2: Through configuration#
{
plugins: {
enabled: true,
load: {
paths: ["~/Projects/my-plugin"]
},
entries: {
"my-plugin": {
enabled: true,
config: {
apiKey: "your-key"
}
}
}
}
}Option 3: Install from a file#
openclaw plugins install ./path/to/my-plugin
openclaw plugins install ./plugin.zipPlugin search order#
OpenClaw searches for plugins in this order (first found wins):
- Paths from
plugins.load.paths <workspace>/.openclaw/extensions/~/.openclaw/extensions/- Built-in extensions (disabled by default)
Plugin security#
⚠️ Plugins run inside Gateway — they have full access. Only install those you trust.
For restrictions, use lists:
{
plugins: {
allow: ["voice-call", "my-plugin"], // only these
deny: ["untrusted-plugin"] // these are forbidden
}
}Diagnostics#
openclaw plugins list # what's installed
openclaw plugins info my-plugin # plugin details
openclaw plugins doctor # check for errorsLesson summary#
- A plugin is a module that extends OpenClaw’s capabilities
- Every plugin must have a manifest
openclaw.plugin.json - Plugins can add commands, tools, channels, and background services
- Install via
openclaw plugins installor place in the extensions folder - Plugins run inside Gateway — only trust verified ones
- Use
openclaw plugins doctorto check for problems