gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Gemini CLI takes up to 39 seconds to load on Windows

Open doggy8088 opened this issue 2 months ago • 6 comments

What happened?

The wait is far too long.

https://github.com/user-attachments/assets/d31fc4d7-62bf-4281-b131-ac7c4b6fbe2c

What did you expect to happen?

In Linux, it took only 7 seconds.

I expected the loading time to be within 10 seconds on Windows.

Client information

Client Information

Run gemini to enter the interactive CLI, then run the /about command.

> /about
╭─────────────────────────────────────────────────╮
│                                                 │
│ About Gemini CLI                                │
│                                                 │
│ CLI Version     0.9.0                           │
│ Git Commit      a93d92a3                        │
│ Model           gemini-2.5-pro                  │
│ Sandbox         no sandbox                      │
│ OS              win32                           │
│ Auth Method     OAuth                           │
│                                                 │
╰─────────────────────────────────────────────────╯

Login information

Google Account

Anything else we need to know?

No response

doggy8088 avatar Oct 20 '25 14:10 doggy8088

The significant delay you're seeing with Gemini CLI on Windows happens before its main application code (start.js) even begins to run. This is due to the "cold start" overhead inherent in any non-trivial Node.js application.

Before your script is executed, Node.js performs several time-consuming steps:

  1. Process and Runtime Setup: The operating system creates a node process, and the Node.js runtime initializes its core components, including the V8 JavaScript engine and the event loop.
  2. Recursive Module Loading: The most significant delay comes from Node.js having to find, read, and parse all required modules and their dependencies from the node_modules directory. For a large project like Gemini CLI with hundreds of dependencies, this involves a massive number of file system operations, which is notably slower on Windows compared to Linux.

In short, the startup time is largely a fixed cost of the Node.js runtime preparing the environment and loading the extensive dependencies of the Gemini CLI, all of which happens before the tool's own logic starts executing.

I tried running the gemini in windows and it takes 16-18 seconds for me start up gemini.

megha1188 avatar Nov 03 '25 07:11 megha1188

As far as I know, Claude Code recently switched to using Bun to compile into a single executable file ( Source here ). I wonder if Gemini CLI is also considering doing the same?

doggy8088 avatar Nov 03 '25 08:11 doggy8088

/assign

JuanCS-Dev avatar Nov 26 '25 21:11 JuanCS-Dev

👋 @JuanCS-Dev! You currently have 3 issues assigned to you. We have a 3 max issues assigned at once policy. Once you close out an existing issue it will open up space to take another. You can also unassign yourself from an existing issue but please work on a hand-off if someone is expecting work on that issue.

gemini-cli[bot] avatar Nov 26 '25 21:11 gemini-cli[bot]

Running gemini cli through cmd.exe is much faster than PowerShell. The issue is with PowerShell's handling of the gemini.cmd wrapper, not the Gemini CLI itself.

PowerShell executes .cmd files by spawning cmd.exe as a child process with additional overhead for script parsing, security checks, and I/O redirection. Direct node execution or using cmd.exe directly bypasses this overhead.

The way I have addressed this issue is by Creating a function in my PowerShell profile that calls node directly:

function gemini {
    & node "%APPDATA%\Roaming\npm\node_modules\@google\gemini-cli\dist\index.js" @args
}

This workaround has solved the issue for me.

gbks121 avatar Dec 04 '25 12:12 gbks121

@gbks121 I tried this, but the launch still took very long time.

node "C:\Program Files\nodejs/node_modules/@google/gemini-cli/dist/index.js"

doggy8088 avatar Dec 05 '25 03:12 doggy8088