gemini is not recognized on Windows 😭

When I tried to run the Gemini CLI, the command wasn’t recognized on Windows 11, even though I could install Gemini CLI without any errors.

$ gemini -v
gemini: The term 'gemini' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
npm install -g @google/gemini-cli

First, I tried to check the path of the Gemini CLI

$ which gemini
which: The term 'which' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Then I noticed why I was facing this issue, because of mise.

I tried to check the path of the Gemini CLI again with mise

$ mise which gemini
C:\Users\username\scoop\apps\mise\current\mise\installs\node\22.14.0\gemini.cmd

When I used the above path, my Warp showed Gemini.

To avoid the hassle of calling the path every time, I defined it as a function in the profile so it can be executed with Gemini.

code $HOME\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

Added the following to profile

# Gemini CLI function
function Invoke-Gemini {
C:\Users\username\scoop\apps\mise\current\mise\installs\node\22.14.0\gemini.cmd @args
}
Set-Alias -Name gemini -Value Invoke-Gemini
# check gemini cli version
$ gemini -v
0.1.10
# test a simple prompt
$ gemini -p "tell me about Gemni CLI"
Loaded cached credentials.
I am Gemini, a large language model from Google, accessed through this command-line interface.
My purpose is to assist you with software engineering tasks. I can interact with your local file system to:
* Read, write, and search through your code.
* Execute shell commands to run builds, tests, or other tools.
* Help you with tasks like debugging, refactoring, adding features, or creating new applications.
I operate by analyzing your requests and the provided project context, then using my available tools to help you achieve your goal.

Leave a Reply