What problem does it solve?
Golang-cli helps you design Go command-line applications that behave correctly in real Unix environments—so flags, config layering, output, exit codes, and signal handling work reliably under automation and piping.
Core Features & Use Cases
- Cobra-based command architecture: Structure root commands, subcommands, and flags cleanly for maintainable CLI growth.
- Viper configuration layering: Ensure precedence across CLI flags, environment variables, config files, and defaults with safe handling when config is missing.
- Production-grade CLI behavior: Enforce stdout/stderr separation, consistent exit code conventions, version injection via ldflags, and graceful shutdown using context-aware signal handling.
- Shell completions and CLI testing patterns: Generate completions via Cobra’s built-in generators and test commands by executing in-process while capturing outputs.
Quick Start
Use the golang-cli skill to scaffold a Cobra-based Go CLI root command with Viper config initialization, stdout/stderr discipline, a version command, and a sample subcommand in a way that your AI coding agent can extend safely.