{"record":{"id":"bc3adb08f5eba5ba","repo":"asdf-vm/asdf","slug":"usage-asdf-shimversions-command","errorCode":null,"errorMessage":"usage: asdf shimversions <command>","messagePattern":"usage: asdf shimversions <command>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/cli/cli.go","lineNumber":1410,"sourceCode":"\t// fast enough now.\n\tif tool == \"\" || version == \"\" {\n\t\terr = shims.RemoveAll(conf)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn shims.GenerateAll(conf, os.Stdout, os.Stderr)\n\t}\n\n\t// If provided a specific version it could be something special like a path\n\t// version so we need to generate it manually\n\treturn reshimToolVersion(conf, plugin, version, os.Stdout, os.Stderr)\n}\n\nfunc shimVersionsCommand(logger *log.Logger, shimName string) error {\n\tif shimName == \"\" {\n\t\tlogger.Printf(\"usage: asdf shimversions <command>\")\n\t\treturn fmt.Errorf(\"usage: asdf shimversions <command>\")\n\t}\n\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\tshimPath := shims.Path(conf, shimName)\n\ttoolVersions, err := shims.GetToolsAndVersionsFromShimFile(shimPath)\n\tfor _, toolVersion := range toolVersions {\n\t\tfor _, version := range toolVersion.Versions {\n\t\t\tfmt.Printf(\"%s %s\\n\", toolVersion.Name, version)\n\t\t}\n\t}\n\treturn err\n}\n","sourceCodeStart":1392,"sourceCodeEnd":1428,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/cli/cli.go#L1392-L1428","documentation":"asdf's shimversions command prints which versions a shim maps to; it requires a shim name argument. shimVersionsCommand returns this usage error when shimName is empty, because there is no shim to look up.","triggerScenarios":"Running `asdf shimversions` with no arguments, or calling shimVersionsCommand programmatically with \"\".","commonSituations":"Exploring which versions back a shim but forgetting the shim name; scripting where the shim-name variable is empty.","solutions":["Pass the shim name: `asdf shimversions node`.","List available shims under ~/.asdf/shims to pick a valid name.","Guard scripts: only call `asdf shimversions $SHIM` when $SHIM is non-empty."],"exampleFix":"// before\nasdf shimversions\n// after\nasdf shimversions node","handlingStrategy":"validation","validationCode":"if [ -z \"$SHIM\" ]; then echo \"usage: asdf shimversions <command>\" >&2; exit 1; fi\nasdf shimversions \"$SHIM\"","typeGuard":null,"tryCatchPattern":"if ! asdf shimversions \"$SHIM\" 2>err.log; then cat err.log >&2; fi","preventionTips":["Always supply the shim name argument","Discover valid names via `ls ~/.asdf/shims`","Guard script variables before invoking"],"tags":["cli","usage","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}