{"record":{"id":"6e649d34a55b4fc4","repo":"asdf-vm/asdf","slug":"bad-shell-name","errorCode":null,"errorMessage":"bad shell name","messagePattern":"bad shell name","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cli/cli.go","lineNumber":378,"sourceCode":"\t\t},\n\t}\n\n\terr := unsetAsdfReservedEnvVars()\n\tif err != nil {\n\t\tcli.OsExiter(1)\n\t}\n\n\tif err = app.Run(context.Background(), os.Args); err != nil {\n\t\tcli.OsExiter(1)\n\t}\n}\n\nfunc completionCommand(l *log.Logger, shell string) error {\n\tfile, ok := completions.Get(shell)\n\tif !ok {\n\t\tl.Printf(`No completions available for shell with name %q\nCompletions are available for: %v`, shell, strings.Join(completions.Names(), \", \"))\n\t\treturn errors.New(\"bad shell name\")\n\t}\n\tdefer file.Close()\n\n\tio.Copy(os.Stdout, file)\n\n\treturn nil\n}\n\n// This function is a whole mess and needs to be refactored\nfunc currentCommand(logger *log.Logger, tool string, noHeader bool) error {\n\tconf, err := config.LoadConfig()\n\tif err != nil {\n\t\tlogger.Printf(\"error loading config: %s\", err)\n\t\treturn err\n\t}\n\n\tcurrentDir, err := os.Getwd()\n\tif err != nil {","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/cli/cli.go#L360-L396","documentation":"`asdf completion <shell>` only ships prebuilt completion scripts for a fixed set of shells. If the shell name is not a key in the completions map, it prints the supported names and returns this error.","triggerScenarios":"Calling `asdf completion <name>` with a name not in completions.Get, e.g. misspelled ('zsh ' trailing space, 'fish' when only bash/zsh are bundled) or an unsupported shell.","commonSituations":"Users setting up tab completion for a new shell, dotfiles installers referencing a shell name that differs from what asdf registers, copy-pasting completion setup from docs for a different asdf version.","solutions":["Run `asdf completion` (or read the error message) to list supported shell names and use exactly one of them","Check the exact shell name: use `zsh`/`bash`/`fish` as asdf spells them, not `zsh-5.9` etc.","Generate completions manually from your shell framework if your shell is unsupported"],"exampleFix":"// before\n$ asdf completion zce\n// after\n$ asdf completion zsh","handlingStrategy":"validation","validationCode":"SUPPORTED=\"bash zsh fish\"   # check against `asdf completion` output\nif ! echo \"$SUPPORTED\" | grep -qw \"$SHELL_NAME\"; then\n  echo \"unsupported shell: $SHELL_NAME\" >&2\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":"completions=$(asdf completion \"$SHELL\" 2>&1) || {\n  echo \"completion failed: $completions\" >&2\n}","preventionTips":["Use canonical shell names (bash, zsh, fish) exactly as listed","Capture the supported-names list from the error output before generating completions","Test completion setup per-machine since bundled shells vary by asdf version"],"tags":["cli","completion","shell"],"backgroundTag":"invalid-argument-value","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}