bobmatnyc avatar

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-code

Installs 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
1davila7 avatarnowait-reasoning-optimizerdavila7/claude-code-templatesImplements the NOWAIT technique for efficient reasoning in R1-style LLMs. Use when optimizing inference of reasoning models (QwQ, DeepSeek-R1, Phi4-Reasoning, Q438skills.sh installs
2vivy-yi avatarimage-editingvivy-yi/xiaohongshu-skillsUse when editing and enhancing images for Xiaohongshu content, improving photo quality with filters and adjustments, creating visually appealing images, or prep438skills.sh installs
3secondsky avatarrecommendation-enginesecondsky/claude-skillsBuild recommendation systems with collaborative filtering, matrix factorization, hybrid approaches. Use for product recommendations, personalization, or encount437skills.sh installs
4secondsky avatarseo-keyword-cluster-buildersecondsky/claude-skillsSEO keyword clustering with topic organization, content hub architecture, internal linking strategies. Use for content strategy, keyword research, pillar page s437skills.sh installs
5jwynia avatarspeech-adaptationjwynia/agent-skillsTransform comprehensive written content into purposeful spoken guidance. Use when adapting for speech, converting to spoken format, optimizing for listening, or436skills.sh installs
6mims-harvard avatartooluniverse-protein-structure-retrievalmims-harvard/tooluniverseProtein structure retrieval from RCSB PDB, PDBe, and AlphaFold with disambiguation, quality assessment (resolution, R-factor, pLDDT), and metadata. Distinguishe435skills.sh installs