Install Gemini CLIComplete Guide 2025

Get started with Google's official open-source AI agent in minutes. Gemini CLI brings powerful codebase analysis, workflow automation, and multimodal AI capabilities directly to your terminal.

✅ FREE: 1000 API calls per day (no credit card required)

System Requirements

Before installing Gemini CLI, make sure your system meets these requirements.

Node.js

Required

18.0.0 or higher

JavaScript runtime required for NPM installation

NPM

Required

8.0.0 or higher

Package manager (comes with Node.js)

Git

Latest

Version control system (optional, for source builds)

Google Account

Required

Active

Required for API authentication

Installation Methods

Choose the installation method that works best for your setup.

📦

NPM Installation (Recommended)

Install globally using Node Package Manager

Easy
npm install -g @google/gemini-cli

Supported Platforms:

WindowsmacOSLinux
View on NPM
⬇️

Direct Download

Download pre-built binaries for your platform

Easy
Download from GitHub releases

Supported Platforms:

WindowsmacOSLinux
Download Releases
🔧

Build from Source

Compile from source code for advanced users

Advanced
git clone && npm run build

Supported Platforms:

WindowsmacOSLinux
View Build Guide

Step-by-Step Installation

Follow these detailed steps to install Gemini CLI using NPM (recommended method).

1

Install Node.js and NPM

Download and install Node.js from the official website. NPM comes bundled with Node.js.

# Check if Node.js is installed
node --version
npm --version
2

Install Gemini CLI

Use NPM to install Gemini CLI globally on your system.

npm install -g @google/gemini-cli
3

Verify Installation

Check that Gemini CLI is installed correctly and accessible from your terminal.

gemini --version
gemini --help
4

Authenticate with Google

Run Gemini CLI and follow the authentication prompts, or set up your API key.

gemini
Or set API key:
export GEMINI_API_KEY="YOUR_API_KEY"

Test Your Installation

Run your first Gemini CLI command to ensure everything is working.

gemini
# Then in the interactive session:
> Hello, world!

Troubleshooting Common Issues

Having trouble with installation? Here are solutions to the most common problems.

⚠️

Permission denied error

Run with sudo on macOS/Linux or as Administrator on Windows

sudo npm install -g @google/gemini-cli
⚠️

Command not found after installation

Add NPM global bin directory to your PATH

echo $PATH | grep npm
⚠️

Authentication failed

Set up authentication by running Gemini CLI or setting your API key

export GEMINI_API_KEY="YOUR_API_KEY"
⚠️

Network timeout during installation

Use a different NPM registry or check firewall settings

npm config set registry https://registry.npmjs.org/

Installation Complete! What's Next?

Now that you have Gemini CLI installed, explore these next steps to get the most out of your setup.