
Golang Spf13 Cobra
Go CLI command-tree library covering RunE hooks, arg validators, flags, completions, and command testing.
- skills.sh installs
- 39K
- GitHub stars
- 3.9K
- last updated
- Aug 21, 2026
What it does
- Covers the cobra command tree: root and subcommands, the
PersistentPreRunEthroughPersistentPostRunEhook chain, and command groups - Includes built-in and custom
Argsvalidators, persistent versus local flags,ValidArgsFunctionandRegisterFlagCompletionFunccompletions, andSetArgsandSetOuttesting - Enforces
RunEoverRun,Argsvalidators over manuallen(args)checks, andOutOrStdout()over directos.Stdoutwrites - Designed for Go projects that import
github.com/spf13/cobra, and pairs with viper for configuration layering
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-spf13-cobra -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Persona: You are a Go CLI engineer building command trees that feel native to the Unix shell. You design the user-facing surface first, then wire behavior into the right hook.
Modes:
- Build — creating a new CLI from scratch: follow command tree setup, hook wiring, and flag sections sequentially.
- Extend — adding subcommands, flags, or completions to an existing CLI: read the current command tree first, then apply changes consistent with the existing structure.
- Review — auditing an existing CLI: check the Common Mistakes table, verify
RunEusage,OutOrStdout(), hook chain ordering, and args validation.
Using spf13/cobra for CLI command trees in Go
Cobra is the de facto standard for Go CLI applications. It provides the command/subcommand tree, flag parsing (via pflag), args validation, shell completion generation, and documentation generation. It does not handle configuration layering — that's viper's job.
Official Resources:
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- Go, CLI & Terminal
- First seen
- May 16, 2026
More from samber/cc-skills-golang
All 47- Golang Swagger39K
- Golang Graphql38.8K
- Golang Google Wire38.7K
- Golang Spf13 Viper38.7K
- Golang Uber Fx38.4K
- Golang Uber Dig38.4K
- Golang How To38.3K
- Golang Linter26.5K
- Golang Pkg Go Dev13.7K
- Golang Refactoring13.3K
- Golang Gopls12.9K
- Golang Code Style46.6K
- Golang Testing45.9K
- Golang Error Handling45.9K
- Golang Security44.7K
- Golang Design Patterns44.3K
- Golang Performance44.1K
- Golang Concurrency44.1K
- Golang Context43.2K
- Golang Database43K
- Golang Naming43K
- Golang Safety42.7K
- Golang Project Layout42.5K
- Golang Documentation42.4K
Similar to Golang Spf13 Cobra
More Go
golang-clisamber/cc-skills-golang41.5K installsGo CLI development guide covering Cobra and Viper setup, flags, exit codes, I/O, and signal handling.
golang-cli-cobra-viperbobmatnyc/claude-mpm-skills443 installsCobra and Viper skill for building production-grade Go CLIs with layered configuration and shell completion.
golang-spf13-vipersamber/cc-skills-golang38.7K installsLayered configuration library with fixed precedence, env binding, struct unmarshaling, and hot reload for Go.
cli-developerjeffallan/claude-skills5.2K installsGuide for building command-line tools with commander, click, typer, or cobra, covering argument parsing and UX.
clapbobmatnyc/claude-mpm-skills346 installsProduction Rust CLI patterns with Clap covering subcommands, config layering, exit codes, and testing.
domain-cliactionbook/rust-skills3.5K installsDomain guide for building Rust CLI tools, covering argument parsing, config layering, and terminal output conventions.