I created Cobra and Viper while building Hugo. Go was young, cloud infrastructure was being rewritten from scratch, and we needed a clean way to express command trees, flags, and configuration that could scale from a single command to a deep subcommand hierarchy. Over the next decade, Kubernetes, Docker, GitHub, Helm, and thousands of other projects built their interfaces on those foundations.
Many of the principles in this guide are older than all of us. Streams, pipes, exit codes, and filters come straight from Bell Labs and fifty years of Unix practice. The rest—the noun-verb grammar, the configuration precedence contract, outcome-oriented flags, and self-documenting command trees—was forged in the open with my teams at MongoDB, Docker, and Google, and with the maintainers who pushed these patterns into production across the industry.
For years these conventions lived scattered across library defaults, conference talks, and design reviews. They belong in one place, stated plainly, for the engineers and the agents building what comes next.
© 2026 Steve Francia (spf13) · spf13 labs LLC · All rights reserved. Brief quotations with attribution and a link to cli.style are permitted.