Adding a command alias feature for your CLI.
go get github.com/linuxsuren/go-cli-alias
Put the following code lines:
var ctx context.Context
if defMgr, err := alias.GetDefaultAliasMgr(); err == nil {
ctx = context.WithValue(context.Background(), alias.AliasKey, defMgr)
rootCmd.AddCommand(cmd.NewRootCommand(ctx))
cmd.RegisterAliasCommands(ctx, rootCmd)
} else {
fmt.Println(fmt.Errorf("cannot get default alias manager, error: %v", err))
}