Skip to content

Contribute Plugins

Simon Schmid edited this page Feb 21, 2022 · 9 revisions

Contribute Plugins

You can read general information about contributing to bee in CONTRIBUTING.md

The best way to get started is to clone the bee sample plugin: https://github.com/sschmid/bee-sample

Conventions

  • Name your plugin something simple, e.g. sample.
  • Create a folder with your plugin name along with a bash file with your plugin name, e.g. plugins/sample/sample.bash
  • If your plugin has dependencies to other bee plugins you have to specify them in your plugins/sample/plugin.json
  • Every function that should be detected by the bee auto-completion must start with your plugin name followed by ::, e.g. sample::my_func()
  • Functions that don't start with the plugin prefix will not be detected but can be used as helper functions
  • It's strongly recommended to start your plugin with a help function with sections like 'template', 'secrets', 'usage' and 'requirements'
  • Variables should be all uppercase and start with the plugin name, e.g. SAMPLE_MESSAGE
  • If your plugin requires additional files, please create a resources folder and provide sample files

See existing plugins for reference:

To test your plugins you can edit Beefile and add a path to your plugin folder

BEE_PLUGINS_PATHS=plugins
BEE_PLUGINS=(sample)

Publish

Once you are ready to share your plugin create a new plugin.json (e.g. sample plugin.json) and create a pull request on the official beehub or your own beehub.

Once your plugin has been successfully submitted it is available and can be used in your Beefile or can be installed manually

bee install sample

Thanks for your contribution and happy coding :)