Getting started with new AI tools can sometimes feel overwhelming, especially when initial setup steps seem convoluted. If you're diving into Google Gemini CLI for your AI and large language model (LLM) projects, this guide is here to streamline your process. We'll walk through the essential steps to install, configure, and activate the Gemini CLI, so you can focus on building and experimenting with language models rather than wrestling with setup.
Google Gemini CLI is an open-source tool designed to enhance AI development workflows. It enables developers to interact with large language models via command-line, manage virtual environments, and integrate models with various datasets and tools. Installing it properly lays the foundation for efficient, scalable AI projects.
Step-by-Step Guide to Installing Gemini CLI
1. Prerequisites
Before beginning, ensure your system meets these requirements:
- Python 3.8 or higher
- pip package manager
- Git installed
- A Google account (to get a free Gemini Code Assist license)
2. Clone the Gemini CLI Repository
Start by downloading the latest version of Gemini CLI from GitHub:
git clone https://github.com/google-gemini/gemini-cli.git
cd gemini-cli
This command fetches the codebase and prepares your environment for installation.
3. Create a Virtual Environment
Creating an isolated environment ensures your setup remains clean and manageable:
python -m venv gemini-env
Here, gemini-env
is the name of your virtual environment.
4. Activate the Virtual Environment
Depending on your OS, activate the environment:
- On Windows:
gemini-env\Scripts\activate
- On macOS/Linux:
source gemini-env/bin/activate
Once activated, your terminal prompt should indicate the active environment.
5. Install Required Packages
With the virtual environment active, install the necessary dependencies:
pip install -r requirements.txt
This will install all the packages needed for Gemini CLI to function smoothly.
6. Set Up Your Google Gemini Account
To interact with Gemini, you'll need a Gemini Code Assist license:
- Sign into your Google account.
- Visit the Gemini Code Assist license page to apply for or retrieve your license.
- Configure your license in the CLI by setting environment variables or following the instructions in the Gemini CLI documentation.
Using these steps, you’ll have high request limits to experiment freely.
7. Verify the Installation
Ensure everything is correctly set up:
gemini --help
This command should display help information about Gemini CLI commands, confirming successful installation.
8. Start Using Gemini CLI
Now, you're ready to run commands, generate code, or manage models:
- Generate HTML and JS code with Tailwind:
gemini prompt "Build me a landing page with a cat cafe in San Francisco."
- Save facts with memory tool:
gemini memory save "Mun cats are adorable."
- Access model search and image generation features via MCPs for advanced tasks.
Summary: Quick Reference Cheat Sheet
Step | Command / Action | Notes |
---|---|---|
Clone repo | git clone https://github.com/google-gemini/gemini-cli.git | Fetch latest Gemini CLI code |
Create virtual environment | python -m venv gemini-env | Isolate dependencies |
Activate environment | Windows: gemini-env\Scripts\activate macOS/Linux: source gemini-env/bin/activate | Prepare for package installation |
Install dependencies | pip install -r requirements.txt | Set up necessary packages |
Verify installation | gemini --help | Confirm CLI is working |
Get license | Sign in to Google account and get Gemini license | Enable API request limits |
Setting up the Google Gemini CLI might seem daunting at first, but following these steps simplifies the process. Once configured, you'll unlock powerful capabilities like code generation, dataset access, and multi-model management—all from your terminal. This setup forms the backbone of productive AI development workflows, whether you're building LLM agents, experimenting with datasets, or deploying models.
More resources?
Summary with key points
Watch on Youtube