Running pcbnew headless?

I’m trying to write some Github actions to support building and releasing with Cadquery, but I need to export a 3D model of the PCB first. I’ve seen some hacky things done with XVFB and xdotool but I only need pcbnew STEP export functionality? Is there a less janky reliable way to get pcbnew to do that one thing… preferably headlessly?

Or should I just go through the X server route and feed in keyboard shortcuts?

Thanks

I haven’t found anything, so I’ll likely be using KiAuto instead.

Actually some people on the KiCad Discord have recommended KiBot to me.

It works perfectly.