
Golang Cli Cobra Viper
If you're building a Go CLI that's more than a throwaway script, you probably want Cobra and Viper. This skill knows the standard patterns for wiring them together: command structure, flag binding, config file precedence, the whole setup. It's the same stack that powers kubectl, Docker CLI, and GitHub's gh, so you're not learning some niche approach. Useful when you need subcommands, multiple config sources, or shell completions without writing that plumbing yourself. The integration between Cobra's flags and Viper's config management is where most people fumble, and that's exactly what this handles.
- skills.sh installs
- 438
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill golang-cli-cobra-viper --agent claude-codeInstalls into .claude/skills of the current project.
Files
Go CLI Development with Cobra & Viper
Overview
Cobra and Viper are the industry-standard libraries for building production-quality CLIs in Go. Cobra provides command structure and argument parsing, while Viper manages configuration from multiple sources with clear precedence rules.
Key Features:
- π― Cobra Commands: POSIX-compliant CLI with subcommands (
app verb noun --flag) - βοΈ Viper Config: Unified configuration from flags, env vars, and config files
- π Integration: Seamless Cobra + Viper plumbing patterns
- π Shell Completion: Auto-generated completions for bash, zsh, fish, PowerShell
- β Production Ready: Battle-tested by kubectl, docker, gh, hugo
Used By: Kubernetes (kubectl), Docker CLI, GitHub CLI (gh), Hugo, Helm, and 100+ major projects
When to Use This Skill
Sponsors
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- Categories
- Code Review & Quality, Go, CLI & Terminal
- First seen
- Jun 3, 2026
More from bobmatnyc/claude-mpm-skills
All 158- Dependency Audit434
- Wordpress Plugin Fundamentals434
- Phoenix Liveview432
- Wordpress Testing Qa430
- Digitalocean Compute429
- Database Migration427
- Hono Testing422
- Golang Observability Opentelemetry421
- Shadcn Ui421
- Golang Concurrency Patterns420
- Digitalocean Overview419
- Hono Validation419
- Digitalocean Networking415
- Digitalocean Storage414
- Golang Database Patterns414
- Openrouter413
- Digitalocean Managed Databases404
- Verification Before Completion401
- Test Driven Development400
- Better Auth Authentication398
- Kysely398
- Kubernetes397
- Json Data Handling394
- Systematic Debugging391