{"record":{"id":"7b01458728e1c486","repo":"argoproj/argo-workflows","slug":"invalid-shell-q-supported-shells-are-bash-zsh","errorCode":null,"errorMessage":"invalid shell %q: supported shells are bash, zsh, and fish","messagePattern":"invalid shell %q: supported shells are bash, zsh, and fish","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/argo/commands/completion.go","lineNumber":144,"sourceCode":"\nFor zsh, output to a file in a directory referenced by the $fpath shell\nvariable.\n\nFor fish, output to a file in ~/.config/fish/completions\n`,\n\t\tArgs: cobra.ExactArgs(1),\n\t\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\t\tshell := args[0]\n\t\t\trootCommand := NewCommand()\n\t\t\trootCommand.BashCompletionFunction = bashCompletionFunc\n\t\t\tavailableCompletions := map[string]func(out io.Writer, cmd *cobra.Command) error{\n\t\t\t\t\"bash\": runCompletionBash,\n\t\t\t\t\"zsh\":  runCompletionZsh,\n\t\t\t\t\"fish\": runCompletionFish,\n\t\t\t}\n\t\t\tcompletion, ok := availableCompletions[shell]\n\t\t\tif !ok {\n\t\t\t\treturn fmt.Errorf(\"invalid shell %q: supported shells are bash, zsh, and fish\", shell)\n\t\t\t}\n\t\t\treturn completion(os.Stdout, rootCommand)\n\t\t},\n\t}\n\treturn command\n}\n\nfunc runCompletionBash(out io.Writer, cmd *cobra.Command) error {\n\treturn cmd.GenBashCompletion(out)\n}\n\nfunc runCompletionZsh(out io.Writer, cmd *cobra.Command) error {\n\treturn cmd.GenZshCompletion(out)\n}\n\nfunc runCompletionFish(out io.Writer, cmd *cobra.Command) error {\n\treturn cmd.GenFishCompletion(out, true)\n}","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/cmd/argo/commands/completion.go#L126-L162","documentation":"`argo completion <shell>` looks up the shell name in a fixed map containing only bash, zsh, and fish. Any other string reaches the default path and returns this error. Note powershell completion is not offered by this command even though cobra supports it.","triggerScenarios":"Running `argo completion powershell`, `argo completion sh`, `argo completion Bash` (case-sensitive map), or `argo completion` with an empty/typo'd argument.","commonSituations":"Windows/PowerShell users expecting a powershell subcommand; POSIX `sh` (dash) users; scripts generating completion for a shell name held in a variable with wrong case or whitespace.","solutions":["Use one of: `argo completion bash`, `argo completion zsh`, `argo completion fish`","For PowerShell, generate bash-compatible completion is not available — use the shell's own completion for external tools or file an upstream feature request","For POSIX sh, source bash completion under bash or use fish/zsh instead","Check spelling and casing: the shell argument must be exactly lowercase bash/zsh/fish"],"exampleFix":"// before\nargo completion powershell\n// after\nargo completion bash   # or zsh / fish","handlingStrategy":"validation","validationCode":"case \"$shell\" in\n  bash|zsh|fish) argo completion \"$shell\";;\n  *) echo \"unsupported shell: $shell (use bash|zsh|fish)\" >&2; exit 1;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never source completion generation for shells other than bash/zsh/fish","Guard install scripts with a shell-name check before calling `argo completion`","Note PowerShell is unsupported — use alternative completion setups for Windows"],"tags":["cli","shell-completion","argoproj"],"backgroundTag":"unsupported-shell","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}