{"record":{"id":"d869af6fbaf771a2","repo":"plandex-ai/plandex","slug":"error-prompting-org-name-v","errorCode":null,"errorMessage":"error prompting org name: %v","messagePattern":"error prompting org name: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/auth/org.go","lineNumber":66,"sourceCode":"\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:\")\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error prompting org name: %v\", err)\n\t}\n\n\tif !isLocalMode {\n\t\tautoAddDomainUsers, err = promptAutoAddUsersIfValid(Current.Email)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error prompting auto add domain users: %v\", err)\n\t\t}\n\t}\n\n\tterm.StartSpinner(\"\")\n\tres, apiErr := apiClient.CreateOrg(shared.CreateOrgRequest{\n\t\tName:               name,\n\t\tAutoAddDomainUsers: autoAddDomainUsers,\n\t})\n\tterm.StopSpinner()\n\n\tif apiErr != nil {\n\t\treturn nil, fmt.Errorf(\"error creating org: %v\", apiErr.Msg)","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/auth/org.go#L48-L84","documentation":"This error wraps a failure from term.GetRequiredUserStringInput when the CLI prompts the user for an org name during createOrg. It means the interactive prompt failed (e.g. stdin was closed or unreadable) before an org name could be captured, so org creation aborts. It only fires in non-local mode, since local mode hardcodes the name \"Local Org\".","triggerScenarios":"Running a command that calls createOrg via resolveOrgAuth, promptNoOrgs, or selectOrg when term.GetRequiredUserStringInput(\"Org name:\") returns an error — typically stdin is not a TTY / is closed, or the input reader hit EOF or an I/O error.","commonSituations":"Running plandex in CI or a piped/non-interactive shell where no terminal is attached; triggering first-run org creation in a scripted environment; terminal input stream broken after suspend/resume or redirect.","solutions":["Run the command in an interactive terminal with stdin attached to a TTY","In CI/scripts, avoid triggering org creation interactively — create the org ahead of time or use local mode","Check that the terminal input stream is healthy (no closed/redirected stdin)","Re-run the command; transient I/O errors on stdin may resolve on retry"],"exampleFix":"// before (non-interactive shell)\necho | plenderish-cli some-command   # prompts \"Org name:\" -> EOF error\n// after\nplandex-cli some-command             # run interactively, answer \"Org name:\" prompt","handlingStrategy":"validation","validationCode":"// before invoking a flow that may prompt for an org name\nfi, err := os.Stdin.Stat()\nif err != nil || (fi.Mode()&os.ModeCharDevice) == 0 {\n    return fmt.Errorf(\"org creation requires an interactive terminal; stdin is not a TTY\")\n}","typeGuard":null,"tryCatchPattern":"org, err := auth.CreateOrg(false)\nif err != nil {\n    if strings.Contains(err.Error(), \"error prompting org name\") {\n        // fall back to non-interactive path or instruct user to run in a TTY\n    }\n    return err\n}","preventionTips":["Always run org-creating commands in an interactive shell","In CI, pre-create the org or use local mode to skip prompting","Never pipe/redirect stdin for commands that prompt","Check isatty on stdin before launching interactive flows"],"tags":["cli","interactive-input","stdin"],"backgroundTag":"non-interactive-terminal-prompt","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}