Help, documentation, and support
Part of creating a CLI that empathizes with its users is to supply sufficient help and documentation, as well as support users of all kinds. Luckily, the Cobra CLI framework supports the generation of help from the short and long fields of the Cobra command and the generation of man pages as well. However, bringing empathy into the extended documentation of your CLI may require several techniques.
Generating help text
By now, there have been many examples of creating commands, but just to reiterate, the command structure and the fields that show up in help are fields within the Cobra commands. Let’s go over a good example:
var playCmd = &cobra.Command{ Use: "play", Short: "Play audio file by id", Long: `Play audio file by id using the default audio player for your current system`, ...