Skip to content

[Windows] Failed to spawn Gemini CLI: "batch file arguments are invalid" #5911

@iyang1016

Description

@iyang1016

Describe the bug

I am encountering an error when Goose attempts to spawn the Gemini CLI on Windows. The process fails immediately with a "batch file arguments are invalid" error.

It seems like Goose is trying to execute the .cmd shim for the Gemini CLI (installed via npm) but the arguments or the spawn method are not compatible with how Windows handles batch file execution.

To Reproduce

Steps to reproduce the behavior:

  1. Install the Gemini CLI via npm globally on Windows (npm install -g @google/gemini-cli or similar).
  2. Configure Goose to use the Gemini CLI provider.
  3. Run a command that triggers the Gemini CLI.
  4. See error.

Expected behavior

Goose should successfully spawn the Gemini CLI process and communicate with it.

Error Logs

Ran into this error: Request failed: Failed to spawn Gemini CLI command '"C:\Users\yano\AppData\Roaming\npm\gemini.cmd"': batch file arguments are invalid. Make sure the Gemini CLI is installed and available in the configured search paths..

Desktop Information

  • OS: Windows
  • Goose Version: [Insert version if known]
  • Gemini CLI Path: C:\Users\yano\AppData\Roaming\npm\gemini.cmd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions