Gemini CLI Step-by-Step: Installation and Use for Developers

Video thumbnail

Gemini CLI is, as its name suggests, an assistant that we can use locally on our PC or computer.

We can use it via the terminal, the CMD, or any console you are using. In my case, since I'm on Mac, I use the terminal; if you're on Windows, you would use the CMD.

As a developer, what interests me most is being able to create and manage projects with this assistant. However, it can be used for many other things: for example, if you have a folder full of unorganized videos, you can ask it to help you classify them. Ultimately, it allows you to automate many tasks on your computer.

Why use Gemini CLI locally

Using Gemini CLI has several advantages over the web version:

  • Greater control: you can decide where your files run and how the results are managed.
  • Real automation: ideal for repetitive tasks, such as classifying documents, generating reports, or creating batch content.
  • Project integration: if you already work with Node.js or Python, you can integrate Gemini directly into your workflows.
  • Performance: less resource consumption and immediate execution from the terminal.

In my case, I use it mainly to create and manage projects. But I've also used it to organize folders with videos, where Gemini helped me automatically classify the content according to the name and format.

What Gemini CLI is and what it's for

Gemini CLI is the command-line interface for Google's artificial intelligence assistant. In other words, it's the way to use Gemini directly from your terminal, without needing to open the browser or rely on the web interface.

With this tool, you can create projects, execute automatic tasks, generate content, analyze files, or interact with APIs, all with simple commands.

In my case, since I work from a Mac, I find it more convenient to execute commands directly in the terminal. If you use Windows, you can do the exact same thing from the CMD, and if you are on Linux, from your usual console.

Gemini CLI is ideal if you want to leverage the power of the Gemini 2.5 model without visual distractions, in a fast, clean, and local environment.

Features

In short, it is an assistant for executing tasks on your computer. In my case, I use it to create and manage projects.

Request limit

  • It is completely free "in quotes":
  • Free version: 60 requests per minute and 1,000 requests per day.
  • Paid version: for those who need more capacity.

I think the free plan is more than enough for most people. And if you reach the limit, you can always change accounts or wait until the next day.

Usage examples

  • With Gemini CLI you can:
  • Automate tasks.
  • Create projects.
  • Make requests to Google.
  • Generate images and videos.
  • Use the same functions as in the web version, but locally.

Step-by-step Gemini CLI Installation

To install it, we go to the installation section of the official repository.

Gemini CLI is installed via Node.js, so it's necessary to have it configured beforehand. If you've never done it, don't worry: the process is simple.

  1. Go to nodejs.org
  2. Download the recommended version for your operating system.
  3. Install it with the classic Next → Next → Finish.

This will also install npm, the package manager we will use to install Gemini CLI.

Step 1: Install Node.js

  • If you don't have Node installed:
  • Go to the official page.
  • Download the version for your operating system.
  • Install it with the classic Next, Next, Next.

This also installs npm, the Node package manager.

Step 2: Install Gemini CLI

In the terminal, execute:

$ sudo npm install -g [package] $ sudo npm install -g @google/gemini-cli
  • `sudo` is used on Mac/Linux because it is a global installation.
  • Wait for the process to finish.
  • When it's finished, you can type `gemini` in the terminal to start the assistant.

Update Gemini CLI

To keep it up to date, you can update it with:

You can update with:

$ sudo npm update -g @google/gemini-cli 

First commands and initial setup

Once installed, you can start Gemini by simply typing:

$ gemini

The assistant will appear in the console and you can start interacting.

Basic examples

Create a new project:

$ gemini new ai-project

Automate a task:

$ gemini "sort my files by type"

Generate content or code:

$ gemini "generate a summary of the readme.md file"

Practical usage examples

Create and manage projects

Gemini CLI allows you to create new projects with predetermined structures. In my case, I use it to quickly generate development templates or scripts that I then adapt.

Automate repetitive tasks

If you have a folder with hundreds of unclassified files, Gemini CLI can help you. I tested it with unnamed videos, and all I had to do was ask it to organize them by format: .mp4, .mov, etc. Within seconds, everything was sorted.

Useful integrations

You can combine Gemini CLI with tools like:

Common troubleshooting

"EACCES: permission denied" Error

Usually occurs on Mac or Linux when npm does not have global permissions. Quick solution:

$ sudo chown -R $(whoami) /usr/local/lib/node_modules

Then reinstall Gemini CLI.

Issues with Node.js

If you get strange errors, check your version with:

$ node -v

Gemini CLI requires Node 18 or higher.

Gemini is not responding

Restart the terminal or run `gemini --help` to check that the package is active.

Frequently asked questions about Gemini CLI

What is Gemini CLI?
It is the command-line interface for the Gemini artificial intelligence assistant, developed by Google.

How is it installed?
With `npm install -g @google/gemini-cli` after installing Node.js.

Does it work on all operating systems?
Yes, on Windows, Mac, and Linux.

Does it have a free version?
Yes, with 60 requests per minute and 1,000 per day.

Can I use it without knowing how to program?
Yes, the commands are natural and do not require prior experience.

Conclusion

Gemini CLI is a powerful, lightweight, and practical tool for those who want to use Gemini directly from the terminal.

In my experience, its installation is simple and daily use becomes addictive: I can launch projects, automate processes, and classify files without leaving the console.

If you're getting started, follow the steps in this guide, try the examples, and you'll soon be harnessing the power of AI from your own computer.

I agree to receive announcements of interest about this Blog.

Learn how to install and use Gemini CLI with this comprehensive guide in Spanish. Discover how to automate tasks, create projects, and enhance your workflow from the terminal.

| 👤 Andrés Cruz

🇪🇸 En español