API: How to invoke a cli command from a JS extension?

Hi,

So, I am trying to build a popclip extension which requires calling several cli commands. My logic works great in a js extension, but using exec or spawnSync does not work.

Any tips would be appreciated

Happy new year