For such common things like activating the same operation as a UI panel does via an cmd line argument instead I don't need to know anythink about those backends etc. here. The infrastructure is already there for either platform.
The overall handling is the following, just look and think about what happens underneath any Affinity panel (like open or save a file etc.) when you use and/or fill out the coresponding fields and settings (toggles etc.) of any dialog here. Some toggles, buttons, fields, controls etc. will return a bool state or give some numeric or string value back here when pressing a Ok button, those values all in turn are then used as arguments for a certain function/method call which performs the associated operation(s). And now think about passing over some CLI arguments here instead of using an UI panel for performing those same function/method calls.
Focus Stacking isn't currently possible in Affinity Photo. It's been requested before so hopefully this is something that will be added in the future :)