plandex-ai/plandex · error

error prompting pin

Error message

error prompting pin: %v

What it means

After a successful CreateEmailVerification on a non-local host, verifyEmail prompts for the 6-character emailed pin via term.GetUserPasswordInput and wraps prompt failure as 'error prompting pin: %v'. It is a client-side input failure (non-interactive stdin, empty input, or abort) and notably does not occur in local mode, which skips the pin prompt entirely.

Solutions

  1. Run the command in an interactive terminal so the hidden password-style input works.
  2. Wait for the pin email (valid 5 minutes) before starting the prompt, or re-run to get a fresh pin.
  3. In Docker/CI, attach a TTY (docker run -it) or pre-authenticate interactively first.
  4. Re-run the auth flow if the prompt was aborted; the pin is re-requested on the next attempt.

Example fix

// before (no TTY)
echo pin | plandex auth
// after
plandex auth  # interactive prompt, enter pin when asked
Defensive patterns

Strategy: validation

Validate before calling

// require an interactive terminal before the hidden pin prompt
if stat, _ := os.Stdin.Stat(); stat == nil || (stat.Mode()&os.ModeCharDevice) == 0 {
    return fmt.Errorf("pin prompt requires an interactive terminal")
}

Try / catch

pin, err := term.GetUserPasswordInput("Please enter your pin:")
if err != nil {
    return fmt.Errorf("pin entry aborted (%v); re-run auth in an interactive terminal and enter the pin within 5 minutes", err)
}

Prevention

When it happens

Trigger: term.GetUserPasswordInput("Please enter your pin:") errors: stdin is not a TTY (CI/scripts), the user aborts the prompt, or input collection fails before the pin is sent to the server.

Common situations: Running the sign-in inside CI or a container without a TTY; piping input in ways the password prompt rejects; user hits Ctrl-C while waiting for the pin email to arrive.

Related errors


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/143c5a34d00fb72c. Report an issue: GitHub.

Appendix: source

Thrown at app/cli/auth/account.go:229

	if apiErr != nil {
		return nil, fmt.Errorf("error creating email verification: %v", apiErr.Msg)
	}

	if res.IsLocalMode {
		return &verifyEmailRes{
			hasAccount:  res.HasAccount,
			isLocalMode: true,
			pin:         "",
		}, nil
	}

	fmt.Println("✉️  You'll now receive a 6 character pin by email. It will be valid for 5 minutes.")

	pin, err := term.GetUserPasswordInput("Please enter your pin:")

	if err != nil {
		return nil, fmt.Errorf("error prompting pin: %v", err)
	}

	return &verifyEmailRes{
		hasAccount:  res.HasAccount,
		isLocalMode: false,
		pin:         pin,
	}, nil
}

func signIn(email, pin, host string) error {
	term.StartSpinner("")
	res, apiErr := apiClient.SignIn(shared.SignInRequest{
		Email: email,
		Pin:   pin,
	}, host)
	term.StopSpinner()

	if apiErr != nil {

View on GitHub (pinned to e2d772072e)