Skip to main content

System Requirements

Before installing Gemini CLI, ensure your system meets the following requirements:

Operating System

  • macOS 15+
  • Windows 11 24H2+
  • Ubuntu 20.04+

Runtime & Tools

  • Node.js 20.0.0+
  • Bash, Zsh, or PowerShell
  • Internet connection required
4GB+ RAMSuitable for:
  • Short sessions
  • Common tasks and edits
  • Basic code analysis
Cloud Users: Gemini CLI comes pre-installed on Cloud Shell and Cloud Workstations.

Installation Methods

Choose the installation method that best fits your environment: The standard method to install Gemini CLI globally:
npm install -g @google/gemini-cli
Once installed, verify the installation:
gemini --version

Install with Homebrew (macOS/Linux)

If you prefer using Homebrew:
brew install gemini-cli
Verify the installation:
gemini --version

Install with MacPorts (macOS)

For MacPorts users:
sudo port install gemini-cli

Install with Anaconda (Restricted Environments)

Ideal for environments with restricted package managers:
1

Create Conda Environment

Create and activate a new environment with Node.js:
conda create -y -n gemini_env -c conda-forge nodejs
conda activate gemini_env
2

Install Gemini CLI

Install Gemini CLI globally via npm inside the environment:
npm install -g @google/gemini-cli
3

Verify Installation

Test the installation:
gemini --version
Remember to activate the conda environment (conda activate gemini_env) before using Gemini CLI.

Running Gemini CLI

After installation, you can run Gemini CLI using several methods:

Standard Usage

Simply run the gemini command:
gemini
Start in a specific directory with additional context:
gemini --include-directories ../lib,../docs
Use a specific model:
gemini -m gemini-2.5-flash

Run with npx (No Installation)

You can run Gemini CLI without permanent installation:
# Run the latest published version
npx @google/gemini-cli
Run directly from the main branch on GitHub (useful for testing features in development):
npx https://github.com/google-gemini/gemini-cli
Using npx is great for trying out Gemini CLI without committing to a global installation.

Run in a Sandbox (Docker/Podman)

For security and isolation, run Gemini CLI inside a container:
# Run the published sandbox image
docker run --rm -it us-docker.pkg.dev/gemini-code-dev/gemini-cli/sandbox:0.1.1
Sandbox mode is the default way that the CLI executes tools that might have side effects, providing an extra layer of security.

Run from Source (Contributors)

If you’re contributing to Gemini CLI, you can run it directly from source:
Provides hot-reloading for active development:
# From the root of the repository
npm run start

Release Channels

Gemini CLI offers three release channels to suit different needs: New stable releases are published weekly. This is the default and recommended channel:
npm install -g @google/gemini-cli@latest
# or simply
npm install -g @google/gemini-cli
Stable releases are promoted from the previous week’s preview release along with any bug fixes.

Preview

Test upcoming features before they reach stable. Published weekly but may contain issues:
npm install -g @google/gemini-cli@preview
Preview releases are not fully vetted and may contain regressions or outstanding issues. Use for testing only.

Nightly

Get the latest changes from the main branch. Published daily:
npm install -g @google/gemini-cli@nightly
Nightly builds include all changes from the main branch and should be assumed to have pending validations and issues.

Non-Interactive Mode (Scripting)

Gemini CLI can be used in automated workflows and scripts:
# Get a simple text response
gemini -p "Explain the architecture of this codebase"

Verifying Installation

After installation, verify everything is working:
1

Check Version

gemini --version
2

Run Help Command

gemini --help
3

Test Run

gemini
This will start the interactive CLI and prompt you to authenticate.

Troubleshooting

Gemini CLI requires Node.js 20.0.0 or higher. Update Node.js:
# Using nvm
nvm install 20
nvm use 20

# Or download from nodejs.org
If you get permission errors, try:
# Option 1: Use sudo (not recommended)
sudo npm install -g @google/gemini-cli

# Option 2: Fix npm permissions (recommended)
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
npm install -g @google/gemini-cli
Make sure your PATH includes the npm global bin directory:
# Check npm bin location
npm bin -g

# Add to PATH if needed (add to ~/.bashrc or ~/.zshrc)
export PATH="$(npm bin -g):$PATH"

Next Steps

Set Up Authentication

Configure OAuth, API key, or Vertex AI authentication

Quick Start Guide

Get to your first working command in minutes

Build docs developers (and LLMs) love