-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Event feedback breaks json output mode #19198
Copy link
Copy link
Labels
area/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationstatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.type/bug
Metadata
Metadata
Assignees
Labels
area/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationstatus/need-triageIssues that need to be triaged by the triage automation.Issues that need to be triaged by the triage automation.type/bug
Type
Fields
Give feedbackNo fields configured for Bug.
Projects
Status
Closed
What happened?
When I use an MCP server, along with JSON output, you get messages being printed to stdout before the json output, thus making it impossible to pipe-parse the output from gemini-cli with jq, eg:
gemini --yolo --prompt "${INPUT_COMMAND}" --output-format json 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"On stdout you get:
This appears to be coming from the MCP client
gemini-cli/packages/core/src/tools/mcp-client.ts
Line 399 in bb7bb11
What did you expect to happen?
informational messages like this should really go to stdout.
if stdout is also expected to be json however in output-mode=json, i'm not sure what to suggest.
Client information
Client Information
Run
geminito enter the interactive CLI, then run the/aboutcommand.Login information
No response
Anything else we need to know?
No response