mislav/hub · error

Please type 'yes' for confirmation.

Error message

Please type 'yes' for confirmation.

What it means

In commands/delete.go deleteRepo, the destructive delete requires an interactive confirmation. The typed answer (trimmed) must be exactly "yes"; anything else raises "Please type 'yes' for confirmation." to abort repository deletion.

Source

Thrown at commands/delete.go:80

	owner := host.User
	if strings.Contains(repoName, "/") {
		split := strings.SplitN(repoName, "/", 2)
		owner, repoName = split[0], split[1]
	}

	project := github.NewProject(owner, repoName, host.Host)
	gh := github.NewClient(project.Host)

	if !args.Flag.Bool("--yes") {
		ui.Printf("Really delete repository '%s' (yes/N)? ", project)
		answer := ""
		scanner := bufio.NewScanner(os.Stdin)
		if scanner.Scan() {
			answer = strings.TrimSpace(scanner.Text())
		}
		utils.Check(scanner.Err())
		if answer != "yes" {
			utils.Check(fmt.Errorf("Please type 'yes' for confirmation."))
		}
	}

	if args.Noop {
		ui.Printf("Would delete repository '%s'.\n", project)
	} else {
		err = gh.DeleteRepository(project)
		if err != nil && strings.Contains(err.Error(), "HTTP 403") {
			ui.Errorf("Please edit the token used for hub at https://%s/settings/tokens\n", project.Host)
			ui.Errorln("and verify that the `delete_repo` scope is enabled.")
		}
		utils.Check(err)
		ui.Printf("Deleted repository '%s'.\n", project)
	}

	args.NoForward()
}

View on GitHub (pinned to 5c547ed804)

Solutions

  1. Type exactly `yes` (lowercase) at the prompt and press Enter.
  2. When scripting, echo the exact confirmation: `echo yes | hub delete-repository ...` (interactive prompts may still refuse; prefer running interactively).
  3. Use a --no/--noop-style dry run first to review what would be deleted before confirming.

Example fix

// before
$ hub delete-repository user/proj
Really delete? y     // Please type 'yes' for confirmation.
// after
$ hub delete-repository user/proj
Really delete? yes
Defensive patterns

Strategy: try-catch

Try / catch

answer := strings.TrimSpace(readLine())
if answer != "yes" {
    fmt.Println("aborted: repository not deleted")
    os.Exit(1)
}

Prevention

When it happens

Trigger: At the confirmation prompt for `hub delete-repository`, entering anything other than the literal string `yes` after TrimSpace (e.g. `y`, `Y`, `YES`, `yes ` variants already handled, empty Enter, or EOF from a non-interactive stdin where scanner.Scan() reads nothing).

Common situations: Piping input into the command with a word other than `yes`; running in CI where stdin is empty so answer stays empty; users instinctively typing `y` or `YES`; locale keyboard issues.

Related errors


AI-assisted analysis of mislav/hub@5c547ed804 (2026-09-01). Data as JSON: /api/errors/3d2a4d3e84b17088. Report an issue: GitHub.