{"record":{"id":"a5bd04c7fb32e944","repo":"plandex-ai/plandex","slug":"error-prompting-create-org-v","errorCode":null,"errorMessage":"error prompting create org: %v","messagePattern":"error prompting create org: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/org.go","lineNumber":45,"sourceCode":"\t\torg = orgs[0]\n\t} else {\n\t\torg, err = selectOrg(orgs, isLocalMode)\n\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error selecting org: %v\", err)\n\t\t}\n\t}\n\n\treturn org, nil\n}\n\nfunc promptNoOrgs() (*shared.Org, error) {\n\tfmt.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.\")\n\n\tshouldCreate, err := term.ConfirmYesNo(\"Create a new org now?\")\n\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error prompting create org: %v\", err)\n\t}\n\n\tif shouldCreate {\n\t\treturn createOrg(false)\n\t}\n\n\treturn nil, nil\n}\n\nfunc createOrg(isLocalMode bool) (*shared.Org, error) {\n\tvar err error\n\tvar name string\n\tvar autoAddDomainUsers bool\n\n\tif isLocalMode {\n\t\tname = \"Local Org\"\n\t} else {\n\t\tname, err = term.GetRequiredUserStringInput(\"Org name:\")","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/org.go#L27-L63","documentation":"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.","triggerScenarios":"term.ConfirmYesNo errors: stdin is not a TTY (piped input, CI), EOF on input, or the response cannot be parsed as yes/no.","commonSituations":"Running plandex in CI with no TTY; piping output/stdin (e.g. `plandex cmd < /dev/null`); restricted terminals or IDE embedded consoles without stdin.","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"],"exampleFix":"// before\necho | plandex status  # ConfirmYesNo gets EOF -> error prompting create org\n// after\n# run interactively once:\nplandex status  # answer 'y' to create org; choice persisted to auth.json","handlingStrategy":"validation","validationCode":"if !term.IsTerminal(os.Stdin.Fd()) {\n\treturn fmt.Errorf(\"org-creation prompt requires an interactive terminal\")\n}","typeGuard":"func canConfirmInteractive() bool { return term.IsTerminal(os.Stdin.Fd()) }","tryCatchPattern":"_, err := promptNoOrgs()\nif err != nil {\n\tif strings.Contains(err.Error(), \"prompting create org\") {\n\t\tfmt.Fprintln(os.Stderr, \"Cannot read yes/no answer; run in a TTY or join an org in advance.\", err)\n\t\tos.Exit(1)\n\t}\n\treturn err\n}","preventionTips":["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"],"tags":["interactive-prompt","tty","org"],"backgroundTag":"non-interactive-terminal","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}