Golang Cli Cobra Viper
Cobra and Viper skill for building production-grade Go CLIs with layered configuration and shell completion.
- CCM score
- 55 of 100
- skills.sh installs
- 446
- GitHub stars
- 79
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers Cobra command structure, persistent and local flags, PreRun and PostRun hooks, and Viper configuration precedence
- Includes examples for subcommands with arguments, flag validation, and binding flags to Viper, drawn from kubectl, Docker, and gh patterns
- Enforces configuration priority of explicit set, flags, environment variables, config files, then defaults, and uses RunE-style error returns
- Designed for Go developers building multi-command developer tools, admin CLIs, or DevOps automation
Install
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill golang-cli-cobra-viper -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/bobmatnyc/claude-mpm-skills
- Categories
- Go, CLI & Terminal
- First seen
- Jun 3, 2026
Questions
What is the golang-cli-cobra-viper skill for?
It guides an agent in building production-quality command-line tools in Go using the Cobra command framework and Viper configuration management. It covers multi-command CLIs, command structure, subcommands with arguments, and shell completion. Viper merges flags, environment variables and config files with clear precedence rules.
How do I install the golang-cli-cobra-viper skill?
Run npx -y skills add bobmatnyc/claude-mpm-skills --skill golang-cli-cobra-viper -y in your project. After installing, the agent can apply Cobra and Viper patterns when you build a Go CLI tool.
Who should use the golang-cli-cobra-viper skill?
It suits Go developers building multi-command CLIs, developer tools, DevOps automation or admin CLIs for services. It is useful when you need flags, environment variables and config files to work together. The skill sits in the Go category, where it ranks in the top 100.
Which skills are related to golang-cli-cobra-viper in the Go category?
The other top skills in the Go category include golang-code-style, golang-testing, golang-error-handling, golang-design-patterns and golang-concurrency. Golang-cli-cobra-viper focuses on CLI structure and configuration, while those cover code style, tests, errors, design and concurrency.
More from bobmatnyc/claude-mpm-skills
All 154- Wordpress Plugin Fundamentals444
- Dependency Audit442
- Digitalocean Compute441
- Phoenix Liveview440
- Wordpress Testing Qa440
- Database Migration435
- Golang Observability Opentelemetry434
- Hono Testing433
- Golang Concurrency Patterns429
- Hono Validation429
- Digitalocean Overview428
- Digitalocean Networking425
- Openrouter424
- Digitalocean Storage423
- Golang Database Patterns423
- Shadcn Ui421
- Digitalocean Managed Databases413
- Test Driven Development412
- Verification Before Completion410
- Better Auth Authentication408
- Kubernetes407
- Kysely407
- Json Data Handling404
- Systematic Debugging402
Similar to Golang Cli Cobra Viper
More Gogolang-cliSkillsamber/cc-skills-golang42K installsGo CLI development guide covering Cobra and Viper setup, flags, exit codes, I/O, and signal handling.
golang-spf13-cobraSkillsamber/cc-skills-golang39.4K installsGo CLI command-tree library covering RunE hooks, arg validators, flags, completions, and command testing.
cli-developerSkilljeffallan/claude-skills5.3K installsGuide for building command-line tools with commander, click, typer, or cobra, covering argument parsing and UX.
clapSkillbobmatnyc/claude-mpm-skills352 installsProduction Rust CLI patterns with Clap covering subcommands, config layering, exit codes, and testing.
use-modern-goSkilljetbrains/go-modern-guidelines3.1K installsVersion-aware Go style guidance from a CLI that applies modern idioms to the project's Go version.
cli-devPluginoutfitter-dev/agents29 starsSkills for building command-line tools: argument parsing, help text, subcommands, and CLI best practices