← Back to Plugins
Tools

Plugin Registry

BelphegorPrime By BelphegorPrime 👁 61 views ▲ 0 votes

OpenClaw Plugin Template mit Installationsanleitung

GitHub

Install

openclaw plugins install /path/to/plugin-dir

Configuration Example

const plugins = {
  helloWorld: require('./plugins/helloWorld'),
  myPlugin: require('./plugins/myPlugin')  // Add your plugin here
};

README

# OpenClaw Plugin Registry ๐ŸฆŠ

A central repository for developing and organizing multiple OpenClaw plugins.

[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![OpenClaw](https://img.shields.io/badge/OpenClaw-Plugin%20Registry-orange)](https://openclaw.ai)

## ๐Ÿ“ฆ Repository Structure

This repository is designed to hold multiple plugins in a single place:

```
openclaw-plugin-registry/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.js               # Main entry point - exports all plugins
โ”‚   โ””โ”€โ”€ plugins/               # Plugin directory
โ”‚       โ”œโ”€โ”€ helloWorld.js      # Example plugin 1
โ”‚       โ””โ”€โ”€ git-servers/       # Git Server Management Plugins
โ”‚           โ”œโ”€โ”€ forgejoConfig.js
โ”‚           โ”œโ”€โ”€ gitlabConfig.js
โ”‚           โ””โ”€โ”€ giteaConfig.js
โ”œโ”€โ”€ tests/                     # Plugin tests
โ”‚   โ””โ”€โ”€ forgejoConfig.test.js
โ”œโ”€โ”€ LICENSE                    # Apache 2.0 License
โ”œโ”€โ”€ README.md                  # This file
โ”œโ”€โ”€ CHANGELOG.md               # Version history
โ””โ”€โ”€ .gitignore                 # Git exclusions
```

## ๐Ÿš€ Quick Start

### 1. Clone the Repository

```bash
git clone https://github.com/BelphegorPrime/openclaw-plugin-registry.git
cd openclaw-plugin-registry
```

### 2. Add Your Plugin

Create a new plugin file in `src/plugins/` or a category subfolder. See the `forgejoConfig.js` for a real-world example.

### 3. Export Your Plugin

Add your plugin to `src/index.js`:

```javascript
const plugins = {
  helloWorld: require('./plugins/helloWorld'),
  myPlugin: require('./plugins/myPlugin')  // Add your plugin here
};
```

## ๐Ÿ”ง Installing Plugins in OpenClaw

### Local Development Installation
For fast iteration during development, copy the plugin file directly:
```bash
cp src/plugins/myPlugin.js ~/.openclaw/plugins/
```

### Official Package Installation
Create a `package.json` in the plugin directory and install via:
```bash
openclaw plugins install /path/to/plugin-dir --force
```

## ๐Ÿ› ๏ธ Special Case: Git Server Plugins Setup

The `git-servers` plugins require a Personal Access Token (PAT) to communicate with the respective instances.

### Token Configuration
For security, the plugins read the token from a protected local file instead of storing it in the main config:

- **Forgejo:** `~/.openclaw/config/.forgejo_token`
- **GitLab:** `~/.openclaw/config/.gitlab_token`
- **Gitea:** `~/.openclaw/config/.gitea_token`

Example:
```bash
echo "YOUR_TOKEN_HERE" > ~/.openclaw/config/.forgejo_token
chmod 600 ~/.openclaw/config/.forgejo_token
```

### Configuring the Instance
Once the token is in place, configure the server URL:
```javascript
// Using the plugin in OpenClaw
forgejo.configureInstance({
  url: 'https://git.szb.marcel.codes',
  name: 'default'
});
```

## ๐Ÿ“‹ Plugin Architecture

Every plugin should follow this structure:
- **`setup()`**: Initialize the plugin.
- **`getMetadata()`**: Return name, version, and description.
- **Core Logic**: Export functions for the specific task.

## ๐Ÿงช Testing

Run tests from the root directory:
```bash
node tests/test-forgejo.js
```

## ๐Ÿ› Troubleshooting

### "Plugin not found"
- Ensure the plugin path is correct
- Check that the plugin file exists
- Verify file permissions

### "Plugin cannot be loaded"
- Check syntax in the plugin file
- Ensure `module.exports` is correct
- Check OpenClaw logs for errors

## ๐Ÿ“š Additional Resources

- [OpenClaw Documentation](https://docs.openclaw.ai)
- [ClawHub](https://clawhub.ai) - Plugin Marketplace
- [OpenClaw GitHub](https://github.com/openclaw/openclaw)

## ๐Ÿค Contributing

Contributions are welcome! Please:
1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Write/update tests
5. Update documentation
6. Commit and push
7. Open a Pull Request

## ๐Ÿ“„ License

Apache 2.0 - See [LICENSE](LICENSE) file for details.

---

**Built with โค๏ธ for the OpenClaw Community**
tools

Comments

Sign in to leave a comment

Loading comments...