Introduction to Cobra

In this lesson, you’ll learn about Cobra, which is the de-facto gold standard for Go command-line programs.

Cobra is both a library for processing command-line arguments and organizing your commands and an application that can generate a structured skeleton for your program. It is used by a vast number of the most prominent Go command-line tools out there like kubectl (the Kubernetes CLI) and docker (the Docker CLI).

The Cobra commander

Cobra is named after the comics villain Cobra commander who is the supreme leader of the Cobra terrorist organization in the G.I Joe comics universe. That’s a great inspiration for a command-line program tool. It also has a nice logo!

Get hands-on with 1200+ tech skills courses.