Golang CLI command tree library using spf13/cobra — cobra.Command, RunE vs Run, PersistentPreRunE hook chain, Args validators (NoArgs, ExactArgs, MatchAll, custom), persistent vs local flags, command groups, ValidArgsFunction, RegisterFlagCompletionFunc, ShellCompDirective, usage/help template customization, man-page and markdown doc generation, and testing with SetArgs/SetOut/SetErr.
Install
npx skills add samber/cc-skills-golang --skill golang-spf13-cobranpx skills add samber/cc-skills-golang --skill golang-spf13-cobra -a claude-code -gnpx skills add samber/cc-skills-golang --skill golang-spf13-cobra -a codex -ggemini skills install https://github.com/samber/cc-skills-golang.git --path skills/golang-spf13-cobragh skill install samber/cc-skills-golang golang-spf13-cobragit clone --depth 1 https://github.com/samber/cc-skills-golang /tmp/samber__cc-skills-golang
mkdir -p ~/.claude/skills ~/.agents/skills
cp -R /tmp/samber__cc-skills-golang/skills/golang-spf13-cobra ~/.claude/skills/golang-spf13-cobra # Claude Code
cp -R /tmp/samber__cc-skills-golang/skills/golang-spf13-cobra ~/.agents/skills/golang-spf13-cobra # Codex, Cursor, Gemini CLI, Copilot, OpenCode