While we're building Swagger/OpenAPI for CLIs, could we also please create typed/type-safe CLIs? I want to invoke command line tools like I invoke functions in my favorite programming language.
they are typed... I've yet to come across a cli that doesn't, at the very least pretend, like it's following posix. So all of it's parameters should be strings.
Saying that all parameters are strings isn't really saying much. In the same way one could say that any function is typed because each of its parameters is expected to be a byte string.
Even though CLI parameters are passed to the application as strings, in reality they are often expected to be (and converted to) numbers, enums, lists, file descriptors, … And don't forget that some parameters are optional and/or can be repeated.
In short, there is ample opportunity for proper type annotations.
Of course I've heard of man pages. But IDEs haven't. If I write a Bash script, or a Gitlab pipeline, or a Dockerfile, I get little to no feedback at all from my IDE whether I've misspelled a parameter, pass an incorrect value etc.
oh, that's not really type annotations; that's just... cli linting? no idea what to call it but something that will both highlight errors in commands before they fail, and suggest intelligent tab completes.
> oh, that's not really type annotations; that's just... cli linting?
I think it sort of is, depending on one's point of view. I mean, at the end of the day, a CLI encantation in a Bash script or Dockerfile is not really different from a function call in your Python/Java/whatever code, only that your interface is not an API but an ABI wrapped inside a POSIX CLI. So the CLI takes on the role of the function signature.
The only problem is that a CLI is typically a very soft and error-prone interface. It might forgive errors, it might be inconsistent etc. etc. This is certainly fine when you can iterate quickly on the command line. But for real programming? Not so much. For such purposes, proper (and properly typed) function signatures were invented. Whether or not you call matching/verifying function calls against function signatures type checking or linting is certainly up to you. :)
As for your project: Cool that you're working on this, and that you're using Zig! I'll visit again in a few months. :)