I’ve run through the source code and cannot find any kind of command line generation code.. I think it’s just for Unit Tests.
I really love this plugin (only started to look into it a few hours ago), but from what I can see, there are very few hooks to allow developers to integrate with it, and also doesn’t seem to be a nice/easy way to setup custom WP CLI commands for it.. That being said, if you wanted a CLI tool to generate the static site. Here’s a working (but crude) script:
class SimplyStaticGenerator
{
public function generate($args = [], $assoc_args = [])
{
$done = $this->perform('start');
while (!$done) {
$done = $this->perform('continue');
}
\WP_CLI::success('Done!');
}
protected function perform($action)
{
$archive_manager = new Simply_Static_Archive_Manager(new Simply_Static_Options(Simply_Static::SLUG));
$archive_manager->perform($action);
$state_name = $archive_manager->get_state_name();
$done = $archive_manager->has_finished();
\WP_CLI::success('In progress..');
return $done;
}
}
if (class_exists('WP_CLI')) {
\WP_CLI::add_command('simply-static', '\SimplyStaticGenerator');
}
I would backup before trying this out. I’ve probably missed something somewhere (as I say, only been looking at the plugin for a few hours, so I was “winging it” when I did this).