hashicorp/vagrant · error · Vagrant::Errors::CLIInvalidUsage
This command was not invoked properly. The help for this com
Error message
This command was not invoked properly. The help for this command is
available below.
%{help} What it means
`vagrant cloud box show` requires exactly one positional argument: the `org/box-name` identifier to display. CLIInvalidUsage is raised for an empty argv or more than one entry. All filtering (--architecture, --provider, --[no-]auth) is done through options, never extra positionals.
Source
Thrown at plugins/commands/cloud/box/show.rb:47
o.on("--architectures ARCH", String, "Filter results by architecture support (can be defined multiple times)") do |a|
options[:architectures].push(a).uniq!
end
o.on("--versions VERSION", String, "Display box information for a specific version (can be defined multiple times)") do |v|
options[:versions].push(v).uniq!
end
o.on("--providers PROVIDER", String, "Filter results by provider support (can be defined multiple times)") do |pv|
options[:providers].push(pv).uniq!
end
o.on("--[no-]auth", "Authenticate with Vagrant Cloud if required before searching") do |l|
options[:quiet] = !l
end
end
# Parse the options
argv = parse_options(opts)
return if !argv
if argv.empty? || argv.length > 1
raise Vagrant::Errors::CLIInvalidUsage,
help: opts.help.chomp
end
@client = client_login(@env, options.slice(:quiet))
org, box_name = argv.first.split('/', 2)
show_box(org, box_name, @client&.token, options.slice(:architectures, :providers, :versions))
end
# Display the requested box to the user
#
# @param [String] org Organization name of box
# @param [String] box_name Name of box
# @param [String] access_token User access token
# @param [Hash] options Options for box filtering
# @option options [String] :versions Specific verisons of box
# @return [Integer]
def show_box(org, box_name, access_token, options={})View on GitHub (pinned to 35f3160f4a)
Solutions
- Pass exactly one identifier: `vagrant cloud box show hashicorp/bionic64`
- Filter output with options: `vagrant cloud box show --provider virtualbox myorg/mybox`
- Check `vagrant cloud box show -h` for the accepted flags
Example fix
# before vagrant cloud box show myorg/mybox 1.0.0 # after vagrant cloud box show --version 1.0.0 myorg/mybox
Defensive patterns
Strategy: validation
Validate before calling
# Ruby: one positional, slash-separated; everything else must be a flag
pos = argv.reject { |a| a.start_with?("-") }
unless pos.size == 1 && pos.first =~ %r{\A[^/\s]+/[^/\s]+\z}
abort "usage: vagrant cloud box show org/box-name [--provider P] ..."
end Try / catch
begin env.cli(%w[cloud box show], org_box) rescue Vagrant::Errors::CLIInvalidUsage => e $stderr.puts e.message.lines.first exit 64 end
Prevention
- Use options (--provider, --architecture) for filtering instead of extra args
- Do not append versions positionally — this command shows the whole box
- Cache `vagrant cloud box show` output in scripts instead of re-parsing help text
When it happens
Trigger: Running `vagrant cloud box show` with no identifier; appending a version or provider as a second positional such as `vagrant cloud box show myorg/mybox 1.0.0`; an unquoted identifier containing spaces.
Common situations: Trying to show a specific version by adding it as an argument (not supported by this command); forgetting which args are positional when moving between cloud subcommands; empty identifier variables in automation.
Related errors
- This command was not invoked properly. The help for this com
- This command was not invoked properly. The help for this com
- This command was not invoked properly. The help for this com
- This command was not invoked properly. The help for this com
- This command was not invoked properly. The help for this com
AI-assisted analysis of hashicorp/vagrant@35f3160f4a (2026-08-21).
Data as JSON: /api/errors/fd330008219726f8.
Report an issue: GitHub.