Have you ever wished for an AI assistant right inside your terminal window? Well, your dream may have just come true because Google just released Gemini CLI. In this tutorial, I’m going to show you everything you need to know about this new open-source AI agent. We’ll cover how to use it, the pricing, and some useful tips and tricks. So, if you’re ready, let’s get started! ;) Gemini CLI 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! Write and explain code. Edit files. Explain errors. Run shell commands. and much more! You don’t have to constantly switch between a web app and your terminal. And the best part? It’s free, with no complicated setup. free 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. Gemini CLI Linux Mac Windows To get started, make sure you have Node.js version 18 or higher. You can check this by running: node -v node -v If you don’t have it, use the following command to install it: sudo apt update && sudo apt install nodejs npm sudo apt update && sudo apt install nodejs npm Then, I installed Gemini CLI globally with: npm install -g @google/gemini-cli npm install -g @google/gemini-cli If you don’t want to install it globally, you can also use: npx https://github.com/google-gemini/gemini-cli npx https://github.com/google-gemini/gemini-cli Step 2: Run and Log In After installing, just type: gemini gemini After that, you need to log in with your personal Google account. 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. 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 if you prefer. Google AI Studio 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. Ensure that you run the agent within your project folder. > What does the file index.js do? > What does the file index.js do? It read the file, analyzed it, and gave a clear explanation. > Add error handling to index.js > Add error handling to index.js You can also run shell commands directly by using !, like this: ! !ls -al !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. I will type “create a simple to-do app using simple js and html” into the Gemini CLI.” Watch on YouTube: Gemini CLI: Complete Tutorial Watch on YouTube: Gemini CLI: Complete Tutorial Gemini CLI: Complete Tutorial Using Built-in Tools Gemini CLI has some handy built-in tools. You can use commands like: Gemini CLI Tools Overview ReadFolder (ls). Lists files and folders in a directory—just 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 ReadFolder (ls). Lists files and folders in a directory—just like the shell ls command. ReadFolder ls ls ReadFile (read-file). Reads the full content of a single file, useful for summaries or analysis. ReadFile read-file ReadManyFiles (read-many-files). Reads multiple files at once, typically matching a glob pattern (e.g., all .js files) ReadManyFiles read-many-files .js FindFiles (glob). Searches for files by pattern (e.g., find all config.json across your project). FindFiles glob config.json SearchText (grep). Searches within files for text, like finding all TODO comments. SearchText grep TODO Edit (edit). Applies code changes via diffs. Gemini previews edits and asks for approval before applying them. Edit edit WriteFile (write-file). Creates new files (for example, README.md) with user-provided content. WriteFile write-file README.md Shell (shell). Runs commands you prefix with ! (e.g., !npm test) directly in the terminal . Shell shell ! !npm test WebFetch (web-fetch). Fetches content from the web (HTML or JSON), enabling Gemini to analyze external data. WebFetch web-fetch GoogleSearch (web-search). Performs a Google search to ground responses with real-world information (e.g., explanation for an error). GoogleSearch web-search Save Memory (memoryTool). Stores facts or preferences during a session (like “I prefer async/await”) to improve consistency Save Memory memoryTool To see all available tools, you can use the /tools command. /tools 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 GEMINI.md 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 (Model Context Protocol) 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. add new tools/abilities to the AI by running a server 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. GitHub MCP server in Gemini CLI. Inside your project folder, create a folder by using the command: mkdir -p .gemini && touch .gemini/settings.json mkdir -p .gemini && touch .gemini/settings.json Inside the file, add the following code: { "mcpServers": { "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "[YOUR-TOKEN]" } } } } { "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. /quit Write /mcp command, and you will see a list of GitHub tools. /mcp GitHub tools 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 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 Cost: Free with Google account Cost Limits: Up to 60 requests/min and 1,000 requests/day Limits 60 requests/min 1,000 requests/day Great for individual developers and small-scale use Paid / API Key Usage Paid / API Key Usage Use your own Gemini API key for higher usage Billed based on tokens consumed (model and usage dependent) Use your own Gemini API key for higher usage Gemini API key Billed based on tokens consumed (model and usage dependent) Enterprise Options Enterprise Options Available through Gemini Code Assist Standard or Enterprise plans Includes advanced features like governance, audit logs, and shared quotas Available through Gemini Code Assist Standard or Enterprise plans Gemini Code Assist Standard or Enterprise 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!