How to Install Gemini CLI

This guide explains how to install and use the Gemini CLI through
Node.js.

✅ Requirements

Node.js 18+ installed
npm (comes with Node)
A Google AI Studio API key (Optional)

1. Install the Gemini CLI

`npm install -g @g…


This content originally appeared on DEV Community and was authored by Shashwat Pritish

This guide explains how to install and use the Gemini CLI through
Node.js.

✅ Requirements

  • Node.js 18+ installed
  • npm (comes with Node)
  • A Google AI Studio API key (Optional)

1. Install the Gemini CLI

`npm install -g @google/generative-ai-cli`

This installs the global gemini command.

2. Authenticate

You can use your api key or your google account
gemini login --api-key YOUR_API_KEY

Or simply:

`gemini login`

Then paste your API key when prompted or select login via account and login into it

3. Test if it Works

`gemini prompt "Write a short hello world message."`

4. Use Gemini Models

Basic generation

`gemini generate --model gemini-1.5-flash --input "Explain what LLMs do."`

Streamed output

`gemini prompt --stream "Tell me an interesting fact about space."`

Provide a text file as input

`gemini generate --model gemini-1.5-pro --file notes.txt`

5. Update the CLI

`npm update -g @google/generative-ai-cli`


This content originally appeared on DEV Community and was authored by Shashwat Pritish


Print Share Comment Cite Upload Translate Updates
APA

Shashwat Pritish | Sciencx (2025-11-01T13:45:57+00:00) How to Install Gemini CLI. Retrieved from https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/

MLA
" » How to Install Gemini CLI." Shashwat Pritish | Sciencx - Saturday November 1, 2025, https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/
HARVARD
Shashwat Pritish | Sciencx Saturday November 1, 2025 » How to Install Gemini CLI., viewed ,<https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/>
VANCOUVER
Shashwat Pritish | Sciencx - » How to Install Gemini CLI. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/
CHICAGO
" » How to Install Gemini CLI." Shashwat Pritish | Sciencx - Accessed . https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/
IEEE
" » How to Install Gemini CLI." Shashwat Pritish | Sciencx [Online]. Available: https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/. [Accessed: ]
rf:citation
» How to Install Gemini CLI | Shashwat Pritish | Sciencx | https://www.scien.cx/2025/11/01/how-to-install-gemini-cli/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.