GrepBoard/Manuals
51 manuals ·

Fix Gemini CLI install and login errors

·Gemini CLI 0.64.0 · Node.js 24.22 · Ubuntu 24.04·8 steps

Install Gemini CLI, check the version, and work through common login blockers: auth errors, the org-subscription check, CI_ variables, and debug mode.

Install Gemini CLI, then go through the places where login usually fails.

[1] Check the Node.js version. The package requires Node 20 or later.

console
$ node -vv24.22.0

[2] Install. To run it once without installing, use npx @google/gemini-cli.

console
$ npm install -g @google/gemini-cli

[3] Check the version.

console
$ gemini --version0.64.0

[4] With no auth configured, a non-interactive (-p) run prints the message below and exits with code 41. This is expected before you sign in.

console
$ gemini -p "hi" </dev/nullPlease set an Auth method in your ~/.gemini/settings.json or specify one of the following environment variables before running: GEMINI_API_KEY, GOOGLE_GENAI_USE_VERTEXAI, GOOGLE_GENAI_USE_GCA$ echo $?41

[5] Run gemini and choose "Sign in with Google"; it opens a browser. The browser must be on a machine that can talk to the terminal running the CLI (doc).

[6] Match the error text to a cause. These are from the official troubleshooting doc (doc).

[7] If the interactive screen does not appear, look for a variable named CI or CONTINUOUS_INTEGRATION, or one starting with CI_. Any of these makes the CLI treat the environment as non-interactive. Drop it for that one command if you do not need it.

console
$ env | grep '^CI'$ env -u CI_TOKEN gemini

[8] If the cause is still unclear, run with --debug. In interactive mode, press F12 to open the debug console.

console
$ gemini --debug -p "hi" </dev/null

#gemini-cli#troubleshooting