Learn Go's most popular CLI library through hands-on command-line challenges. Build powerful tools used by Docker, Kubernetes, and GitHub CLI.
/packages/cobra
in the repository
Build command-line tools used by Docker, Kubernetes, and GitHub
Build hierarchical commands with subcommands like Docker and kubectl.
Handle global flags, persistent flags, and command arguments with validation.
From simple commands to production-ready CLI tools
Setup Cobra and create your first command
Handle user input with flags and args
Build nested commands with shared state
Configuration, completion, and packaging