Konubinix' opinionated web of thoughts

Clk Plugins

Fleeting

clk plugins

In case you don’t like some of the internals of clk, you may change whatever you like with plugins.

In contrast with clk customcommands that are loaded only when called, plugin are loaded every time clk is run.

Create a plugin with the following command:

clk plugin create global myplugin

Your editor is then opened to edit the plugin code, with a default template.

You can put your code wherever you want, but we recommend you put it in the load_plugin function. clk might in the future decide in which order to call those functions.

For instance, write the following:

def load_plugin():
  "Put here the entrypoint of the plugin."
  print("loaded")

And all your clk invocation will have an annoying loaded string written.

To be honest, we don’t use the plugins. We kind of like the default behavior and change it if need be, but the mechanism is there, just in case.

Remove the plugin with:

clk plugin remove global myplugin

Notes linking here