
Picture by Writer | Canva
# Introduction
Gemini CLI is Google’s new open-source AI assistant that runs in your terminal. It brings the Gemini language mannequin (Gemini 2.5 Professional) on to your shell so you may ask questions, generate code, repair bugs, or create documentation with out leaving the command line. “Gemini” itself is an LLM and “Gemini CLI” is principally a person device that makes mannequin interactive in your workflows. In brief, it’s like ChatGPT for builders. Google launched Gemini CLI in June 2025, and it’s FREE for people. You simply must login utilizing your private google account and it provides you entry to Gemini 2.5 Professional with an enormous 1 million-token context window for free of charge (as much as 60 requests/minute and 1,000/day). It’s an amazing free and open supply different to AI coding assistants like Anthropic’s Claude Code.
Let me aid you with the setup and stroll you thru some examples to focus on its significance.
# Setting Up Gemini CLI on Your System
To put in Gemini CLI, you want a command-line surroundings (Terminal on macOS/Linux, PowerShell or related on Home windows) and both Homebrew or Node.js. On macOS, the best methodology is through Homebrew:
- Set up Gemini CLI through Homebrew: Execute the next command in your terminal
- Alternatively, set up through Node (any OS): In case you desire or don’t use Homebrew, set up Node.js (model 20 or greater. Then run:
npm set up -g @google/gemini-cli
or
npx https://github.com/google-gemini/gemini-cli
This installs the CLI globally on macOS, Linux, or Home windows. Node.js v20+ is required; you may obtain it from nodejs.org or use nvm to handle variations.
As soon as put in, you may merely run the next command to launch the gemini-cli:
This could begin the CLI (when you see the “Gemini CLI” ASCII banner, you’re set). If gemini will not be discovered, you could must open a brand new terminal or add npm’s world bin to your PATH. You will notice one thing like this:

Screenshot of Gemini CLI Launch
On first run, Gemini CLI will immediate you to select a coloration theme (mild or darkish) after which log in together with your Google account. Comply with the directions within the browser (or CLI) to authorize. In case you desire utilizing an API key as a substitute of login, you may set GEMINI_API_KEY=”YOUR_KEY” in your surroundings (see Google AI Studio to generate a key). As soon as authenticated, the CLI confirms it’s prepared to make use of.
# Operating Your First Gemini CLI Instructions
With Gemini CLI arrange, you can begin utilizing pure language instructions straight away. It opens a immediate (marked >) the place you kind questions or duties. For instance, let’s attempt with a easy immediate and ask: “Write a brief paragraph about why Gemini CLI is superior.” Right here’s output:

Screenshot of Gemini CLI: Easy Paragraph Writing
// Activity 1: Fixing bugs with Gemini CLI
Gemini CLI can combine with instruments like GitHub or your native Git to search out points. As an example, let’s use the built-in @search device to fetch a GitHub subject URL, then ask for a repair plan:
Immediate (Supply):
Right here’s a GitHub subject: [@search https://github.com/google-gemini/gemini-cli/issues/4715]. Analyze the code and counsel a 3-step repair plan.
The CLI recognized the foundation trigger and urged learn how to modify the code. The screenshot beneath reveals it reporting a 3-step plan. You possibly can evaluate its plan, then affirm to let Gemini CLI routinely apply the modifications to your recordsdata.
Screenshot of Gemini CLI: Fixing bugs
// Activity 2a: Working with a Mission (Easy Instance)
I’ve created a undertaking folder by cloning the gitdiagram repo. If you wish to know extra about this repo, head over to my article: Make Sense of a 10K+ Line GitHub Repo With out Studying the Code. Let’s navigate to our undertaking folder utilizing:
Now run gemini. You can begin asking questions concerning the code. Let’s attempt the next immediate:
Immediate:
Clarify the principle parts of this codebase
Gemini CLI will scan the recordsdata and use the Gemini mannequin to summarize or reply, as proven within the screenshot beneath:
Screenshot of Gemini CLI: Working with a Mission (Easy Instance)
It parsed the folders and returned a structured abstract (itemizing directories like src/, public/, and so forth.). That is helpful for onboarding onto new tasks or producing documentation.
// Activity 2b: Working with a Mission (Superior Instance)
Exploring the codebase is simple. Now let’s give it a extra technical job to see how the output seems. We’ll present the next immediate to Gemini:
Immediate:
Analyze this repo for frequent efficiency anti-patterns.

Screenshot of Gemini CLI: Working with a Mission (Superior Instance)
The response was so detailed that I’ve solely included the beginning portion within the screenshot. Gemini CLI created an in depth plan after which learn each file independently. In the long run, it shared a abstract of potential efficiency anti-patterns together with advisable subsequent steps:
Abstract of potential efficiency anti-patterns primarily based on preliminary evaluation:
1. Massive Frontend Bundle Measurement:
* Mermaid Library: The mermaid library is probably going a big contributor to the bundle measurement. If it is not
lazy-loaded, it is going to impression preliminary web page load efficiency.
* `react-icons`: Relying on the way it's imported, it could possibly additionally contribute to bundle measurement if not tree-shaken
successfully.
2. Unoptimized Picture Utilization: Whereas Subsequent.js has subsequent/picture, with out inspecting the precise picture utilization in parts,
it is exhausting to say if photographs are correctly optimized (e.g., appropriate sizes, codecs, lazy loading).
3. Potential Backend Efficiency Points (Python & Node.js):
* N+1 Queries: This can be a frequent database anti-pattern that may considerably decelerate information retrieval.
* Lack of Caching: If steadily accessed information will not be cached on the utility or database degree, it could possibly lead
to redundant computations and database hits.
* Synchronous Operations: Blocking I/O in both backend may result in efficiency bottlenecks underneath heavy load.
4. `reactStrictMode: false`: Whereas not a direct anti-pattern, it could possibly cover potential efficiency points associated to
React's rendering habits throughout improvement.
5. Improvement-like Docker Quantity Mount: Mounting your complete backend listing within the Docker container is much less
optimum for manufacturing builds in comparison with copying solely mandatory recordsdata.
To substantiate these, additional investigation can be wanted, together with:
* Bundle Evaluation: Utilizing instruments like @subsequent/bundle-analyzer to determine massive modules within the frontend.
* Efficiency Profiling: Operating the applying and utilizing browser developer instruments (for frontend) and backend
profiling instruments to determine bottlenecks.
* Code Overview: Deep diving into the src/ and backend/ code to determine particular situations of the anti-patterns
talked about.
These examples present how Gemini CLI turns easy prompts into actual actions. You possibly can question code, generate or refactor it, repair bugs, and enhance efficiency , all out of your terminal.
# Wrapping Up
Gemini CLI is a robust new device for builders. After you have it put in on macOS (or any OS), you may work together with Google’s Gemini LLM as simply as any native command. A number of the key options that makes it completely different are:
- ReAct Agent Loop: Internally, it runs a ReAct agent loop together with your native surroundings. This implies it could possibly determine when to name a device (search, run shell, edit file) versus when to reply immediately. For instance, it fetched a URL with @search when wanted.
- Constructed-in Instruments: It has built-in “instruments” akin to grep, echo, file learn/write, and you may invoke net search or file system queries from prompts.
- Multimodal Capabilities: Gemini CLI may even work with photographs/PDFs (since Gemini is multimodal). It helps integration with exterior Mannequin Context Protocol (MCP) servers e.g., you possibly can hook up a picture generator (Imagen) or a customized API. This allows you to do issues like “generate code from this sketch” or “summarize a PDF.”
Strive it out: After following the setup above, open a terminal in a undertaking folder, kind gemini, and begin experimenting. You’ll rapidly see how an AI companion in your shell can dramatically increase your productiveness!
Kanwal Mehreen is a machine studying engineer and a technical author with a profound ardour for information science and the intersection of AI with drugs. She co-authored the e-book “Maximizing Productiveness with ChatGPT”. As a Google Era Scholar 2022 for APAC, she champions range and educational excellence. She’s additionally acknowledged as a Teradata Variety in Tech Scholar, Mitacs Globalink Analysis Scholar, and Harvard WeCode Scholar. Kanwal is an ardent advocate for change, having based FEMCodes to empower ladies in STEM fields.