Plugin Development

Riptide can be extended with plugins. To write a plugin, create a Python package, that has the following entry point defined:

[riptide.plugin]
php-xdebug=riptide_plugin_php_xdebug.plugin:PhpXdebugPlugin

Replace php-xdebug with the identifier of your plugin and the rest with the entry point of your plugin, implementing AbstractPlugin (see below).

Plugin Interface

class riptide.plugin.abstract.AbstractPlugin[source]

Bases: abc.ABC

A Riptide plugin extends the functionality of Riptide.

For this it can:

  • Add new CLI commands to riptide-cli.
  • Set flags, which can be retrieved from the configuration using a variable helper
  • Directly read and modify all parts of the configuration entities loaded.
  • Communicate with the loaded engine.
after_load_cli(main_cli_object)[source]

Called after the last CLI of Riptide CLI has loaded. Can be used to add CLI commands using Click. The passed object is the main CLI command object.

after_load_engine(engine: riptide.engine.abstract.AbstractEngine)[source]

After the engine was loaded. engine is the interface of the configured engine.

after_reload_config(config: Config)[source]

Called whenever a project is loaded or if the initial configuration is loaded without a project.

get_flag_value(config: Config, flag_name: str) → any[source]

Return the value of a requested plugin flag. Return False if not defined. The current config is passed, to give a context about the calling project. Please note, that flag values are usually loaded before after_reload_config!