developing-cli-apps

Installation
SKILL.md

CLI Application Development

Standards for building CLI applications in Go. Currently uses Cobra for command structure and Huh for interactive UI.

Interactive UI patterns: See Interactive UI Reference

Command Organization

  • One file per command in cmd/, file name matches command name (camelCase)
  • All commands registered in their own init() function via rootCmd.AddCommand()
  • See cmd/root.go for the root command structure and initialization chain
  • See any existing command file (e.g., cmd/version.go) for a minimal example

Adding a New Command

  1. Create a new file in cmd/ (camelCase name matching the command)
  2. Define a cobra.Command variable with Use and Short fields
  3. In init(): register with rootCmd.AddCommand(), define flags, bind to Viper
  4. Suppress the init lint: //nolint:gochecknoinits // Cobra requires an init function to set up the command structure.
Related skills

More from mrpointer/dotfiles

Installs
1
GitHub Stars
2
First Seen
Apr 7, 2026