@@ -142,6 +142,49 @@ Example configuration:
142
142
```
143
143
3 . Add the template using ` clixor template --add `
144
144
145
+ ### Creating Plugins
146
+
147
+ Clixor supports a plugin system that allows you to extend its functionality. Here's how to create a
148
+ plugin:
149
+
150
+ 1 . Create a new TypeScript file in the ` src/plugins ` directory.
151
+ 2 . Import the ` PluginInterface ` from ` src/plugins/types/index.ts ` .
152
+ 3 . Create a class that implements the ` PluginInterface ` .
153
+ 4 . Implement the required methods:
154
+ - ` name ` : A string identifier for your plugin.
155
+ - ` version ` : The version of your plugin.
156
+ - ` initialize ` : A method called when the plugin is registered.
157
+ - ` execute ` : The main functionality of your plugin.
158
+
159
+ Example plugin:
160
+
161
+ ``` typescript
162
+ import { PluginInterface } from ' ../types' ;
163
+ export class MyCustomPlugin implements PluginInterface {
164
+ name = ' MyCustomPlugin' ;
165
+ version = ' 1.0.0' ;
166
+ initialize(): void {
167
+ console .log (' MyCustomPlugin initialized' );
168
+ }
169
+ async execute(context : any ): Promise <string > {
170
+ return MyCustomPlugin executed with context : $ {JSON.stringify(context)};
171
+ }
172
+ }
173
+ ```
174
+
175
+ To use your plugin, register it in the ` src/utils/plugins.ts ` file:
176
+
177
+ ``` typescript
178
+ import { MyCustomPlugin } from ' ../plugins/MyCustomPlugin' ;
179
+ // In the loadPlugins function
180
+ const myCustomPlugin = new MyCustomPlugin ();
181
+ myCustomPlugin .initialize ();
182
+ // Add logic to use the plugin as needed
183
+ ```
184
+
185
+ Plugins allow you to add new commands, modify existing functionality, or integrate with external
186
+ services to enhance Clixor's capabilities.
187
+
145
188
## 🤝 Contributing
146
189
147
190
We love our contributors! ❤️ Check out the [ CONTRIBUTORS.md] ( CONTRIBUTORS.md ) file to see the
0 commit comments