5 ms·
In the case where the CLI is just using endpoints defined by a single OpenAPI spec, it could be helpful to generate code for the CLI with some minor configurati
by digitalsanctum 4y ago
In the case where the CLI is just using endpoints defined by a single OpenAPI spec, it could be helpful to generate code for the CLI with some minor configuration and/or mapping of commands and args to OpenAPI spec endpoints.
More broadly, an enterprise might define how CLIs are created including handling of authentication through such a specification.
- hayst4ck 4y agoIt sounds like what you are talking about is a very specific problem for a very specific use case and therefore packaging some piece of software around OpenAPI/whatever ingests its specs is closer to what you think would make the world a better place? cli_from_spec.py seems like a sane program to write. Google ended up using gflags which automatically adds command line arguments to a program as a side effect of code being imported. In this way, using the same library as someone else automatically creates some consistent command line behavior. My take is gflags not only creates side effects but abuses global scope and therefore encourages bad architecture.