{"record":{"id":"6ac0da140b04698e","repo":"hashicorp/vagrant","slug":"this-command-was-not-invoked-properly-the-help-fo-6ac0da","errorCode":null,"errorMessage":"This command was not invoked properly. The help for this command is\navailable below.\n\n%{help}","messagePattern":"This command was not invoked properly\\. The help for this command is\navailable below\\.\n\n%(.+?)","errorType":"exception","errorClass":"Vagrant::Errors::CLIInvalidUsage","httpStatus":null,"severity":"error","filePath":"plugins/commands/cloud/box/create.rb","lineNumber":39,"sourceCode":"              o.separator \"Options:\"\n              o.separator \"\"\n\n              o.on(\"-d\", \"--description DESCRIPTION\", String, \"Full description of the box\") do |d|\n                options[:description] = d\n              end\n              o.on(\"-s\", \"--short-description DESCRIPTION\", String, \"Short description of the box\") do |s|\n                options[:short] = s\n              end\n              o.on(\"-p\", \"--[no-]private\", \"Makes box private\") do |p|\n                options[:private] = p\n              end\n            end\n\n            # Parse the options\n            argv = parse_options(opts)\n            return if !argv\n            if argv.empty? || argv.length > 1\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            create_box(org, box_name, @client.token, options.slice(:description, :short, :private))\n          end\n\n          # Create a new box\n          #\n          # @param [String] org Organization name of box\n          # @param [String] box_name Name of box\n          # @param [String] access_token User access token\n          # @param [Hash] options Options for box filtering\n          # @option options [String] :short Short description of box\n          # @option options [String] :description Full description of box\n          # @option options [Boolean] :private Set box visibility as private","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/box/create.rb#L21-L57","documentation":"`vagrant cloud box create` requires exactly one positional argument: the box identifier in `org/box-name` form. Vagrant raises CLIInvalidUsage when argv is empty (no box given) or contains more than one entry; the embedded help text shows the expected form along with the -d/--description, -s/--short-description and -p/--private options.","triggerScenarios":"Running `vagrant cloud box create` with no argument; passing two or more positionals such as `vagrant cloud box create myorg mybox` instead of the slash-separated form; an unquoted identifier containing spaces.","commonSituations":"Assuming organization and box name are separate arguments (as some CLIs accept); forgetting the organization prefix entirely; scripts that conditionally append an argument and end up passing zero or two.","solutions":["Pass one slash-separated identifier: `vagrant cloud box create myorg/mybox`","Attach metadata as options, not extra positionals: `vagrant cloud box create -s \"My box\" myorg/mybox`","Check `vagrant cloud box create -h` for the exact banner"],"exampleFix":"# before\nvagrant cloud box create myorg mybox\n# after\nvagrant cloud box create myorg/mybox","handlingStrategy":"validation","validationCode":"# Ruby wrapper: validate the org/box identifier before shelling out\narg = ARGV[0]\nif ARGV.length != 1 || arg.to_s !~ %r{\\A[^/\\s]+/[^/\\s]+\\z}\n  abort \"usage: vagrant cloud box create org/box-name\"\nend\nexec \"vagrant\", \"cloud\", \"box\", \"create\", *ARGV","typeGuard":null,"tryCatchPattern":"begin\n  env.cli(%w[cloud box create], org_box)\nrescue Vagrant::Errors::CLIInvalidUsage => e\n  $stderr.puts e.message.lines.first\n  exit 64\nend","preventionTips":["Normalize box identifiers to a single org/box-name string in your tooling","Reject identifiers without a slash before invoking the CLI","Keep metadata in options (-d, -s, -p), never in extra positionals"],"tags":["vagrant","vagrant-cloud","cli","argument-validation","box-management"],"backgroundTag":"cli-invalid-usage","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}