Skip to content

How to Install Gemini CLI

Learn how to install and configure the Gemini CLI on your system with this step-by-step guide covering prerequisites, installation, and verification.

  1. 1

    Check Prerequisites

    Ensure you have Node.js 18 or later installed on your system. Open a terminal and run 'node --version' to verify. You also need npm or yarn as your package manager.

  2. 2

    Install Gemini CLI Globally

    Run 'npm install -g @google/gemini-cli' in your terminal. This installs the Gemini CLI globally so you can access it from any directory on your system.

  3. 3

    Authenticate with Your API Key

    Run 'gemini auth login' and follow the prompts to authenticate. You can also set the GEMINI_API_KEY environment variable directly if you prefer non-interactive setup.

  4. 4

    Verify the Installation

    Run 'gemini --version' to confirm the CLI is installed correctly. You should see the version number printed to the console.

  5. 5

    Configure Your Workspace

    Navigate to your project directory and run 'gemini init' to create a local configuration file. This sets up project-specific settings and preferences.