This poc tries to demonstrate how "easy" can be exposing CLI tools via HTTP API. The example isn't perfect. It doesn't provide a REST API but it just allow to quickly prototype tooling that can be accessible both via CLI or HTTP.
This is a do not do this at home, however it can be used as starting point for interesting approaches.
I decided to do this insane proof of concept in order to (in)validate the idea of exposing cobra commands via HTTP as a quick prototyping framework. Once built, you just need to create commands and the api will expose them. Even though it could be fast for prototyping, this is not the ideal solution as it's super tricky.