{"record":{"id":"2afd54a5ac0ad491","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-2afd54","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/cloud/provider/create.rb","lineNumber":44,"sourceCode":"              o.on(\"-a\", \"--architecture ARCH\", String, \"Architecture of guest box (defaults to current host architecture)\") do |a|\n                options[:architecture] = a\n              end\n              o.on(\"-c\", \"--checksum CHECKSUM_VALUE\", String, \"Checksum of the box for this provider. --checksum-type option is required.\") do |c|\n                options[:checksum] = c\n              end\n              o.on(\"-C\", \"--checksum-type TYPE\", String, \"Type of checksum used (md5, sha1, sha256, sha384, sha512). --checksum option is required.\") do |c|\n                options[:checksum_type] = c\n              end\n              o.on(\"--[no-]default-architecture\", \"Mark as default architecture for specific provider\") do |d|\n                options[:default_architecture] = d\n              end\n            end\n\n            # Parse the options\n            argv = parse_options(opts)\n            return if !argv\n            if argv.count < 3 || argv.count > 4\n              raise Vagrant::Errors::CLIInvalidUsage,\n                help: opts.help.chomp\n            end\n\n            @client = client_login(@env)\n\n            org, box_name = argv.first.split('/', 2)\n            provider_name = argv[1]\n            version = argv[2]\n            url = argv[3]\n\n            create_provider(org, box_name, version, provider_name, url, @client.token, options)\n          end\n\n          # Create a provider for the box version\n          #\n          # @param [String] org Organization name\n          # @param [String] box Box name\n          # @param [String] version Box version","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/provider/create.rb#L26-L62","documentation":"`vagrant cloud provider create` requires three or four positional arguments: `organization/box-name`, provider name, version, and optionally a URL to the box file. Fewer than three or more than four argv entries raises CLIInvalidUsage with the command help; checksum and architecture settings are options, not positionals.","triggerScenarios":"`vagrant cloud provider create myorg/mybox virtualbox` (version missing); a version split into separate tokens; five or more positionals because a URL or checksum was passed as a bare argument.","commonSituations":"Forgetting the version argument since create feels like it could infer the next version; passing the URL without an option flag; argument-order mistakes between provider and version when porting scripts between Vagrant versions.","solutions":["Use the exact form: `vagrant cloud provider create org/box-name provider version [url]`","Pass metadata as options: --checksum, --checksum-type, --[no-]default-architecture","Confirm with `vagrant cloud provider create -h`"],"exampleFix":"# before\nvagrant cloud provider create myorg/mybox virtualbox\n# after\nvagrant cloud provider create myorg/mybox virtualbox 1.0.0","handlingStrategy":"validation","validationCode":"# Ruby: enforce the 3-or-4 argument contract before invoking\npos = args.select { |a| !a.start_with?(\"-\") }\nunless (3..4).cover?(pos.size)\n  abort \"usage: vagrant cloud provider create org/box-name provider version [url]\"\nend\nexec \"vagrant\", \"cloud\", \"provider\", \"create\", *args","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud provider create], org_box, provider, version, url)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Keep the argument order provider-then-version in release scripts; assert it in tests","Pass checksums and default-architecture as flags, never bare positionals","Build commands from a struct/hash with explicit fields instead of array concatenation"],"tags":["vagrant","vagrant-cloud","cli","argument-validation","provider-management"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}