cobra-patterns - Build Go CLIs with Cobra patterns
Provides production-ready patterns for Cobra command structures, flags, nested commands, lifecycle hooks, argument validation, and initialization.
Tags
Updated: 2026-10-04Capabilities
Typical Inputs
Typical Outputs
What this skill does
- Select CLI structure patterns
- Scaffold Cobra CLI projects
- Define nested commands
- Manage local flags
- Manage persistent flags
- Validate command arguments
- Configure lifecycle hooks
- Initialize CLI configuration
Inputs
- CLI name
- CLI structure type
- Go CLI requirements
- Command arguments
- Flag requirements
- Configuration requirements
Outputs
- Cobra CLI directory structure
- Go command source files
- Go module configuration
- Command and flag definitions
- Argument validation logic
- CLI initialization logic
Requirements
- Go development environment
- Cobra dependency
- Bash shell
- File read and write access
