HomeArtificial IntelligenceNewbie’s Information to Gemini CLI: Set up, Setup, and Use It Like...

Newbie’s Information to Gemini CLI: Set up, Setup, and Use It Like a Professional


Newbie’s Information to Gemini CLI: Set up, Setup, and Use It Like a ProfessionalNewbie’s Information to Gemini CLI: Set up, Setup, and Use It Like a Professional
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 mainly a person instrument 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 gratis (as much as 60 requests/minute and 1,000/day). It’s an incredible free and open supply various to AI coding assistants like Anthropic’s Claude Code.

Let me show you how to with the setup and stroll you thru some examples to spotlight its significance.

 

Setting Up Gemini CLI on Your System

 
To put in Gemini CLI, you want a command-line atmosphere (Terminal on macOS/Linux, PowerShell or comparable on Home windows) and both Homebrew or Node.js. On macOS, the best methodology is by way of Homebrew:

  1. Set up Gemini CLI by way of Homebrew: Execute the next command in your terminal
  2.  

  3. Alternatively, set up by way of Node (any OS): In the event you desire or don’t use Homebrew, set up Node.js (model 20 or increased. Then run:
  4. 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 (in case you see the “Gemini CLI” ASCII banner, you’re set). If gemini is just not discovered, you might must open a brand new terminal or add npm’s world bin to your PATH. You will note one thing like this:

 

Screenshot of Gemini CLI LaunchScreenshot of Gemini CLI Launch
Screenshot of Gemini CLI Launch

 

On first run, Gemini CLI will immediate you to choose a colour theme (gentle or darkish) after which log in together with your Google account. Observe the directions within the browser (or CLI) to authorize. In the event you desire utilizing an API key as an alternative of login, you may set GEMINI_API_KEY=”YOUR_KEY” in your atmosphere (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 instantly. 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: Simple Paragraph WritingScreenshot of Gemini CLI: Simple Paragraph Writing
Screenshot of Gemini CLI: Easy Paragraph Writing

 

// Job 1: Fixing bugs with Gemini CLI

Gemini CLI can combine with instruments like GitHub or your native Git to seek out points. As an illustration, let’s use the built-in @search instrument to fetch a GitHub situation URL, then ask for a repair plan:

Immediate (Supply):

Right here’s a GitHub situation: [@search https://github.com/google-gemini/gemini-cli/issues/4715]. Analyze the code and recommend a 3-step repair plan.

 

The CLI recognized the basis trigger and advised tips on how to modify the code. The screenshot beneath reveals it reporting a 3-step plan. You may overview its plan, then verify to let Gemini CLI robotically apply the adjustments to your recordsdata.

 

Screenshot of Gemini CLI: Fixing bugsScreenshot of Gemini CLI: Fixing bugs
Screenshot of Gemini CLI: Fixing bugs

 

// Job 2a: Working with a Undertaking (Easy Instance)

I’ve created a venture 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 venture folder utilizing:

 

Now run gemini. You can begin asking questions concerning the code. Let’s attempt the next immediate:

Immediate:
Clarify the primary 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 Project (Simple Example)Screenshot of Gemini CLI: Working with a Project (Simple Example)
Screenshot of Gemini CLI: Working with a Undertaking (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.

 

// Job 2b: Working with a Undertaking (Superior Instance)

Exploring the codebase is simple. Now let’s give it a extra technical process to see how the output seems. We’ll present the next immediate to Gemini:

Immediate:
Analyze this repo for widespread efficiency anti-patterns.

 

Screenshot of Gemini CLI: Working with a Project (Advanced Example)Screenshot of Gemini CLI: Working with a Project (Advanced Example)
Screenshot of Gemini CLI: Working with a Undertaking (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 really useful subsequent steps:

Abstract of potential efficiency anti-patterns primarily based on preliminary evaluation:
   1. Massive Frontend Bundle Dimension:
       * Mermaid Library: The mermaid library is probably going a major contributor to the bundle dimension. If it isn't
         lazy-loaded, it should affect preliminary web page load efficiency.
       * `react-icons`: Relying on the way it's imported, it might probably additionally contribute to bundle dimension 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 laborious to say if pictures are correctly optimized (e.g., appropriate sizes, codecs, lazy loading).
   3. Potential Backend Efficiency Points (Python & Node.js):
       * N+1 Queries: It is a widespread database anti-pattern that may considerably decelerate knowledge retrieval.
       * Lack of Caching: If steadily accessed knowledge is just not cached on the utility or database degree, it might probably lead
         to redundant computations and database hits.
       * Synchronous Operations: Blocking I/O in both backend may result in efficiency bottlenecks beneath heavy load.
   4. `reactStrictMode: false`: Whereas not a direct anti-pattern, it might probably cover potential efficiency points associated to
      React's rendering habits throughout improvement.
   5. Improvement-like Docker Quantity Mount: Mounting all the backend listing within the Docker container is much less
      optimum for manufacturing builds in comparison with copying solely obligatory recordsdata.

  To substantiate these, additional investigation can be wanted, together with:

   * Bundle Evaluation: Utilizing instruments like @subsequent/bundle-analyzer to establish giant modules within the frontend.
   * Efficiency Profiling: Operating the appliance and utilizing browser developer instruments (for frontend) and backend
     profiling instruments to establish bottlenecks.
   * Code Assessment: Deep diving into the src/ and backend/ code to establish particular situations of the anti-patterns
     talked about.

 

These examples present how Gemini CLI turns easy prompts into actual actions. You may question code, generate or refactor it, repair bugs, and enhance efficiency , all out of your terminal.

 

Wrapping Up

 
Gemini CLI is a robust new instrument for builders. Upon getting it put in on macOS (or any OS), you may work together with Google’s Gemini LLM as simply as any native command. Among the key options that makes it totally different are:

  1. ReAct Agent Loop: Internally, it runs a ReAct agent loop together with your native atmosphere. This implies it might probably resolve when to name a instrument (search, run shell, edit file) versus when to reply straight. For instance, it fetched a URL with @search when wanted.
  2. Constructed-in Instruments: It has built-in “instruments” comparable to grep, echo, file learn/write, and you may invoke net search or file system queries from prompts.
  3. Multimodal Capabilities: Gemini CLI may even work with pictures/PDFs (since Gemini is multimodal). It helps integration with exterior Mannequin Context Protocol (MCP) servers e.g., you could possibly 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.”

Attempt it out: After following the setup above, open a terminal in a venture folder, kind gemini, and begin experimenting. You’ll rapidly see how an AI companion in your shell can dramatically enhance your productiveness!
 
 

Kanwal Mehreen is a machine studying engineer and a technical author with a profound ardour for knowledge science and the intersection of AI with drugs. She co-authored the 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 Range 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.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments