plandex-ai/plandex · error

error selecting sign in option: %v

Error message

error selecting sign in option: %v

What it means

promptSignInNewAccount wraps a failure from term.SelectFromList, which asks whether to use the local-mode host or another host, as 'error selecting sign in option: %v'. This is an interactive prompt failure, not a server error — it happens before any network call.

Source

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

	if err != nil {
		return fmt.Errorf("error selecting or signing in to account: %v", err)
	}

	return nil
}

const (
	// SignInCloudOption = "Plandex Cloud"
	SignInLocalOption = "Local mode host"
	SignInOtherOption = "Another host"
)

func promptSignInNewAccount() error {
	selected, err := term.SelectFromList("Use local mode or another host?", []string{SignInLocalOption, SignInOtherOption})

	if err != nil {
		return fmt.Errorf("error selecting sign in option: %v", err)
	}

	var host string
	var email string

	if selected == SignInLocalOption {
		host, err = term.GetRequiredUserStringInputWithDefault("Host:", "http://localhost:8099")
	} else {
		host, err = term.GetRequiredUserStringInput("Host:")
	}

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

	if selected == SignInLocalOption {
		email = "local-admin@plandex.ai"
	} else {

View on GitHub (pinned to e2d772072e)

Solutions

  1. Run the command in an interactive terminal with a valid TTY.
  2. If in Docker/CI, use `docker run -it` or ensure stdin is attached before triggering auth setup.
  3. Re-run the command and complete the selection instead of aborting with Ctrl-C.
  4. Pre-create an authenticated session interactively, then run scripted commands non-interactively.

Example fix

// before (CI, no TTY)
plandex auth sign-in
// after (allocate a TTY)
docker run -it plandex ./plandex auth sign-in
Defensive patterns

Strategy: validation

Validate before calling

// ensure stdin is interactive before entering the sign-in flow
if stat, _ := os.Stdin.Stat(); stat == nil || (stat.Mode()&os.ModeCharDevice) == 0 {
    return fmt.Errorf("interactive terminal required for sign-in option selection")
}

Try / catch

selected, err := term.SelectFromList("Use local mode or another host?", opts)
if err != nil {
    return fmt.Errorf("selection aborted (%v); re-run in an interactive terminal", err)
}

Prevention

When it happens

Trigger: term.SelectFromList("Use local mode or another host?", [SignInLocalOption, SignInOtherOption]) returns an error: stdin is not an interactive TTY, the user aborts (Ctrl-C), or the terminal UI cannot render the selection list.

Common situations: Running plandex inside CI or a Docker container without a TTY; piping stdin; running in an unusual terminal emulator or restricted environment; user cancels the prompt.

Related errors


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