npub1rgxxqsjmxcnaj3esq28dvwx3zuqsm3u6d0726mvvvg74d0e8gl7svh6y88 (npub1rgx…6y88) Have you seen the sh library? It has basically the API you described, and let's you run any command that way. It's still shelling out, but it's useful until the underlying program implements a proper API.
https://sh.readthedocs.io