πŸ€– Gemini in Your Terminal With Gemini CLI

This blog post is available in French ➑️ here ⬅️ . This version was translated with Gemini and adapted by my hands.

πŸ‘‰ What is a CLI?

Command Line Interfaces (CLIs) are command-line tools that allow you to interact with an application by entering “text” that forms commands. They have existed since the beginning of computing and are still used daily by developers, SREs/OPS, and anyone else who enjoys spending time in terminals 😁.

A current evolution is the integration of AI into CLI tools. Whether it’s Google, Amazon, or other AI model producers, CLI tools are emerging: Gemini CLI, Amazon Q, Claude code, etc.

⚠️ This article will focus on Google’s CLI, Gemini CLI, which I use both at my client’s and in a Zenika/personal context. This overview will allow you to discover how this CLI works and the features available. I will not make a comparison with other solutions on the market, as I do not know them and have not tested them enough. However, I recommend the talk by Faye Ellis at DevFest Nantes on Amazon’s CLI (see the replay).

βš™οΈGemini CLI

Gemini CLI is an open-source project released in June 2025 designed to increase team productivity using AI directly in your terminal.

For installation, you must have initiated or identified a Google Cloud Platform project with the Gemini API enabled. Gemini CLI is then installed using the npx command https://github.com/google-gemini/gemini-cli or with brew install gemini-cli. Once the GOOGLE_CLOUD_PROJECT environment variable is configured, Gemini can be opened simply with the gemini command.

Welcome Gemini CLI

πŸš€ Features offered by Gemini CLI

The main feature of Gemini CLI is to allow users to query Gemini models from the terminal, while integrating tools capable of interacting with their environment.

These queries can take several forms: asking for information on a subject, getting help on solving a problem, or even generating specific content. In this example, I asked it to make a comparison table between two current Java frameworks, Quarkus and Spring Boot.

Quarkus / Springbot

This type of query, identical to what we would do on a search engine, is possible thanks to a tool that Gemini CLI integrates natively: GoogleSearch. This tool is not alone; I will detail this part later in the article. A few months ago, when we were using Large Language Models (LLMs), we were limited in the “freshness” of the data. With this tool, searches will provide up-to-date results.

This bias can be verified with two simple queries such as “give me today’s date” and “tell me if a former French president is in prison and if so, since when” (this test was done the October 10 and don’t ask me why I had this question in mind first, it was a subject all the time present on French news 🀷):

Date of the day GoogleSearch tool

In the second query, Gemini CLI shows us its reasoning and the tools used to answer our questions. In my specific query, GoogleSearch is indeed called, giving us an explanation and an initial justification for the given answer.

πŸ—’οΈ The commands

Gemini CLI integrates several commands allowing, among other things, to:

  • configure or modify your Google authentication,
  • set your preferences and options,
  • submit a bug,
  • copy the result of a query to the clipboard
Commands
Settings command

The /init command is interesting. It allows you to generate a GEMINI.MD file for your project. This Markdown file (you guessed it from its .md extension πŸ™ƒ) contains the context of your project. Gemini CLI will scan your project files and gather the necessary information to tailor its future responses based on your context.

It is also possible to create your own custom commands. You just need to create a “commands” directory either in the .gemini directory of your session or of your project concerned by this command. The name of the .toml file corresponds to the name of the command and must have at least a prompt description to explain its reasoning.

For example, the /translate command can be configured by adding the translate.toml file to the .gemini directory.

Toml configuration file

In Gemini CLI, the command is available and allows for a quick English -> French translation.

Custom command
Custom command result

πŸ€– An “agentic” code assistant

As a developer, I have integrated the Gemini plugin into my current IDEs, VS Code and IntelliJ, which assists me in writing documentation, explaining code, and helping to solve problems. The arrival of the “agentic” world has strengthened the code “assistant” part by allowing tools to propose file updates in projects. The Gemini plugin has had the ability to activate “Agent” mode for several months:

Agent

Gemini CLI can be opened in a terminal, like the default one available on Mac, in terminal applications like Ghostty (the one I use), or directly in your IDE’s terminal.

Gemini CLI in a terminal

Gemini CLI, in addition to being able to modify your files, can execute commands available on your machine. For example, when asking for help creating a new Go project, Gemini CLI will interact with your environment, starting by checking if Go is installed on your machine.

CLI execution CLI second execution

Another command to know is /ide, which allows you to connect Gemini CLI to your IDE. Code suggestions will open in your IDE, which makes them easier to review. In this example, I asked Gemini to generate tests for me, and the first step is indeed to add JUnit to my Java project.

CLI diff

Once (in my example) Gemini’s proposal is validated, it continues its processing and suggests creating a Test class for the untested code (Yes, I know, that’s not good 😁).

CLI diff

The /ide status subcommand allows you to see the status of this integration.

IDE command

🧩 Extensions

Beyond the features mentioned earlier, Gemini CLI has its own extension system that helps increase our productivity.

An /extensions command is available. Accompanied by the list and update subcommands, you can view the extensions you have and update them.

Extensions list command

For now, I have installed these two extensions which are very practical for doing a review and a security audit on the branch we are developing on. There is already a very interesting list of extensions available on this site: https://geminicli.com/extensions/.

If you regularly generate images, I recommend the nanobanana extension (Google’s image generation model).

Gemini CLI extensions website

For those wondering why I haven’t installed this extension that I claim is interesting, the reason is quite simple: I use this image generation model in other contexts 😎.

πŸ™Œ MCP

MCPs (Model Context Protocol) make it easier to call APIs. Gemini CLI offers the ability to configure the MCPs you have developed and/or those already available. And that’s really interesting. For my part, I have integrated the GitHub, GitLab, and Atlassian MCPs at my client’s. I’ve been trying to use them regularly for a few weeks and it can quickly be a time saver. Want to create a GitHub or GitLab issue? Write it to Gemini CLI and quickly move on to something else. Similarly, creating a Jira ticket is done in a few words in the terminal, which is practical.

How does it work? Gemini CLI manages its configuration in the .gemini/settings.json file at the root of your account. This file contains all the configurations related to its use in your IDE, the applied graphic themes, but also the MCP configuration.

The configuration of the GitHub MCP server is done with this configuration:

 "github": {  
    "httpUrl": "https://api.githubcopilot.com/mcp/",  
    "headers": {  
      "Authorization": "Bearer xxxxxx"  
  },  
  "timeout": 5000
 }

On the GitLab side, this can be done using the npx command. Some MCPs can be configured by modifying this settings.json file, while others require a one-time installation on your machine, most often with npx commands from what I’ve seen.

  "GitLab": {  
    "command": "npx",  
    "args": \[  
      "mcp-remote",  
      "https://gitlab.com/api/v4/mcp",  
      "--static-oauth-client-metadata",  
      "{\\"scope\\": \\"mcp\\"}"  
    \]  
  }

Once configured, it will be possible to retrieve information directly in Gemini CLI from the available resources. In this example, I want to retrieve my project’s issues. Gemini CLI displays them in raw JSON format but finishes with a more readable display.

MCP

Regarding my request for open PRs, Gemini CLI returns them (well, it in my example):

MCP PR

πŸ“Š Statistics

When closing Gemini CLI, statistics from our session are provided, notably the number of calls, the success percentage, and the tokens consumed. This data is available at any time with the /stats command.

Stats

πŸš€ A Daily Tool?

Definitely yes ! Although I really appreciate GitLab Duo and their agentic platform (https://dev.to/zenika/vibe-coding-with-gitlab-duo-agentic-power-in-action-1p47), using Gemini CLI is very enjoyable. My Ghostty terminal, which I dedicate to Gemini CLI, allows me to perform all the activities surrounding development.

The integration of extensions and MCPs is a real asset for finding information quickly. Of course, for more substantial actions on GitHub, GitLab, or any other application configurable with MCP, you will be more productive going to the application in question. But for any quick action, using MCPs is very interesting and relevant.

Here are a few articles about the CLI and MCPs: