go-cobra-applications
Installation
SKILL.md
Go Cobra Applications
Keep Cobra and Viper at the application edge. Construct a fresh command tree per execution and translate CLI state into typed application calls.
Core Workflow
- Model the tree around user resources, workflows, and operations.
- Define invocation contracts, argument validation, examples, and flag scope.
- Construct fresh root and subcommands with explicit dependencies and streams.
- Keep handlers thin, propagate context, and return errors.
- Resolve defaults, config, environment, and flags into a validated typed config.
- Test parsing, inheritance, precedence, help, errors, and repeated execution.
- Generate completion and documentation from the same runtime tree.