Tag: cobra

Automatic cobra command registration with fx

Cobra is a popular Go package for creating CLIs. It provides a lot of functionality for creating commands, subcommands, and flags. However, it can be tedious to manually register all of your commands. fx is a Go package that provides a dependency injection framework. It can be used to automatically register your application components, including…

By addshore September 9, 2023 3

cobra: unable to redefine ‘h’ shorthand

“Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files” I’m currently using Cobra in the MediaWiki CLI project and recently came across an error while trying to auto-generate docs. I’m not actually trying to redefine this flag, but it looks like by…

By addshore January 15, 2022 0