Lifecycle - frankischilling/crust GitHub Wiki
Lifecycle
Plugin load order:
- Crust scans the plugin directory.
- Each direct child directory is treated as a plugin candidate.
- Crust reads
info.json. - Crust creates a Lua VM for that plugin.
- Crust registers the
c2.*host API. - Crust runs the entry script, usually
init.lua. - The plugin registers commands, callbacks, and delayed work during init.
Manifest fields:
namedescriptionauthorshomepagetagsversionlicensepermissionsentry
Notes:
entrydefaults toinit.lua.permissionsare metadata only for now.- Plugins reload as a whole directory, not file-by-file.
- Use
plugin_data_dir()for writable state.
Directory layout:
plugins/
└── example_plugin/
├── info.json
├── init.lua
├── helper.lua
└── data/
Lua module loading:
package.pathis extended sorequire("helper")can loadhelper.lua.require("nested/module")can loadnested/module.luaornested/module/init.lua.
Reloading:
- Use
/reloadplugins. - Crust also exposes a reload button in Settings.