{"record":{"id":"bfb66c4279c66078","repo":"hasura/graphql-engine","slug":"error-in-getting-user-input-w","errorCode":null,"errorMessage":"error in getting user input: %w","messagePattern":"error in getting user input: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/actions_create.go","lineNumber":140,"sourceCode":"\t\t\treturn errors.E(\n\t\t\t\top,\n\t\t\t\tstderrors.New(`could not find codegen config. For adding codegen config, run:\n\n  hasura actions use-codegen`),\n\t\t\t)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\t// if with-codegen flag not present, ask them if they want to codegen\n\tvar confirmation bool\n\tif !o.withCodegen {\n\t\tconfirmation, err = util.GetYesNoPrompt(\n\t\t\t\"Do you want to generate \" + o.EC.Config.ActionConfig.Codegen.Framework + \" code for this action and the custom types?\",\n\t\t)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in getting user input: %w\", err))\n\t\t}\n\t}\n\n\tif !confirmation {\n\t\tinfoMsg := fmt.Sprintf(`You skipped codegen. For getting codegen for this action, run:\n\n  hasura actions codegen %s\n`, o.name)\n\t\to.EC.Logger.Info(infoMsg)\n\n\t\treturn nil\n\t}\n\n\tif err := o.EC.SetupCodegenAssetsRepo(); err != nil {\n\t\to.EC.Logger.Errorf(\n\t\t\t\"failed generating code: setting up codegen-assets repo failed (this is required for automatically generating actions code): %v\",\n\t\t\terr,\n\t\t)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/actions_create.go#L122-L158","documentation":"Thrown when the interactive yes/no prompt asking whether to generate framework code (util.GetYesNoPrompt) fails. These prompt helpers fail when there is no interactive TTY on stdin — e.g. when the command runs in a script, pipe, or CI without --with-codegen specified.","triggerScenarios":"Running `hasura actions create` in a non-interactive shell (CI, docker exec without -t, piped stdin) where a codegen framework is configured but the --with-codegen flag was not passed, forcing the CLI to prompt.","commonSituations":"Automating actions create in CI without flags; running through ssh with no TTY; stdin redirected from /dev/null.","solutions":["Pass --with-codegen (or run in a real terminal) so no prompt is needed.","Ensure stdin is a TTY when interactive behavior is desired (e.g. `docker exec -it`, ssh -t).","In scripts, always specify all flags explicitly to avoid prompts entirely."],"exampleFix":"// before (CI, no TTY)\nhasura actions create doSomething --derive-from 'query {...}'\n// after\nhasura actions create doSomething --derive-from 'query {...}' --with-codegen","handlingStrategy":"validation","validationCode":"[ -t 0 ] || echo 'stdin is not a TTY: pass --with-codegen explicitly'","typeGuard":null,"tryCatchPattern":"Catch prompt errors and re-run with explicit flags (--with-codegen) or allocate a TTY.","preventionTips":["Always pass --with-codegen / skip flags in automation.","Use `docker exec -it` / `ssh -t` for interactive runs."],"tags":["interactive-prompt","tty","hasura-cli","ci"],"backgroundTag":"non-interactive-prompt-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}