
Golang Cli
Go CLI development guide covering Cobra and Viper setup, flags, exit codes, I/O, and signal handling.
- skills.sh installs
- 41.5K
- GitHub stars
- 3.9K
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers command structure, flag handling, configuration layering, version embedding, exit codes, and I/O patterns for Go CLI tools
- Includes example files for root and subcommands, flags, argument validation, config, version, exit codes, output, and signal handling
- Enforces
SilenceUsageandSilenceErrors, stdout-for-output and stderr-for-diagnostics discipline, and Viper binding for every flag - Designed for building, extending, or reviewing Go CLIs that use Cobra, Viper, or urfave/cli, with stdlib
flagfor trivial tools
Install
$ npx -y skills add samber/cc-skills-golang --skill golang-cli -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Persona: You are a Go CLI engineer. You build tools that feel native to the Unix shell — composable, scriptable, and predictable under automation.
Modes:
- Build — creating a new CLI from scratch: follow the project structure, root command setup, flag binding, and version embedding 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 for correctness: check the Common Mistakes table, verify
SilenceUsage/SilenceErrors, flag-to-Viper binding, exit codes, and stdout/stderr discipline.
Go CLI Best Practices
Use Cobra + Viper as the default stack for Go CLI applications. Cobra provides the command/subcommand/flag structure and Viper handles configuration from files, environment variables, and flags with automatic layering. This combination powers kubectl, docker, gh, hugo, and most production Go CLIs.
When using Cobra or Viper, refer to the library's official documentation and code examples for current API signatures.
Details
- Repository
- github.com/samber/cc-skills-golang
- Categories
- Go, CLI & Terminal
- First seen
- Apr 16, 2026
More from samber/cc-skills-golang
All 47- Golang Benchmark41.5K
- Golang Dependency Injection41.4K
- Golang Popular Libraries41.4K
- Golang Stretchr Testify41.3K
- Golang Continuous Integration41.3K
- Golang Grpc41.1K
- Golang Samber Lo40.4K
- Golang Stay Updated40.3K
- Golang Samber Do40.2K
- Golang Samber Slog40.1K
- Golang Samber Oops40K
- Golang Samber Mo40K
- Golang Samber Hot40K
- Golang Samber Ro39.9K
- Golang Spf13 Cobra39K
- 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
Similar to Golang Cli
More Go
golang-spf13-cobrasamber/cc-skills-golang39K installsGo CLI command-tree library covering RunE hooks, arg validators, flags, completions, and command testing.
cli-developerjeffallan/claude-skills5.2K installsGuide for building command-line tools with commander, click, typer, or cobra, covering argument parsing and UX.
domain-cliactionbook/rust-skills3.5K installsDomain guide for building Rust CLI tools, covering argument parsing, config layering, and terminal output conventions.
golang-spf13-vipersamber/cc-skills-golang38.7K installsLayered configuration library with fixed precedence, env binding, struct unmarshaling, and hot reload for Go.
unix-clipproenca/dot-skills333 installsReference guidelines for building UNIX-style command-line tools with POSIX conventions, exit codes, and stream handling.