feat: support git plugin installs

This commit is contained in:
Peter Steinberger
2026-05-01 10:56:44 +01:00
parent 6e3fd67084
commit 7ddf28c0d4
30 changed files with 1188 additions and 74 deletions

View File

@@ -253,6 +253,47 @@ Users enable optional tools in config:
- Use `optional: true` for tools with side effects or extra binary requirements
- Users can enable all tools from a plugin by adding the plugin id to `tools.allow`
## Registering CLI commands
Plugins can add root `openclaw` command groups with `api.registerCli`. Provide
`descriptors` for every top-level command root so OpenClaw can show and route
the command without eagerly loading every plugin runtime.
```typescript
register(api) {
api.registerCli(
({ program }) => {
const demo = program
.command("demo-plugin")
.description("Run demo plugin commands");
demo
.command("ping")
.description("Check that the plugin CLI is executable")
.action(() => {
console.log("demo-plugin:pong");
});
},
{
descriptors: [
{
name: "demo-plugin",
description: "Run demo plugin commands",
hasSubcommands: true,
},
],
},
);
}
```
After install, verify the runtime registration and execute the command:
```bash
openclaw plugins inspect demo-plugin --runtime --json
openclaw demo-plugin ping
```
## Import conventions
Always import from focused `openclaw/plugin-sdk/<subpath>` paths: