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
- Run the command in an interactive terminal
- Avoid redirecting stdin from /dev/null or a pipe for this command
- Pre-create or be invited to an org so the prompt never appears
- 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
- Never redirect stdin from /dev/null or a pipe for onboarding commands
- Join or create an org beforehand so the prompt is skipped
- Run onboarding in a real terminal or IDE-integrated shell with stdin
- Persist auth.json with OrgId so the empty-org path never triggers
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
- error prompting no orgs: %v
- error selecting sign in option: %v
- error prompting pin: %v
- error selecting org: %v
- error confirming update and rebuild: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/a5bd04c7fb32e944.
Report an issue: GitHub.