{"record":{"id":"2ef17381bb9dba1f","repo":"hashicorp/vagrant","slug":"cloud-command-box-delete-warn","errorCode":null,"errorMessage":"cloud_command.box.delete_warn","messagePattern":"cloud_command\\.box\\.delete_warn","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"plugins/commands/cloud/box/delete.rb","lineNumber":38,"sourceCode":"              o.separator \"\"\n              o.separator \"Options:\"\n              o.separator \"\"\n\n              o.on(\"-f\", \"--[no-]force\", \"Do not prompt for deletion confirmation\") do |f|\n                options[:force] = f\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            if !options[:force]\n              @env.ui.warn(I18n.t(\"cloud_command.box.delete_warn\", box: argv.first))\n              cont = @env.ui.ask(I18n.t(\"cloud_command.continue\"))\n              return 1 if cont.strip.downcase != \"y\"\n            end\n\n            @client = client_login(@env)\n\n            org, box_name = argv.first.split('/', 2)\n            delete_box(org, box_name, @client.token)\n          end\n\n          # Delete the requested 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          # @return [Integer]\n          def delete_box(org, box_name, access_token)\n            account = VagrantCloud::Account.new(","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/hashicorp/vagrant/blob/35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5/plugins/commands/cloud/box/delete.rb#L20-L56","documentation":"Destructive-action warning from `vagrant cloud box delete` (plugins/commands/cloud/box/delete.rb). After validating exactly one argument, if --force was not passed it warns 'This will completely remove <box> from Vagrant Cloud. This cannot be undone.', prompts 'Do you wish to continue? [y/N]', and returns exit status 1 unless the answer (stripped, downcased) is exactly 'y'.","triggerScenarios":"Running `vagrant cloud box delete org/box` without -f/--force; the command contacts Vagrant Cloud only after a 'y' confirmation, deleting the entire box entry (all versions, all providers).","commonSituations":"Cleaning up test boxes published under an org; accidental targeting of a shared org box because the wrong org/box path was typed; automation where the interactive prompt blocks or the default 'N' aborts with exit 1.","solutions":["Double-check the target: confirm org/box with `vagrant cloud box show org/box` before deleting.","For scripted deletion, pass --force and ensure the name is computed, not typed: `vagrant cloud box delete --force \"$ORG/$BOX\"`.","If the prompt aborted you, that is by design (exit 1); re-run and answer 'y' (lowercase after downcase, any case works).","Consider deleting only a version/provider (`vagrant cloud version delete` / `vagrant cloud provider delete`) instead of the whole box when possible."],"exampleFix":"# before\nvagrant cloud box delete myorg/old-box   # interactive [y/N] prompt, aborts on anything but y\n\n# after (explicit, non-interactive)\nvagrant cloud box show myorg/old-box && \\\n  vagrant cloud box delete myorg/old-box --force","handlingStrategy":"validation","validationCode":"# confirm the box exists before offering deletion\nvagrant cloud box show \"$ORG/$BOX\" >/dev/null || { echo \"no such box\" >&2; exit 1; }\n[ -n \"$BOX\" ] || { echo \"refusing: empty box name\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Prefer --force only with programmatically derived names, never free-typed input.","Delete narrowest-first (provider, then version, then box).","Treat the [y/N] default N as a safety net: answer explicitly only after re-reading the warned path."],"tags":["vagrant","vagrant-cloud","destructive-action","confirmation-prompt","cli"],"backgroundTag":"destructive-action-confirmation","analyzedSha":"35f3160f4ad6edc3a9f3aa9570adfc1a4d73aaa5","analyzedAt":"2026-08-21T13:34:32.514Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}