Has IBM i’s F4 prompt energy. It’s great being able to hit F4 to turn any command into a form prompt with suggestions and context-sensitive help.
I wonder if you could make something that wraps arbitrary programs in a similar way as long as they have a standard-ish manpage.
I don’t think even mandoc has the semantic information needed. (I believe Apple tried in the 80s/90s w/ Commando on A/UX, but I think it needed precreated definitions.
How i does it is a command definition (example, example) that actually wraps the program. (It’ll even put the raw data types on argv. If you declare an int, you get an int in argv.) Calling a program raw is a separate thing from calling commands. There’s also panel groups to provide the documentation (example).
I think you would need a bit more than the usual man page, because you would need “types”. This is illustrated here: https://github.com/chriskiehl/Gooey#gooeyparser. Maybe you could envision a standard to describe program interface, something that would unify the argparse of every language and provide metadata about each argument (its type, is it optional, ….), but you’d likely end up in the xkcd://standards situation.
I think the way to do it would be to standardize an “–args-as-json” argument (or environment variable) that would just dump some description of the flags and arguments in a standardized format, either an existing one or a new one if none exist. You’d then need to get support for that into all the popular argparse-y libraries, but it’d be something you could implement separately at least, and you could even have ‘wrapper’ libraries like how Gooey can wrap argparse.
argparse has a “file” type that you could use to automatically notice that a file chooser is appropriate: https://docs.python.org/3/library/argparse.html#filetype-objects