Versions in this module Expand all Collapse all v1 v1.1.3 Dec 26, 2025 Changes in this version + func AddPersistentPostRunHook(cmd *cobra.Command, hook HookFunc) + func AddPersistentPreRunHook(cmd *cobra.Command, hook HookFunc) + func AddPostRunHook(cmd *cobra.Command, hook HookFunc) + func AddPreRunHook(cmd *cobra.Command, hook HookFunc) + func BuildRootCommand(ctx *context.Context, opts ...RootOption) *cobra.Command + func Execute(ctx *context.Context, rootCmd *cobra.Command) error + func FindCommand(rootCmd *cobra.Command, name string) *cobra.Command + func FindCommandPath(rootCmd *cobra.Command, path string) *cobra.Command + func GetSubcommands(cmd *cobra.Command) map[string]*cobra.Command + func ListCommands(rootCmd *cobra.Command) []string + func RegisterAllCommands(ctx *context.Context, rootCmd *cobra.Command) + func RemoveCommand(rootCmd *cobra.Command, name string) error + func ReplaceCommand(rootCmd *cobra.Command, oldName string, newCmd *cobra.Command) error + func WalkCommands(rootCmd *cobra.Command, fn func(*cobra.Command)) + type HookFunc func(cmd *cobra.Command, args []string) + type RootConfig struct + Long string + Short string + Use string + Version string + type RootOption func(*RootConfig) + func WithLong(long string) RootOption + func WithShort(short string) RootOption + func WithUse(use string) RootOption + func WithVersion(version string) RootOption