{"record":{"id":"d4e1e9e2d1e0baf9","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-d4e1e9","errorCode":null,"errorMessage":"This command was not invoked properly. The help for this command is available below. %{help}","messagePattern":"This command was not invoked properly\\. The help for this command is available below\\. %(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::CLIInvalidUsage","httpStatus":null,"severity":"error","filePath":"plugins/commands/plugin/command/install.rb","lineNumber":39,"sourceCode":"            o.banner = \"Usage: vagrant plugin install <name>... [-h]\"\n            o.separator \"\"\n            build_install_opts(o, options)\n\n            o.on(\"--local\", \"Install plugin for local project only\") do |l|\n              options[:env_local] = l\n            end\n\n            o.on(\"--verbose\", \"Enable verbose output for plugin installation\") do |v|\n              options[:verbose] = v\n            end\n          end\n\n          # Parse the options\n          argv = parse_options(opts)\n          return if !argv\n\n          if argv.length < 1\n            raise Vagrant::Errors::CLIInvalidUsage, help: opts.help.chomp if !options[:env_local]\n\n            errors = @env.vagrantfile.config.vagrant.validate(nil)\n            if !errors[\"vagrant\"].empty?\n              raise Errors::ConfigInvalid,\n                errors: Util::TemplateRenderer.render(\n                \"config/validation_failed\",\n                errors: errors)\n            end\n\n            local_plugins = @env.vagrantfile.config.vagrant.plugins\n            plugin_list = local_plugins.map do |name, info|\n              \"#{name} (#{info.fetch(:version, \"> 0\")})\"\n            end.join(\"\\n\")\n\n\n            @env.ui.info(I18n.t(\"vagrant.plugins.local.install_all\",\n              plugins: plugin_list) + \"\\n\")\n","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/plugin/command/install.rb#L21-L57","documentation":"`vagrant plugin install` requires at least one positional plugin name unless the env-local flag is given (options[:env_local], exposed as --local on current Vagrant, --env-local on some builds). When argv.length < 1 and that flag is absent, Vagrant::Errors::CLIInvalidUsage is raised with the help text. With the flag and no names, the command instead installs every plugin declared in the current Vagrantfile.","triggerScenarios":"Bare `vagrant plugin install`; flags-only invocation such as `vagrant plugin install --verbose`; intending to sync Vagrantfile-declared plugins but forgetting the local flag.","commonSituations":"CI bootstrap scripts calling plugin install before writing the Vagrantfile; users switching a project to Vagrantfile-managed plugins for the first time; a plugin name variable that expanded to empty.","solutions":["Pass a plugin name: `vagrant plugin install vagrant-disksize`.","To install everything declared in the Vagrantfile: `vagrant plugin install --local`.","Run `vagrant plugin install -h` to see flags (--entry-point, --plugin-source, --verbose) and the usage line."],"exampleFix":"# before\nvagrant plugin install\n# after\nvagrant plugin install vagrant-disksize\n# or install all Vagrantfile-declared plugins:\nvagrant plugin install --local","handlingStrategy":"validation","validationCode":"names = ARGV.reject { |a| a.start_with?('-') }\nif names.empty?\n  system('vagrant', 'plugin', 'install', '--local') # install Vagrantfile-declared set\nelse\n  system('vagrant', 'plugin', 'install', *names)\nend","typeGuard":null,"tryCatchPattern":"begin\n  Vagrant::Environment.new.cli(['plugin', 'install', name].compact)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  warn e.message\n  exit 1\nend","preventionTips":["Guard scripts: if the plugin list is empty, either abort or explicitly use --local.","Keep Vagrantfile-declared plugins as the single source of truth for CI.","Never let an interpolated variable silently vanish from the command line."],"tags":["vagrant","plugin","cli","usage","local-plugins"],"backgroundTag":"invalid-cli-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}