{"record":{"id":"d70c6e9d959cffc6","repo":"hasura/graphql-engine","slug":"unknown-shell-s-use-bash-or-zsh","errorCode":null,"errorMessage":"unknown shell: %s. Use bash or zsh","messagePattern":"unknown shell: (.+?)\\. Use bash or zsh","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/commands/completion.go","lineNumber":116,"sourceCode":"\t\top  errors.Op = \"commands.completionOptions.run\"\n\t\terr error\n\t)\n\n\tswitch o.Shell {\n\tcase \"bash\":\n\t\tif o.File != \"\" {\n\t\t\terr = o.Cmd.Root().GenBashCompletionFile(o.File)\n\t\t} else {\n\t\t\terr = o.Cmd.Root().GenBashCompletion(os.Stdout)\n\t\t}\n\tcase \"zsh\":\n\t\tif o.File != \"\" {\n\t\t\terr = o.Cmd.Root().GenZshCompletionFile(o.File)\n\t\t} else {\n\t\t\terr = o.Cmd.Root().GenZshCompletion(os.Stdout)\n\t\t}\n\tdefault:\n\t\terr = fmt.Errorf(\"unknown shell: %s. Use bash or zsh\", o.Shell)\n\t}\n\n\tif err != nil {\n\t\treturn errors.E(op, err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":98,"sourceCodeEnd":125,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/completion.go#L98-L125","documentation":"Simple validation error from `hasura completion`: the --shell flag (o.Shell) was neither \"bash\" nor \"zsh\", so the switch's default branch builds this error directly with fmt.Errorf. Only bash and zsh are supported for completion generation.","triggerScenarios":"Running `hasura completion --shell fish` (or powershell, cmd, etc.) — any shell name outside {bash, zsh}, including typos like 'zsh ' or case mismatches depending on the switch.","commonSituations":"Users assuming fish/pwsh support because other CLIs offer it; copy-pasted docs for a different tool; typo'd flag value.","solutions":["Use `--shell bash` or `--shell zsh`.","For other shells, load bash/zsh completion emulation (e.g. fish's bashenv plugin) or wait for upstream support."],"exampleFix":"# before\nhasura completion --shell fish\n# after\nhasura completion --shell bash","handlingStrategy":"validation","validationCode":"case \"$SHELL_FLAG\" in bash|zsh) ;; *) echo \"unsupported shell: $SHELL_FLAG\"; exit 1;; esac","typeGuard":"func isSupportedShell(s string) bool { return s == \"bash\" || s == \"zsh\" }","tryCatchPattern":"Check the message prefix 'unknown shell' and re-run with --shell bash or --shell zsh.","preventionTips":["Restrict automation to bash/zsh.","Validate the flag value before invoking the CLI."],"tags":["validation","cli-flags","completion","hasura-cli"],"backgroundTag":"invalid-cli-argument-value","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}