plandex-ai/plandex · error

error prompting create org: %v

Error message

error prompting create org: %v

What it means

promptNoOrgs asks the user (ConfirmYesNo) whether to create a new org when they have access to none. This error wraps a failure of that yes/no prompt itself — not the subsequent org creation. It means the create-or-skip decision could not be read from the user.

Source

Thrown at app/cli/auth/org.go:45

		org = orgs[0]
	} else {
		org, err = selectOrg(orgs, isLocalMode)

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

	return org, nil
}

func promptNoOrgs() (*shared.Org, error) {
	fmt.Println("🧐 You don't have access to any orgs yet.\n\nTo join an existing org, ask an admin to either invite you directly or give your whole email domain access.\n\nOtherwise, you can go ahead and create a new org.")

	shouldCreate, err := term.ConfirmYesNo("Create a new org now?")

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

	if shouldCreate {
		return createOrg(false)
	}

	return nil, nil
}

func createOrg(isLocalMode bool) (*shared.Org, error) {
	var err error
	var name string
	var autoAddDomainUsers bool

	if isLocalMode {
		name = "Local Org"
	} else {
		name, err = term.GetRequiredUserStringInput("Org name:")

View on GitHub (pinned to e2d772072e)

Solutions

  1. Run the command in an interactive terminal
  2. Avoid redirecting stdin from /dev/null or a pipe for this command
  3. Pre-create or be invited to an org so the prompt never appears
  4. If automating, join an org beforehand and persist auth.json with an OrgId

Example fix

// before
echo | plandex status  # ConfirmYesNo gets EOF -> error prompting create org
// after
# run interactively once:
plandex status  # answer 'y' to create org; choice persisted to auth.json
Defensive patterns

Strategy: validation

Validate before calling

if !term.IsTerminal(os.Stdin.Fd()) {
	return fmt.Errorf("org-creation prompt requires an interactive terminal")
}

Type guard

func canConfirmInteractive() bool { return term.IsTerminal(os.Stdin.Fd()) }

Try / catch

_, err := promptNoOrgs()
if err != nil {
	if strings.Contains(err.Error(), "prompting create org") {
		fmt.Fprintln(os.Stderr, "Cannot read yes/no answer; run in a TTY or join an org in advance.", err)
		os.Exit(1)
	}
	return err
}

Prevention

When it happens

Trigger: term.ConfirmYesNo errors: stdin is not a TTY (piped input, CI), EOF on input, or the response cannot be parsed as yes/no.

Common situations: Running plandex in CI with no TTY; piping output/stdin (e.g. `plandex cmd < /dev/null`); restricted terminals or IDE embedded consoles without stdin.

Related errors


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