Comment

Comment by thanatos_dem

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.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton