Skip to content

🔌 Your first Plugin

Plugins are packages of Tools and Hooks. You don't distribute a Tool or a Hook directly, you will distribute a Plugin containing them. Don't worry, we'll explore what tools and hooks are in details in the upcoming steps. For now, let's start by creating an empty plugin.

Creating the Plugin

To create a plugin just create a new subfolder in directory plugins/, for our first plugin the folder name will be poetic_sock_seller.

You need two files in your plugin folder:

cheshire-cat-ai
├── compose.yml
├── data
├── plugins
│   └── poetic_sock_seller
│       ├── plugin.json
│       └── poetic_sock_seller.py
└── static

The plugin.json file contains plugin's title and description, and is useful in the Admin Portal to recognize the plugin and activate/deactivate it.

plugin.json example:

{
    "name": "Poetic Sock Seller",
    "description": "Description of poetic_sock_seller"
}

The poetic_sock_seller.py file will contain Tools and Hooks source code and can be left completely empty for this step.

Activating the Plugin

Now, go to the Plugin tab of the Admin Portal. Your empty plugin will be there, activate it:

Alt text

More Info

Here the plugins reference: Plugins

If you plan to publish your plugin, also take a look at this Plugins → Registry

Next Step

In the next step, you will learn how to create your first Tool inside the plugin.