I‘ve seen it has been deprecated for many versions, but it still works and is an easy way. My current Mac won‘t run the latest macOS anyway. So for my current purpose, it does it‘s job well.
For a published tool, I‘ll learn more about launchd daemons.
Thanks for the C FILE structure hint, I‘ll try to find some description of that.
Background: I use multiple Wireguard connections. The Wireguard UI does allow only one at a time, the command line wg tools allow them at the same time. So I‘ve written my own mini UI parsing config files, calling wg show and wg-quick up (name).
I could run my executable using sudo or security, then I could use the simple execution of external tools, but prefer to keep ithe UI non-root, even if the tool is just for me.