claw-plugin-init
v0.1.9
Published
Scaffold OpenClaw Plugin projects with one command
Downloads
445
Maintainers
Readme
claw-plugin-init
Scaffold OpenClaw plugin projects with one command.
npx claw-plugin-init my-pluginThen follow the prompts — you'll have a working plugin in seconds.
Usage
Interactive
# npm
npx claw-plugin-init my-plugin
# pnpm
pnpm create claw-plugin-init
# yarn
yarn create claw-plugin-initNon-interactive (CLI flags)
npx claw-plugin-init my-plugin --type tool-plugin --no-installSkip all prompts
npx claw-plugin-init my-plugin --yesScaffold in current directory
npx claw-plugin-init . --forcePreview only (dry run)
npx claw-plugin-init my-plugin --dry-runCLI Options
| Flag | Description |
|------|-------------|
| --type, -t | Plugin type: tool-plugin (default), channel-plugin, provider-plugin, mcp-server |
| --force, -f | Overwrite existing directory |
| --yes, -y | Skip all prompts, accept defaults |
| --no-install | Skip dependency installation |
| --git / --no-git | Initialize (or skip) a Git repository |
| --dry-run | Preview actions without executing |
| --help, -h | Show help |
Prompts
| Prompt | Description | Default |
|--------|-------------|---------|
| Plugin type | Select plugin type | tool-plugin |
| Project name | npm package name | interactive |
| Display name | Human-readable name | package name |
| Description | Short description of your plugin | An OpenClaw plugin |
Templates
| Template | Status |
|----------|--------|
| tool-plugin | ✅ Available |
| channel-plugin | ✅ Available |
| provider-plugin | ✅ Available |
| mcp-server | ✅ Available |
What You Get
Tool Plugin
Register a tool callable by AI.
my-plugin/
├── src/
│ └── index.ts # Plugin entry point (register tools)
├── openclaw.plugin.json # Plugin manifest
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
└── README.md # Plugin docsChannel Plugin
Connect a messaging platform such as Discord, Telegram, or WeChat.
my-channel/
├── src/
│ └── index.ts # Channel plugin entry point
├── openclaw.plugin.json # Plugin manifest
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
└── README.md # Plugin docsProvider Plugin
Integrate a model provider with API-key authentication and a starter model catalog.
my-provider/
├── src/
│ └── index.ts # Provider definition and model catalog
├── openclaw.plugin.json # Provider setup and auth manifest
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
└── README.md # Provider configuration guideThe generated environment variable is portable across shells. For a project named my-provider, it is:
export MY_PROVIDER_API_KEY=your-api-keyBefore publishing, update the generated baseUrl, protocol adapter, and model catalog in src/index.ts.
MCP Server
Create a standalone MCP protocol service.
my-server/
├── src/
│ └── index.ts # MCP server entry point (stdio transport)
├── openclaw.plugin.json # Plugin manifest
├── package.json # Dependencies & scripts
├── tsconfig.json # TypeScript config
└── README.md # Server docsAfter Scaffolding
cd my-plugin
npm install # Installed automatically unless --no-install is used
npm run lint # Type-check the generated project
npm run build # Build the generated projectThen depending on your plugin type:
Tool plugin — register or publish it:
openclaw plugins install ./dist # or clawhub package publishChannel plugin — register the channel:
openclaw plugins install ./dist # Then configure the channel via openclaw configProvider plugin — configure credentials and register it:
export MY_PROVIDER_API_KEY=your-api-key openclaw plugins install ./distMCP server — start the server on stdio:
npm startThen connect an MCP client by pointing it to the generated server entry point.
Compatibility
- Node.js 22+
- npm, pnpm, or yarn
- The scaffold targets the current OpenClaw and plugin SDK versions available from npm.
- When registry lookup is unavailable, a tested fallback version is used.
- If an older local OpenClaw CLI is detected, the command prints an upgrade warning.
License
MIT
