The base of an automation command — one nobody runs by hand: a deployment step, a scheduled run. It acts as the
automation actor and never asks; only an automation command may run a catalogue unit of work. Declare it with
AbstractCommand (a commands segment, no #[Act] — there is no person to check it against) and implement
handleCommand(...), which takes the run's SdkContext:
final class ImportCodelists extends AbstractAutomationCommand
{
protected $signature = 'codelists:import';
public function handleCommand(WorkUnitRunnerInterface $runner, SdkContext $sdk, ImportUnit $import): int
{
$runner->run($import, new BusinessContext(), $sdk);
return self::SUCCESS;
}
}