{"id":464892,"date":"2025-06-27T15:02:13","date_gmt":"2025-06-27T15:02:13","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=464892"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=464892","title":{"rendered":"<span>Gemini CLI: Open-Source AI Agent in Terminal<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Have you ever wished for an AI assistant right inside your terminal window? Well, your dream has come true because Google just released <a href=\"https:\/\/blog.google\/technology\/developers\/introducing-gemini-cli-open-source-ai-agent\/\" rel=\"noopener noreferrer nofollow\">Gemini CLI<\/a>. In this tutorial, I&#8217;m going to show you everything you need to know about this new open-source AI agent. We&#8217;ll cover how to use it, the pricing, and some useful tips and tricks. So, if you&#8217;re ready, let&#8217;s get started! \ud83d\ude09<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c41\/c40\/dd4\/c41c40dd4c8062724ad11e41fe964748.png\" width=\"1904\" height=\"949\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c41\/c40\/dd4\/c41c40dd4c8062724ad11e41fe964748.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c41\/c40\/dd4\/c41c40dd4c8062724ad11e41fe964748.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<h3>What is Gemini CLI?<\/h3>\n<p>Gemini CLI is a free and open-source AI agent that works directly in your terminal. This powerful tool brings Google&#8217;s Gemini models to your command line, allowing for natural language interaction to get work done. You can ask it to:<\/p>\n<ul>\n<li>\n<p>Write and explain code.<\/p>\n<\/li>\n<li>\n<p>Edit files.<\/p>\n<\/li>\n<li>\n<p>Explain errors.<\/p>\n<\/li>\n<li>\n<p>Run shell commands.<\/p>\n<\/li>\n<li>\n<p>and much more!<\/p>\n<\/li>\n<\/ul>\n<p>You don&#8217;t have to constantly switch between a web app and your terminal. And the best part? It\u2019s <strong>free<\/strong>, with no complicated setup.<\/p>\n<h3>Getting Started with Gemini CLI<\/h3>\n<h4>Step 1: Install Gemini CLI on Linux<\/h4>\n<p>You can install <strong>Gemini CLI<\/strong> on <strong>Linux<\/strong>, <strong>Mac<\/strong>, and <strong>Windows<\/strong>. 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.<\/p>\n<p>To get started, make sure you have Node.js version 18 or higher. You can check this by running:<\/p>\n<pre><code class=\"bash\">node -v<\/code><\/pre>\n<p>If you don&#8217;t have it, use the following command to install it:<\/p>\n<pre><code class=\"bash\">sudo apt update &amp;&amp; sudo apt install nodejs npm<\/code><\/pre>\n<p>Then, I installed Gemini CLI globally with:<\/p>\n<pre><code class=\"bash\">npm install -g @google\/gemini-cli<\/code><\/pre>\n<p>If you don\u2019t want to install it globally, you can also use:<\/p>\n<pre><code class=\"bash\">npx https:\/\/github.com\/google-gemini\/gemini-cli<\/code><\/pre>\n<h4>Step 2: Run and Log In<\/h4>\n<p>After installing, just type:<\/p>\n<pre><code class=\"bash\">gemini<\/code><\/pre>\n<p>After that, you need to log in with your personal Google account. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/326\/ca4\/eb7\/326ca4eb7378963ddc96553eecebf12a.png\" alt=\"Run and Log In\" title=\"Run and Log In\" width=\"1246\" height=\"566\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/326\/ca4\/eb7\/326ca4eb7378963ddc96553eecebf12a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/326\/ca4\/eb7\/326ca4eb7378963ddc96553eecebf12a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Run and Log In<\/figcaption><\/div>\n<\/figure>\n<p>This gives you access to a free Gemini Code Assist license, which includes:<\/p>\n<ul>\n<li>\n<p>Access to Gemini 2.5 Pro.<\/p>\n<\/li>\n<li>\n<p>A massive 1 million token context window.<\/p>\n<\/li>\n<li>\n<p>60 model requests per minute.<\/p>\n<\/li>\n<li>\n<p>1,000 model requests per day at no charge.<\/p>\n<\/li>\n<\/ul>\n<p>You can also use an API key from <a href=\"https:\/\/proflead.dev\/posts\/google-ai-studio-tutorial\/\" rel=\"noopener noreferrer nofollow\">Google AI Studio<\/a> if you prefer. <\/p>\n<h4>Step 3: Try It Out<\/h4>\n<p>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. <strong>Ensure that you run the agent within your project folder.<\/strong><\/p>\n<pre><code class=\"bash\">&gt; What does the file index.js do?<\/code><\/pre>\n<p>It read the file, analyzed it, and gave a clear explanation.<\/p>\n<pre><code class=\"bash\">&gt; Add error handling to index.js<\/code><\/pre>\n<p>You can also run shell commands directly by using <code>!<\/code>, like this:<\/p>\n<pre><code class=\"bash\">!ls -al<\/code><\/pre>\n<h3>Creating a Simple To-Do App with Google CLI<\/h3>\n<p>Now that we&#8217;re all set up, let&#8217;s ask the AI to create a simple to-do application using HTML, CSS, and JavaScript. <em>I will type &#171;create a simple to-do app using simple js and html&#187; into the Gemini CLI.&#187; <\/em>Watch the video to see the step-by-step process and the result.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/685e8d80a8d4c6f5edee6858\" data-style=\"\" id=\"685e8d80a8d4c6f5edee6858\" width=\"\"><\/div>\n<p><em>Watch on YouTube: <\/em><a href=\"https:\/\/youtu.be\/Gm8XjcNQ1Vk?si=PZjKI6pmjuEXb_yT\" rel=\"noopener noreferrer nofollow\"><em>Gemini CLI: Complete Tutorial<\/em><\/a><\/p>\n<h3>Using Built-in Tools<\/h3>\n<p>Gemini CLI has some handy built-in tools. You can use commands like:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0a8\/dd5\/dad\/0a8dd5dade93fe3d070a240eda0f880b.png\" alt=\"Using Built-in Tools\" title=\"Using Built-in Tools\" width=\"878\" height=\"418\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0a8\/dd5\/dad\/0a8dd5dade93fe3d070a240eda0f880b.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0a8\/dd5\/dad\/0a8dd5dade93fe3d070a240eda0f880b.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Using Built-in Tools<\/figcaption><\/div>\n<\/figure>\n<h4>Gemini\u202fCLI Tools Overview<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"216\" width=\"216\">\n<p align=\"left\">Tool<\/p>\n<\/th>\n<th>\n<p align=\"left\">Description<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>ReadFolder<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Lists all files and subfolders in a directory (like <code>ls<\/code>).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>ReadFile<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Reads the full text of a single file (or part of it).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>ReadManyFiles<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Reads multiple files matching a pattern (e.g. all <code>*.js<\/code>).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>FindFiles<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Finds files by name or pattern (glob search).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>SearchText<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Searches inside files for a given string (like <code>grep<\/code>).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>Edit<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Applies diffs to files after showing changes for approval.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>WriteFile<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Creates a new file with specified content.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>Shell<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Executes shell commands you prefix with <code>!<\/code>.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>WebFetch<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Fetches web content (HTML\/JSON) from a URL.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>GoogleSearch<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Searches Google using an error or query and retrieves results.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>Save Memory<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Stores facts or preferences during your session for later use.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>To see all available tools, you can use the\u00a0<code>\/tools<\/code>\u00a0command.<\/p>\n<h3>Advanced Features<\/h3>\n<p>You can add specific instructions for the AI for a particular project by creating a\u00a0<strong>GEMINI.md<\/strong>\u00a0file in your project&#8217;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&#8217;s standards.<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/109\/aac\/b63\/109aacb636817c368b94278406e6fff1.png\" alt=\"GEMINI.md\u00a0file\" title=\"GEMINI.md\u00a0file\" width=\"499\" height=\"276\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/109\/aac\/b63\/109aacb636817c368b94278406e6fff1.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/109\/aac\/b63\/109aacb636817c368b94278406e6fff1.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>GEMINI.md\u00a0file<\/figcaption><\/div>\n<\/figure>\n<h3>Google CLI MCP Integration <\/h3>\n<p>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 <strong>MCP (Model Context Protocol)<\/strong> comes in.<\/p>\n<p>MCP is essentially an open standard that allows developers to <strong>add new tools\/abilities to the AI by running a server<\/strong> that the CLI can communicate with. In Gemini CLI, you can configure \u201cMCP servers\u201d in a JSON settings file, and the CLI will treat those as additional tools it can use. <\/p>\n<h4>How to Set Up the MCP Server in Google CLI<\/h4>\n<p>As an example, I am going to show you how to set up the <strong>GitHub MCP server in Gemini CLI.<\/strong><\/p>\n<p>Inside your project folder, create a folder by using the command:<\/p>\n<pre><code class=\"bash\">mkdir -p .gemini &amp;&amp; touch .gemini\/settings.json<\/code><\/pre>\n<p>Inside the file, add the following code:<\/p>\n<pre><code class=\"json\">{   \"mcpServers\": {     \"github\": {       \"command\": \"npx\",       \"args\": [\"-y\", \"@modelcontextprotocol\/server-github\"],       \"env\": { \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"[YOUR-TOKEN]\" }     }   } }<\/code><\/pre>\n<p>After that <code>\/quit<\/code> , from the Gemini CLI, and then reopen it. <\/p>\n<p>Write <code>\/mcp<\/code> command, and you will see a list of <strong>GitHub tools<\/strong>. <\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f26\/7c3\/0ea\/f267c30ea2d7d271e5ff7a5a28d0faeb.png\" alt=\"How to Set Up the MCP Server in Google CLI\" title=\"How to Set Up the MCP Server in Google CLI\" width=\"1762\" height=\"883\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/f26\/7c3\/0ea\/f267c30ea2d7d271e5ff7a5a28d0faeb.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f26\/7c3\/0ea\/f267c30ea2d7d271e5ff7a5a28d0faeb.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>How to Set Up the MCP Server in Google CLI<\/figcaption><\/div>\n<\/figure>\n<p>Now you, Agent, can interact with GitHub. That simple! \ud83d\ude42<\/p>\n<h3>Gemini\u202fCLI Pricing<\/h3>\n<p>You can try it free for personal usage, but there is also a paid version that is billed based on token usage.<\/p>\n<ul>\n<li>\n<p><strong>Free Preview Tier<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Cost<\/strong>: Free with Google account<\/p>\n<\/li>\n<li>\n<p><strong>Limits<\/strong>: Up to <strong>60 requests\/min<\/strong> and <strong>1,000 requests\/day<\/strong><\/p>\n<\/li>\n<li>\n<p>Great for individual developers and small-scale use<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Paid \/ API Key Usage<\/strong><\/p>\n<ul>\n<li>\n<p>Use your own <strong>Gemini API key<\/strong> for higher usage<\/p>\n<\/li>\n<li>\n<p>Billed based on tokens consumed (model and usage dependent)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Enterprise Options<\/strong><\/p>\n<ul>\n<li>\n<p>Available through <strong>Gemini Code Assist Standard or Enterprise<\/strong> plans<\/p>\n<\/li>\n<li>\n<p>Includes advanced features like governance, audit logs, and shared quotas<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>As you can see, Gemini CLI is a really powerful tool with a lot of potential. I&#8217;m excited to see how I&#8217;ll be using it in my daily workflow.<\/p>\n<p>If you write code, debug things, or manage files often, this tool is worth checking out.<\/p>\n<p> If you have any feedback, please share it in the comments below. \ud83d\ude09<\/p>\n<p>Cheers!<\/p>\n<p><em>src: <\/em><a href=\"https:\/\/proflead.dev\/posts\/gemini-cli-tutorial\/\" rel=\"noopener noreferrer nofollow\"><em>https:\/\/proflead.dev\/posts\/gemini-cli-tutorial\/<\/em><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/922606\/\"> https:\/\/habr.com\/ru\/articles\/922606\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>Have you ever wished for an AI assistant right inside your terminal window? Well, your dream has come true because Google just released <a href=\"https:\/\/blog.google\/technology\/developers\/introducing-gemini-cli-open-source-ai-agent\/\" rel=\"noopener noreferrer nofollow\">Gemini CLI<\/a>. In this tutorial, I&#8217;m going to show you everything you need to know about this new open-source AI agent. We&#8217;ll cover how to use it, the pricing, and some useful tips and tricks. So, if you&#8217;re ready, let&#8217;s get started! \ud83d\ude09<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>What is Gemini CLI?<\/h3>\n<p>Gemini CLI is a free and open-source AI agent that works directly in your terminal. This powerful tool brings Google&#8217;s Gemini models to your command line, allowing for natural language interaction to get work done. You can ask it to:<\/p>\n<ul>\n<li>\n<p>Write and explain code.<\/p>\n<\/li>\n<li>\n<p>Edit files.<\/p>\n<\/li>\n<li>\n<p>Explain errors.<\/p>\n<\/li>\n<li>\n<p>Run shell commands.<\/p>\n<\/li>\n<li>\n<p>and much more!<\/p>\n<\/li>\n<\/ul>\n<p>You don&#8217;t have to constantly switch between a web app and your terminal. And the best part? It\u2019s <strong>free<\/strong>, with no complicated setup.<\/p>\n<h3>Getting Started with Gemini CLI<\/h3>\n<h4>Step 1: Install Gemini CLI on Linux<\/h4>\n<p>You can install <strong>Gemini CLI<\/strong> on <strong>Linux<\/strong>, <strong>Mac<\/strong>, and <strong>Windows<\/strong>. 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.<\/p>\n<p>To get started, make sure you have Node.js version 18 or higher. You can check this by running:<\/p>\n<pre><code class=\"bash\">node -v<\/code><\/pre>\n<p>If you don&#8217;t have it, use the following command to install it:<\/p>\n<pre><code class=\"bash\">sudo apt update &amp;&amp; sudo apt install nodejs npm<\/code><\/pre>\n<p>Then, I installed Gemini CLI globally with:<\/p>\n<pre><code class=\"bash\">npm install -g @google\/gemini-cli<\/code><\/pre>\n<p>If you don\u2019t want to install it globally, you can also use:<\/p>\n<pre><code class=\"bash\">npx https:\/\/github.com\/google-gemini\/gemini-cli<\/code><\/pre>\n<h4>Step 2: Run and Log In<\/h4>\n<p>After installing, just type:<\/p>\n<pre><code class=\"bash\">gemini<\/code><\/pre>\n<p>After that, you need to log in with your personal Google account. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>Run and Log In<\/figcaption><\/div>\n<\/figure>\n<p>This gives you access to a free Gemini Code Assist license, which includes:<\/p>\n<ul>\n<li>\n<p>Access to Gemini 2.5 Pro.<\/p>\n<\/li>\n<li>\n<p>A massive 1 million token context window.<\/p>\n<\/li>\n<li>\n<p>60 model requests per minute.<\/p>\n<\/li>\n<li>\n<p>1,000 model requests per day at no charge.<\/p>\n<\/li>\n<\/ul>\n<p>You can also use an API key from <a href=\"https:\/\/proflead.dev\/posts\/google-ai-studio-tutorial\/\" rel=\"noopener noreferrer nofollow\">Google AI Studio<\/a> if you prefer. <\/p>\n<h4>Step 3: Try It Out<\/h4>\n<p>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. <strong>Ensure that you run the agent within your project folder.<\/strong><\/p>\n<pre><code class=\"bash\">&gt; What does the file index.js do?<\/code><\/pre>\n<p>It read the file, analyzed it, and gave a clear explanation.<\/p>\n<pre><code class=\"bash\">&gt; Add error handling to index.js<\/code><\/pre>\n<p>You can also run shell commands directly by using <code>!<\/code>, like this:<\/p>\n<pre><code class=\"bash\">!ls -al<\/code><\/pre>\n<h3>Creating a Simple To-Do App with Google CLI<\/h3>\n<p>Now that we&#8217;re all set up, let&#8217;s ask the AI to create a simple to-do application using HTML, CSS, and JavaScript. <em>I will type &#171;create a simple to-do app using simple js and html&#187; into the Gemini CLI.&#187; <\/em>Watch the video to see the step-by-step process and the result.<\/p>\n<div class=\"tm-iframe_temp\" data-src=\"https:\/\/embedd.srv.habr.com\/iframe\/685e8d80a8d4c6f5edee6858\" data-style=\"\" id=\"685e8d80a8d4c6f5edee6858\" width=\"\"><\/div>\n<p><em>Watch on YouTube: <\/em><a href=\"https:\/\/youtu.be\/Gm8XjcNQ1Vk?si=PZjKI6pmjuEXb_yT\" rel=\"noopener noreferrer nofollow\"><em>Gemini CLI: Complete Tutorial<\/em><\/a><\/p>\n<h3>Using Built-in Tools<\/h3>\n<p>Gemini CLI has some handy built-in tools. You can use commands like:<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Using Built-in Tools<\/figcaption><\/div>\n<\/figure>\n<h4>Gemini\u202fCLI Tools Overview<\/h4>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th data-colwidth=\"216\" width=\"216\">\n<p align=\"left\">Tool<\/p>\n<\/th>\n<th>\n<p align=\"left\">Description<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>ReadFolder<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Lists all files and subfolders in a directory (like <code>ls<\/code>).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>ReadFile<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Reads the full text of a single file (or part of it).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>ReadManyFiles<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Reads multiple files matching a pattern (e.g. all <code>*.js<\/code>).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>FindFiles<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Finds files by name or pattern (glob search).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>SearchText<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Searches inside files for a given string (like <code>grep<\/code>).<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>Edit<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Applies diffs to files after showing changes for approval.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>WriteFile<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Creates a new file with specified content.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>Shell<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Executes shell commands you prefix with <code>!<\/code>.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>WebFetch<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Fetches web content (HTML\/JSON) from a URL.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>GoogleSearch<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Searches Google using an error or query and retrieves results.<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"216\" width=\"216\">\n<p align=\"left\"><strong>Save Memory<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Stores facts or preferences during your session for later use.<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>To see all available tools, you can use the\u00a0<code>\/tools<\/code>\u00a0command.<\/p>\n<h3>Advanced Features<\/h3>\n<p>You can add specific instructions for the AI for a particular project by creating a\u00a0<strong>GEMINI.md<\/strong>\u00a0file in your project&#8217;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&#8217;s standards.<\/p>\n<figure class=\"\">\n<div><figcaption>GEMINI.md\u00a0file<\/figcaption><\/div>\n<\/figure>\n<h3>Google CLI MCP Integration <\/h3>\n<p>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 <strong>MCP (Model Context Protocol)<\/strong> comes in.<\/p>\n<p>MCP is essentially an open standard that allows developers to <strong>add new tools\/abilities to the AI by running a server<\/strong> that the CLI can communicate with. In Gemini CLI, you can configure \u201cMCP servers\u201d in a JSON settings file, and the CLI will treat those as additional tools it can use. <\/p>\n<h4>How to Set Up the MCP Server in Google CLI<\/h4>\n<p>As an example, I am going to show you how to set up the <strong>GitHub MCP server in Gemini CLI.<\/strong><\/p>\n<p>Inside your project folder, create a folder by using the command:<\/p>\n<pre><code class=\"bash\">mkdir -p .gemini &amp;&amp; touch .gemini\/settings.json<\/code><\/pre>\n<p>Inside the file, add the following code:<\/p>\n<pre><code class=\"json\">{   \"mcpServers\": {     \"github\": {       \"command\": \"npx\",       \"args\": [\"-y\", \"@modelcontextprotocol\/server-github\"],       \"env\": { \"GITHUB_PERSONAL_ACCESS_TOKEN\": \"[YOUR-TOKEN]\" }     }   } }<\/code><\/pre>\n<p>After that <code>\/quit<\/code> , from the Gemini CLI, and then reopen it. <\/p>\n<p>Write <code>\/mcp<\/code> command, and you will see a list of <strong>GitHub tools<\/strong>. <\/p>\n<figure class=\"full-width\">\n<div><figcaption>How to Set Up the MCP Server in Google CLI<\/figcaption><\/div>\n<\/figure>\n<p>Now you, Agent, can interact with GitHub. That simple! \ud83d\ude42<\/p>\n<h3>Gemini\u202fCLI Pricing<\/h3>\n<p>You can try it free for personal usage, but there is also a paid version that is billed based on token usage.<\/p>\n<ul>\n<li>\n<p><strong>Free Preview Tier<\/strong><\/p>\n<ul>\n<li>\n<p><strong>Cost<\/strong>: Free with Google account<\/p>\n<\/li>\n<li>\n<p><strong>Limits<\/strong>: Up to <strong>60 requests\/min<\/strong> and <strong>1,000 requests\/day<\/strong><\/p>\n<\/li>\n<li>\n<p>Great for individual developers and small-scale use<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Paid \/ API Key Usage<\/strong><\/p>\n<ul>\n<li>\n<p>Use your own <strong>Gemini API key<\/strong> for higher usage<\/p>\n<\/li>\n<li>\n<p>Billed based on tokens consumed (model and usage dependent)<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><strong>Enterprise Options<\/strong><\/p>\n<ul>\n<li>\n<p>Available through <strong>Gemini Code Assist Standard or Enterprise<\/strong> plans<\/p>\n<\/li>\n<li>\n<p>Includes advanced features like governance, audit logs, and shared quotas<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Conclusion<\/h3>\n<p>As you can see, Gemini CLI is a really powerful tool with a lot of potential. I&#8217;m excited to see how I&#8217;ll be using it in my daily workflow.<\/p>\n<p>If you write code, debug things, or manage files often, this tool is worth checking out.<\/p>\n<p> If you have any feedback, please share it in the comments below. \ud83d\ude09<\/p>\n<p>Cheers!<\/p>\n<p><em>src: <\/em><a href=\"https:\/\/proflead.dev\/posts\/gemini-cli-tutorial\/\" rel=\"noopener noreferrer nofollow\"><em>https:\/\/proflead.dev\/posts\/gemini-cli-tutorial\/<\/em><\/a><\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/922606\/\"> https:\/\/habr.com\/ru\/articles\/922606\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-464892","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/464892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=464892"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/464892\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=464892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=464892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=464892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}