Gemini CLI takes up to 39 seconds to load on Windows
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
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:
- Process and Runtime Setup: The operating system creates a
nodeprocess, and the Node.js runtime initializes its core components, including the V8 JavaScript engine and the event loop. - 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_modulesdirectory. 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.
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?
/assign
👋 @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.
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 I tried this, but the launch still took very long time.
node "C:\Program Files\nodejs/node_modules/@google/gemini-cli/dist/index.js"