I think I found a bug with zsh completion in cobra 1.0.0: If I put square brackets in a command description they do not get escaped correctly causing problems.
Here there's an example of the line causing problems.
I "patched" this behaviour with:
buf := new(bytes.Buffer)
cmd.Root().GenZshCompletion(buf)
r := strings.NewReplacer("[", "\\[", "]", "\\]") //insert escaping before [ and ]
s := r.Replace(buf.String())
s = strings.ReplaceAll(s, "\\[1\\]", "[1]") // revert the case
os.Stdout.WriteString(s)
I think this will be fixed in #1070 but I'm opening that just for reference