Hey everyone, I have a question that has been bugging me for some time now and have yet to find a satisfactory answer. Hopefully, someone can shed some light here:
I see that in many REST apps, for example, people are using the cobra library. I’m a bit confuzzled by this since in essence that’s a CLI library and in my mind, there’s no connection between CLI and a backend HTTP service for instance. For instance, in Java, I haven’t seen a similar pattern. What am I missing here? Why the need for the CLI?
Command line interfaces to web services are easy to automate/script. I’m not sure if it’s specific to Go; I don’t see it as much with C#, but there are plenty of Python scripts that do the same.
I misunderstood your initial post. I missed the word “backend” and I thought you were asking about creating client REST apps with command line interfaces. Now I’m not sure what you mean about there being no connection between the CLI and a backend HTTP service because for *nix, I think it’s extremely common to write services as command line interfaces. If not as a command line application, how would you run a web application server? With a GUI?