# Gemini CLI: Complete Install in Minutes (Step-by-Step Tutorial)

Gemini CLI brings Google’s open-source coding agent to the terminal. I’ll cover installation, commands, pricing, and a few ways to use it on a project.

Author: Vladislav Guzey
Published: 2025-06-27
Canonical: https://proflead.dev/posts/gemini-cli-tutorial/


<div class="videoWrapper">
  <iframe width="100%" src="https://www.youtube.com/embed/Gm8XjcNQ1Vk?si=PZjKI6pmjuEXb_yT" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</div>

[Gemini CLI](https://blog.google/technology/developers/introducing-gemini-cli-open-source-ai-agent/) brings Google’s open-source coding agent to the terminal. I’ll cover installation, commands, pricing, and a few ways to use it on a project.

![Introducing Gemini CLI](https://miro.medium.com/v2/resize:fit:700/0*VyhyJzsF-G_L5sr_.png)



## What is Gemini CLI?

Gemini CLI is a free and open-source AI agent that works directly in your terminal. This powerful tool brings Google’s Gemini models to your command line, allowing for natural language interaction to get work done. You can ask it to:

- Write and explain code.
- Edit files.
- Explain errors.
- Run shell commands.
- and much more!

You can work from the terminal instead of switching to a web app. The individual plan includes free usage within its limits.

Once you have it running, try these [Gemini CLI workflow tips](/posts/gemini-cli-10-pro-tips/), including project context and custom commands.

## Getting Started with Gemini CLI

### Step 1: Install Gemini CLI on Linux

You can install **Gemini CLI** on **Linux**, **Mac**, and **Windows**. All the setup we will do inside the terminal. I am using Linux, but for Mac and Windows, the commands are almost the same, so you can follow my steps.

Already have it installed? Use the [Gemini CLI update steps](/posts/how-to-update-gemini-cli/) to check your version and update the same installation.

To get started, make sure you have Node.js version 18 or higher. You can check this by running:

```bash
node -v
```

If you don’t have it, use the following command to install it:

```bash
sudo apt update && sudo apt install nodejs npm
```

Then, I installed Gemini CLI globally with:

```bash
npm install -g @google/gemini-cli
```

If you don’t want to install it globally, you can also use:

```bash
npx https://github.com/google-gemini/gemini-cli
```

### Step 2: Run and Log In

After installing, just type:

```bash
gemini
```

After that, you need to log in with your personal Google account.

![Run and Log In](https://miro.medium.com/v2/resize:fit:700/0*32g4oK6WsczxhK4j.png)



This gives you access to a free Gemini Code Assist license, which includes:

- Access to Gemini 2.5 Pro.
- A massive 1 million token context window.
- 60 model requests per minute.
- 1,000 model requests per day at no charge.

You can also use an API key from [Google AI Studio](https://proflead.dev/posts/google-ai-studio-tutorial/) if you prefer.

## Step 3: Try It Out

Now you are ready to start asking questions and running tasks. You can ask the Agent to create a project, fix the bugs, explain the code in specific files, etc. **Ensure that you run the agent within your project folder.**

```bash
> What does the file index.js do?
```

It read the file, analyzed it, and gave a clear explanation.

```bash
> Add error handling to index.js
```

You can also run shell commands directly by using `!`, like this:
```bash
!ls -al
```

## Creating a Simple To-Do App with Google CLI

Now that we’re all set up, let’s ask the AI to create a simple to-do application using HTML, CSS, and JavaScript. _I will type “create a simple to-do app using simple js and html” into the Gemini CLI.”_ Watch the video to see the step-by-step process and the result.

_Watch on YouTube:_ [_Gemini CLI: Complete Tutorial_](https://youtu.be/Gm8XjcNQ1Vk?si=PZjKI6pmjuEXb_yT)

## Using Built-in Tools

Gemini CLI has some handy built-in tools. You can use commands like:

![Using Built-in Tools](https://miro.medium.com/v2/resize:fit:700/0*gwkPg-k1YO3DQwJm.png)



### Gemini CLI Tools Overview

- **ReadFolder** (`ls`)  
    Lists files and folders in a directory, like the shell `ls` command.
- **ReadFile** (`read-file`)  
    Reads the full content of a single file, useful for summaries or analysis.
- **ReadManyFiles** (`read-many-files`)  
    Reads multiple files at once, typically matching a glob pattern (e.g., all `.js` files)
- **FindFiles** (`glob`)  
    Searches for files by pattern (e.g., find all `config.json` across your project).
- **SearchText** (`grep`)  
    Searches within files for text, like finding all `TODO` comments.
- **Edit** (`edit`)  
    Applies code changes via diffs. Gemini previews edits and asks for approval before applying them.
- **WriteFile** (`write-file`)  
    Creates new files (for example, `README.md`) with user-provided content.
- **Shell** (`shell`)  
    Runs commands you prefix with `!` (e.g., `!npm test`) directly in the terminal .
- **WebFetch** (`web-fetch`)  
    Fetches content from the web (HTML or JSON), enabling Gemini to analyze external data.
- **GoogleSearch** (`web-search`)  
    Performs a Google search to ground responses with real-world information (e.g., explanation for an error).
- **Save Memory** (`memoryTool`)  
    Stores facts or preferences during a session (like “I prefer async/await”) to improve consistency

To see all available tools, you can use the `/tools` command.

## Advanced Features

You can add specific instructions for the AI for a particular project by creating a **GEMINI.md** file in your project’s root directory. Inside this file, you can define project rules, code styles, and the tools the agent should use. This ensures that the generated code is consistent with your project’s standards.

![GEMINI.md file](https://miro.medium.com/v2/resize:fit:499/0*gXoN_iJC-gou7Let.png)



## Google CLI MCP Integration

For most day-to-day uses, the built-in tools will suffice. But what if you want Gemini CLI to do something very domain-specific, like interact with specific APIs or use a specialized model (say an image generator or a security analysis tool)? This is where **MCP (Model Context Protocol)** comes in.

MCP is essentially an open standard that allows developers to **add new tools/abilities to the AI by running a server** that the CLI can communicate with. In Gemini CLI, you can configure “MCP servers” in a JSON settings file, and the CLI will treat those as additional tools it can use.

### How to Set Up the MCP Server in Google CLI

As an example, I am going to show you how to set up the **GitHub MCP server in Gemini CLI.**

Inside your project folder, create a folder by using the command:

```bash
mkdir -p .gemini && touch .gemini/settings.json
```

Inside the file, add the following code:

```json
{  
  "mcpServers": {  
    "github": {  
      "command": "npx",  
      "args": ["-y", "@modelcontextprotocol/server-github"],  
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "[YOUR-TOKEN]" }  
    }  
  }  
}
```

After that `/quit` , from the Gemini CLI, and then reopen it.

Write `/mcp` command, and you will see a list of **GitHub tools**.

![MCP in Google Gemini CLI](https://miro.medium.com/v2/resize:fit:700/0*7RZVeFcibdfZPsjV.png)



Now you, Agent, can interact with GitHub. That simple! :)

## Gemini CLI Pricing

You can try it free for personal usage, but there is also a paid version that is billed based on token usage.

**Free Preview Tier**

- **Cost**: Free with Google account
- **Limits**: Up to **60 requests/min** and **1,000 requests/day**
- Great for individual developers and small-scale use

**Paid / API Key Usage**

- Use your own **Gemini API key** for higher usage
- Billed based on tokens consumed (model and usage dependent)

**Enterprise Options**

- Available through **Gemini Code Assist Standard or Enterprise** plans
- Includes advanced features like governance, audit logs, and shared quotas

## Conclusion

As you can see, Gemini CLI is a really powerful tool with a lot of potential. I’m excited to see how I’ll be using it in my daily workflow.

If you write code, debug things, or manage files often, this tool is worth checking out.

If you have any feedback, please share it in the comments below. ;)

Cheers!
