
Gemini CLI has arrived to revolutionize the way developers and advanced users interact with Artificial Intelligence from the Ubuntu terminal.. More and more AI-powered tools are being integrated into the programming workflow, but not all of them offer the power, flexibility, and direct access that the Gemini CLI provides.
The rise of AI in the Linux world has opened up new possibilities for automation, code analysis, and creative content generation.. However, installing and configuring certain utilities isn't always straightforward, especially for those looking to take advantage of Gemini AI's potential from the comfort of their terminal. If you've heard of the Gemini CLI or need a smart companion in your shell, Here you have all the information you need to know to install, configure and get the most out of it on Ubuntu.
What is Gemini CLI and why does it stand out on Ubuntu?
Gemini CLI is a command-line tool developed by the Google Gemini team, primarily aimed at developers, system administrators, and anyone who wants to take advantage of AI on the terminal. Not only does it allow you to analyze and edit large codebases, but it also automates DevOps tasks, prototypes applications with multimodal input, and offers integration with other generative services and models. Furthermore, it is an open source project licensed under the Apache 2.0 license, ensuring transparency and constant development with the community.
Key Features and Benefits of Gemini CLI
- Support for large code bases: It is capable of handling more than a million tokens in context, allowing you to analyze large projects without losing efficiency.
- Multimodal application prototyping: Allows you to create prototypes from PDF documents, images, or sketches, leveraging Gemini’s multimodal capabilities.
- Advanced DevOps and Git task automation: Query and manipulate pull requests, plan migrations, resolve complex rebases, and more, all from the terminal.
- Easy integration with multimedia models: You can connect to services like Imagen, Veo, and Lyria through MCP servers to generate multimedia content directly.
- Integrated web search: It has a Google-based search tool to obtain up-to-date and reliable answers in real time.
The work environment in the terminal is highly customizable., thanks to emerging standards like MCP, GEMINI.md files, and options for both individual and team configurations. The project is designed with extensibility in mind, so it continually grows and incorporates new features suggested by the international developer community.
Prerequisites for installing Gemini CLI on Ubuntu
Before you begin the installation, make sure you meet the following essential requirements:
- Ubuntu (or Ubuntu-based distribution) running.
- Sudo permissions to install software and make changes to the system.
- Google Account: You will need to log in the first time you run Gemini CLI.
- Node.js version 20 or higher (preferably the most recent).
- npm (the Node.js package manager).
To check which version of Node.js you have installed, you can run the following in the terminal:
node -v
If it is less than required, or not installed, follow the steps below.
How to install Node.js and npm on Ubuntu
The fastest way to install Node.js and npm is from Ubuntu's own repositories. Open a terminal and run:
sudo apt-get update sudo apt-get install nodejs -y sudo apt-get install npm -y
If you need a higher version of Node.js (for example, 20 or newer), you can refer to the official Nodesource repository:
curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh sudo -E bash nodesource_setup.sh sudo apt-get install nodejs -y sudo apt-get install npm -y
TIP: If you already had Node.js installed and are encountering conflicts, run the npm install again after upgrading Node.js.
Installing Gemini CLI on Ubuntu step by step
There are several ways to install Gemini CLI, but on Ubuntu the most convenient and recommended option is via npm, with the following command:
sudo npm install -g @google/gemini-cli
With that, the tool will be available as a global command on your system and you can launch it from any directory.
If you prefer to avoid the global installation, you can also run it one-off using npx, although for everyday use it is recommended to install it globally.
First steps after installation: configuration and authentication
When you first run Gemini CLI with the command:
gemini
An interactive wizard will appear for initial setup. These are the usual steps:
1. Selecting a visual theme
Gemini CLI allows you to choose from different colors and styles to customize the environment to your preferences. Use the arrows and Enter to confirm.
2. Login method
The easiest way is to authenticate with your personal Google account, which allows up to 60 requests per minute and 1.000 per day in the standard free plan. If you need more capacity, you can use API Keys or Vertex AI:
- Google AI Studio API Key: Accede to Google AI Studio, generate a key and set it as an environment variable
GEMINI_API_KEY. - Google Cloud API Key for Vertex AI: From the Google Cloud console, generate the key and export the variables
GEMINI_API_KEYyGOOGLE_GENAI_USE_VERTEXAI=truein your terminal. - If you have a Google Workspace account at your company, see the authentication guide for advanced methods.
3. Authentication via browser
After selecting the method, the tool will open a browser window for you to log in securely. Once authenticated, return to the terminal and you'll see a confirmation message. You're ready to start using the Gemini CLI!
How to use Gemini CLI after installation
Using the Gemini CLI is simple yet powerful. You can:
- Start a project in a new directory or work on an existing one using
cdand runninggemini. - Interact directly with the AI model using natural language: describe tasks, request code generation, answer technical questions, automate recurring tasks, etc.
- Attach local files to the conversation using the character
@. - Discover commands and possibilities by typing
/in the CLI itself. - Integrate MCP servers to connect Gemini CLI with other tools in your system or enterprise collaboration.
Each time you make a query, the Gemini CLI will process your request in the context of the directory and files you are working in, allowing for project-specific manipulations.
Troubleshooting and helpful tips
Although installation is usually straightforward, you may encounter some issues:
- Node.js version error: Make sure you meet the minimum version, update following the previous steps.
- Issue with global npm permissions: Add
sudoto the installation command if you receive permission errors. - Authentication failure: Please ensure that your default browser is linked to the correct Google account before launching Gemini CLI.
- Network failure or model changes: If your connection is unstable, Gemini may automatically switch from the model
gemini-2.5-proagemini-2.5-flashto continue operating with lower latency.
In any case, you can consult the official documentation, the FAQ guide, or the GitHub repository where the community and developers publish solutions and updates.
Advanced uses and tricks to get the most out of Gemini CLI on Ubuntu
In addition to interacting from the conventional terminal, Gemini CLI can run in integrated terminals of editors like Visual Studio Code, thus benefiting from AI in your daily development flow. Simply open a terminal in VSCode and run gemini to start.
Another advanced feature is file management: if in the middle of a conversation you need to consult, edit or analyze a specific file, use @ to select and explicitly reference it in your query. Gemini will process it in context.
For those who wish to extend the capabilities of the CLI or integrate it with enterprise systems, MCP servers allow you to build bridges with your organization's tools or add new featuresSince it's open source and extensible software, you can develop your own add-ons or contribute improvements that the community itself will appreciate.
Authentication options, plans and limitations
Gemini CLI offers several different ways to authenticate and use:
- Free access with a personal Google account: up to 1.000 requests/day and 60/minute.
- Google AI Studio API Key: 100 free requests/day, with the option to upgrade for a fee on the keys page.
- Vertex AI API (Google Cloud): Basic access to Gemini 2.5 Pro with express mode, but the ability to raise limits by linking a billing account.
For professional projects or intensive use cases, it's a good idea to review the limitations and consider the available payment plans, as well as respect the privacy policy and terms of service.
Community, support, and open source philosophy
Being open source, Gemini CLI invites active participation. You can report bugs, suggest new features, improve security, or contribute code directly to the official GitHub repository. Google and the global community foster a collaborative space where both individual users and teams can adapt the tool to their needs.
The emerging standards adopted by the Gemini CLI (such as MCP, customizable configurations, and centralized system prompts in GEMINI.md files) make it a unique and versatile environment. This allows for highly advanced configurations, whether for personal use or for business and collaborative environments.
Recommended complementary tools: Apidog
Along with Gemini CLI, it is worth highlighting utilities such as ApidogApidog, a comprehensive environment for API documentation, testing, and automation. Apidog is compatible with formats like Postman and Swagger, facilitating the transition and import of existing projects. Its intuitive interface makes it ideal for both experienced developers and those new to working with APIs, and it's a great ally for improving productivity alongside the Gemini CLI.
AI integration into the Linux terminal is now a reality and within reach of anyone willing to take the plunge. Gemini CLI stands out for its power, flexibility, and customization, facilitating both everyday and complex tasks for programmers, DevOps teams, and advanced users alike. With a relatively simple installation, extensive authentication options, active community support, and ongoing updates, this tool is a must-have for leveraging AI from the console.