{"record":{"id":"637551efbc8512a2","repo":"google-gemini/gemini-cli","slug":"exiting-due-to-command-result-that-is-not-supporte","errorCode":null,"errorMessage":"Exiting due to command result that is not supported in non-interactive mode.","messagePattern":"Exiting due to command result that is not supported in non-interactive mode\\.","errorType":"exception","errorClass":"FatalInputError","httpStatus":null,"severity":"error","filePath":"packages/cli/src/nonInteractiveCliCommands.ts","lineNumber":104,"sourceCode":"\n      const result = await commandToExecute.action(commandContext, args);\n\n      if (result) {\n        switch (result.type) {\n          case 'submit_prompt':\n            return result.content;\n          case 'confirm_shell_commands':\n            // This result indicates a command attempted to confirm shell commands.\n            // However note that currently, ShellTool is excluded in non-interactive\n            // mode unless 'YOLO mode' is active, so confirmation actually won't\n            // occur because of YOLO mode.\n            // This ensures that if a command *does* request confirmation (e.g.\n            // in the future with more granular permissions), it's handled appropriately.\n            throw new FatalInputError(\n              'Exiting due to a confirmation prompt requested by the command.',\n            );\n          default:\n            throw new FatalInputError(\n              'Exiting due to command result that is not supported in non-interactive mode.',\n            );\n        }\n      }\n    }\n  }\n\n  return;\n};\n","sourceCodeStart":86,"sourceCodeEnd":114,"githubUrl":"https://github.com/google-gemini/gemini-cli/blob/5024443c7217464a66e98f80d73172a26440bd8f/packages/cli/src/nonInteractiveCliCommands.ts#L86-L114","documentation":"The default branch of the slash-command result switch in non-interactive mode: the command returned a result type that is not 'submit_prompt' or 'confirm_shell_commands'. It is a FatalInputError (exit code 42). Only prompt submission and (defensively) confirmation are supported outside interactive mode; any other result shape is rejected.","triggerScenarios":"A slash command returns a result object whose .type is something other than 'submit_prompt'/'confirm_shell_commands' while running non-interactively.","commonSituations":"A custom command designed for interactive UI flows (e.g. opening a picker, rendering a panel) is invoked via `gemini -p`; an upgraded command emits a new result type not yet handled in non-interactive mode.","solutions":["Run that command in interactive mode where its result type is supported.","Update the custom command to return 'submit_prompt' with content for non-interactive compatibility.","Check the command's supported modes in its docs before using it in a pipeline."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const NON_INTERACTIVE_RESULT_TYPES = new Set(['submit_prompt']);\nfunction supportsNonInteractive(resultType: string): boolean {\n  return NON_INTERACTIVE_RESULT_TYPES.has(resultType);\n}","typeGuard":"function isSubmitPrompt(r: { type: string; content?: unknown }): boolean {\n  return r.type === 'submit_prompt' && typeof r.content !== 'undefined';\n}","tryCatchPattern":"try {\n  await runNonInteractive();\n} catch (e) {\n  if (e instanceof FatalInputError && /not supported in non-interactive mode/.test(e.message)) {\n    // exit code 42: run this command interactively instead\n  }\n  throw e;\n}","preventionTips":["Check a command's supported modes before using it in non-interactive runs.","Design custom commands to return 'submit_prompt' for non-interactive compatibility.","Keep UI-only commands out of CI pipelines."],"tags":["non-interactive","slash-command","input","compatibility"],"backgroundTag":null,"analyzedSha":"5024443c7217464a66e98f80d73172a26440bd8f","analyzedAt":"2026-08-12T06:01:53.711Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}