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
Required18.0.0 or higher
JavaScript runtime required for NPM installation
NPM
Required8.0.0 or higher
Package manager (comes with Node.js)
Git
Latest
Version control system (optional, for source builds)
Google Account
RequiredActive
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
Easynpm install -g @google/gemini-cli
Supported Platforms:
Direct Download
Download pre-built binaries for your platform
EasyDownload from GitHub releases
Supported Platforms:
Build from Source
Compile from source code for advanced users
Advancedgit clone && npm run build
Supported Platforms:
Step-by-Step Installation
Follow these detailed steps to install Gemini CLI using NPM (recommended method).
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
Install Gemini CLI
Use NPM to install Gemini CLI globally on your system.
npm install -g @google/gemini-cli
Verify Installation
Check that Gemini CLI is installed correctly and accessible from your terminal.
gemini --version
gemini --help
Authenticate with Google
Run Gemini CLI and follow the authentication prompts, or set up your API key.
gemini
export GEMINI_API_KEY="YOUR_API_KEY"
Test Your Installation
Run your first Gemini CLI command to ensure everything is working.
gemini
> 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.