Hacker News new | ask | show | jobs
by thanatos_dem 2654 days ago
Seems like Cobra is pretty well established in this space - https://github.com/spf13/cobra

Tho admittedly it works in reverse; it generates the doc/help info rather than parsing it into an AST. It addresses the “boilerplate” issue with code gen as well, but it has a CLI to generate code that’s pretty powerful.

For instance, how does docli handle subcommands? How about global vs command specific flags? For any case beyond the basic single command CLI, it seems like there would need to be all sorts of magic and non-obvious formatting requirements on the doc string.

2 comments

Hey thanatos_dem

Right now Docli can't handle those scenarios, but it will on the next big release - which it might take a while because it's not trivial to add those features and keep the API simple.

Hey! I've opened an issue to discuss about the subcommands feature: [url-redacted]

I would love to know your opinion about it.