{"record":{"id":"38388399305c1693","repo":"hasura/graphql-engine","slug":"error-in-getting-output-directory-input-w","errorCode":null,"errorMessage":"error in getting output directory input: %w","messagePattern":"error in getting output directory input: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/commands/actions_use_codegen.go","lineNumber":232,"sourceCode":"\t\t\tdestinationDir,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in copying starter kit: %w\", err))\n\t\t}\n\n\t\to.EC.Logger.Info(\"Starter kit cloned at \" + destinationDir)\n\t}\n\n\to.EC.Spinner.Stop()\n\n\t// if output directory is not provided, make them enter it\n\tif o.outputDir == \"\" {\n\t\toutputDir, err := util.GetFSPathPrompt(\n\t\t\t\"Where do you want to place the codegen files?\",\n\t\t\to.EC.Config.ActionConfig.Codegen.OutputDir,\n\t\t)\n\t\tif err != nil {\n\t\t\treturn errors.E(op, fmt.Errorf(\"error in getting output directory input: %w\", err))\n\t\t}\n\n\t\tnewCodegenExecutionConfig.OutputDir = outputDir\n\t} else {\n\t\tnewCodegenExecutionConfig.OutputDir = o.outputDir\n\t}\n\n\tnewConfig := o.EC.Config\n\tnewConfig.ActionConfig.Codegen = newCodegenExecutionConfig\n\n\terr = o.EC.WriteConfig(newConfig)\n\tif err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"error in writing config: %w\", err))\n\t}\n\n\to.EC.Spinner.Stop()\n\to.EC.Logger.Info(\"Codegen configuration updated in config.yaml\")\n","sourceCodeStart":214,"sourceCodeEnd":250,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/commands/actions_use_codegen.go#L214-L250","documentation":"Thrown when util.GetFSPathPrompt fails while interactively asking where to place codegen files (shown because --output-dir was omitted). Same TTY-dependent prompt failure family: it cannot read an answer from non-interactive stdin.","triggerScenarios":"Running `hasura actions use-codegen` without --output-dir in a non-interactive environment (CI, piped stdin, no TTY).","commonSituations":"Scripted/automated CLI runs missing the output-dir flag; docker/ssh sessions without terminal allocation.","solutions":["Pass --output-dir <path> explicitly in all scripted runs.","Run with an interactive TTY when you want to be prompted."],"exampleFix":"// before (CI)\nhasura actions use-codegen --framework nodejs-express --with-starter-kit\n// after\nhasura actions use-codegen --framework nodejs-express --with-starter-kit --output-dir src/generated","handlingStrategy":"validation","validationCode":"[ -t 0 ] || echo 'pass --output-dir explicitly in non-interactive shells'","typeGuard":null,"tryCatchPattern":"Catch prompt errors and re-run with an explicit --output-dir.","preventionTips":["Always pass --output-dir in scripts.","Allocate a TTY when prompting is desired."],"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"}