Janitor plugin installation

I try to install the Janitor plugin to get the command-button “janitor:render” in the panel to generate all thumbs. But I can’t figure out how to get it to work. I did the following:

– I copied the folders “cli” and “kirby3-janitor” to site/plugins
– I copied the following as a field to blueprints/site.yml

janitor_render:
  type: janitor
  command: 'janitor:render'
  label: Render pages to create missing thumb jobs

– I created the folder site/commands and put the file render.php from kirby3-janitor/commands into it

The button “Render pages to create missing thumb jobs” appers in the panel but when I hit it I get the error message “Class “Kirby\CLI\CLI” not found” – what am I doing wrong ?
Thanks allready for any tipps !

hi @pandorrrrrra,

thanks for trying my plugin.

i think the main problem is that the official CLI is distributed as a plugin (not being core) and my janitor plugins command rely on classes from that plugin. it really depends of when what classes are loaded to make it work. when using installation from zip its by sorting order of plugin folder name. it might just not work with zip installation cli + janitor and site/commands.
i will try to find time and test solutions but in the meantime…

to be quiet honest i usually use composer to install plugins which takes care of registering all classes beforehand and thus avoids issues like the one you describe.

edited: CLI is not a plugin.

also the janitor plugin registers all commands starting with janitor: like the janitor:render so you dont have to copy that. i will add a note to the readme to make that behaviour more explicit.

i see you needed to copy the command since the registering commands by plugin was only released today. Release 1.1.0 · getkirby/cli · GitHub

i had been using the dev branch and totally forgot about that. :sweat_smile:

also the cli is NOT a plugin. my installation instructions are totally wrong. you need to use composer to install the cli. there is no other way.

sorry about that confusion.