Gemini CLI

This repository contains the Gemini CLI, a command-line AI workflow tool that connects to your
tools, understands your code and accelerates your workflows.
With the Gemini CLI you can:
- Query and edit large codebases in and beyond Gemini's 1M token context window.
- Generate new apps from PDFs or sketches, using Gemini's multimodal capabilities.
- Automate operational tasks, like querying pull requests or handling complex rebases.
- Use tools and MCP servers to connect new capabilities, including media generation with Imagen,
Veo or Lyria.
- Ground your queries with the Google Search
tool, built in to Gemini.
Quickstart
- Install Node 18+.
- Run the Gemini CLI from your shell using the following command:
npx https://github.com/google-gemini/gemini-cli
- When prompted, sign in with your Google account
- Enjoy!
When you login with your Google account, you get up to 60 model requests per minute and 1,000 model requests per day using Gemini 2.5 Pro. Alternatively, if you prefer to use a specific model or need more capacity, you can:
- Get an API key from Google AI Studio.
- Set the API key in your shell using the following command, replacing
YOUR_API_KEY with the API key you obtained: export GEMINI_API_KEY="YOUR_API_KEY" or store it in an .env file.
Examples
Once the CLI is running, you can start interacting with Gemini from your shell.
You can start a project from a new directory:
$ cd new-project/
$ gemini
> Write me a Gemini Discord bot that answers questions using a FAQ.md file I will provide
Or work with an existing project:
$ git clone https://github.com/google-gemini/gemini-cli
$ cd gemini-cli
$ gemini
> Give me a summary of all of the changes that went in yesterday
API Key Setup
The Gemini CLI requires you to authenticate with Google's AI services. You'll need to configure one of the following authentication methods:
Next Steps
Gemini APIs
This project leverages the Gemini APIs to provide AI capabilities. For details on the terms of service governing the Gemini API, please refer to the Gemini API Terms of Service.