asdf-vm/asdf · error

no plugin name specified

Error message

no plugin name specified

What it means

`asdf plugin <command> <name>` (extensionCommand dispatches to plugin binaries) requires the plugin/tool name as the first argument. When no argument is supplied, it logs and returns this error before any config is loaded.

Solutions

  1. Pass the plugin name as the first argument, e.g. `asdf plugin add nodejs`
  2. Quote/verify script variables so an unset variable does not disappear from argv
  3. Run the command with `--help` to see required arguments

Example fix

// before
$ asdf plugin add
// after
$ asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
Defensive patterns

Strategy: validation

Validate before calling

if [ -z "$1" ]; then
  echo "usage: asdf plugin add <name> [git-url]" >&2
  exit 1
fi

Try / catch

out=$(asdf plugin add "$PLUGIN" 2>&1) || {
  echo "plugin add failed: $out" >&2
}

Prevention

When it happens

Trigger: Invoking a plugin/extension subcommand (e.g. `asdf plugin add`, `asdf list`) with zero arguments, so len(args) < 1.

Common situations: Typing `asdf plugin` alone expecting a listing; scripting with an empty variable, e.g. `asdf plugin add $PLUGIN` where PLUGIN is unset.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of asdf-vm/asdf@074a1722ca (2026-08-30). Data as JSON: /api/errors/636da34ce170e7b7. Report an issue: GitHub.

Appendix: source

Thrown at internal/cli/cli.go:626

		env, err = execenv.Generate(plugin, env)
		if _, ok := err.(plugins.NoCallbackError); !ok && err != nil {
			return err
		}
	}

	err = hook.RunWithOutput(conf, fmt.Sprintf("pre_%s_%s", plugin.Name, filepath.Base(executable)), args, os.Stdout, os.Stderr)
	if err != nil {
		cli.OsExiter(1)
		return err
	}

	finalEnv := execute.MergeWithCurrentEnv(env)
	return exec.Exec(executable, args, finalEnv)
}

func extensionCommand(logger *log.Logger, args []string) error {
	if len(args) < 1 {
		err := errors.New("no plugin name specified")
		logger.Printf("%s", err.Error())
		return err
	}

	conf, err := config.LoadConfig()
	if err != nil {
		logger.Printf("error loading config: %s", err)
		return err
	}

	pluginName := args[0]
	plugin := plugins.New(conf, pluginName)

	err = runExtensionCommand(plugin, args[1:])
	logger.Printf("error running extension command: %s", err.Error())
	return err
}

View on GitHub (pinned to 074a1722ca)