Blogs/AI

How to install Gemini CLI and use it?

Written by Sharmila Ananthasayanam
Apr 21, 2026
4 Min Read
How to install Gemini CLI and use it? Hero

AI coding assistants are evolving beyond browser tabs and editor plugins. Developers now want AI tools directly inside the terminal, where coding, testing, Git workflows, and deployments already happen. Google Gemini CLI is built for exactly that shift.

Released in June 2025, Gemini CLI brings Google Gemini models into the command line to help with coding, debugging, automation, and understanding large codebases without breaking your workflow. It turns the terminal into a smarter workspace where you can move faster and solve tasks in one place.

In this guide, I’ll explain what Gemini CLI is, how to install it, and how to start using it effectively.

What is Gemini CLI?

Gemini CLI is an AI-powered command-line assistant from Google that runs directly inside your terminal. It is built for developers who want help with coding, debugging, scripting, and project workflows without leaving the command line.

Unlike a standard chatbot, Gemini CLI can understand development tasks, inspect files, generate code, explain errors, assist with Git operations, and automate repetitive commands. It uses a reasoning-and-action approach, allowing it to analyze requests, decide the next step, and interact with local tools or connected servers when needed.

In simple terms, Gemini CLI turns your terminal into a smarter workspace, helping you build and troubleshoot faster while staying inside your normal workflow.

How to Get Started and Install Google CLI?

Before installing Gemini CLI, make sure Node.js version 18 or higher is installed on your system. You can verify this by running:

Option 1: Use without installing

You can try it instantly using:

npx https://github.com/google-gemini/gemini-cli

No setup required.

Option 2: Install it globally

If you plan to use it often, install Google CLI globally so you can launch Gemini anytime from your terminal.

sudo npm install -g @google/gemini-cli

After installation, just type gemini in your terminal to launch it. 

Installing Gemini globally

Select your desired theme and press Enter.

When Gemini CLI opens for the first time, it will guide you through authentication. Once completed, you’re ready to start using AI commands directly from your terminal.

Authentication Options for Using Gemini CLI

When Gemini CLI starts for the first time, you’ll be asked to sign in. You can choose from three authentication methods depending on your setup and usage needs.

Getting Started with Google Gemini CLI
Learn how to install and use Google Gemini CLI for model interaction, scripting, and automation.
Murtuza Kutub
Murtuza Kutub
Co-Founder, F22 Labs

Walk away with actionable insights on AI adoption.

Limited seats available!

Calendar
Saturday, 30 May 2026
10PM IST (60 mins)

1. Sign in with Google

The easiest option for most users. It gives access to Gemini with a free usage tier.

  • 60 requests per minute
  • 1,000 requests per day

2. Use a Gemini API Key

Best for developers who want direct API access or higher limits. Add your API key in a .env file:

GEMINI_API_KEY=your_api_key

Or export it directly in your terminal:

export GEMINI_API_KEY=your_api_key

Free Tier:

  • Flash model only
  • 10 requests per minute
  • 250 requests per day

Paid Tier:

  • Higher quotas based on your plan

3. Use Vertex AI

Best for enterprise teams already using Google Cloud. It supports production workloads with quotas based on your Google Cloud tier.

Choose the option that matches your workflow, casual use, developer testing, or enterprise deployment.

What Can Gemini CLI Do?

Gemini CLI is more than a terminal chatbot. It can actively assist with real development and workflow tasks directly from the command line. Here are some of its most useful capabilities:

1. Understand Large Codebases

Ask questions about your project files, trace logic across folders, explain unfamiliar code, or quickly understand large repositories without manual digging.

2. Generate Apps from PDFs or Sketches

Use Gemini’s multimodal abilities to turn documents, wireframes, or rough designs into working code and project scaffolds.

3. Automate DevOps Tasks

Handle repetitive engineering work such as pull requests, rebases, shell commands, deployment scripts, and environment setup using simple prompts.

4. Extend with Tools and MCP Servers

Connect external tools and model context servers (MCPs) to unlock workflows like image generation, media creation, or custom automation.

Use built-in Google Search integration to fetch fresh information, documentation, and web context directly inside your terminal workflow.

Getting Started with Google Gemini CLI
Learn how to install and use Google Gemini CLI for model interaction, scripting, and automation.
Murtuza Kutub
Murtuza Kutub
Co-Founder, F22 Labs

Walk away with actionable insights on AI adoption.

Limited seats available!

Calendar
Saturday, 30 May 2026
10PM IST (60 mins)

6. Write, Debug, and Refactor Code

Generate functions, fix bugs, optimize code, and refactor existing files without leaving the command line.

Conclusion

Gemini CLI brings AI directly into the terminal, helping developers code, debug, automate tasks, and understand projects without leaving their workflow. Its combination of command-line speed, multimodal capabilities, and Google-powered intelligence makes it a practical tool for modern development teams.

Whether you're working on side projects or production systems, Gemini CLI can help reduce repetitive work and improve productivity. For teams looking to go beyond tools and build custom AI products, partnering with an experienced AI development company can help turn ideas into scalable solutions faster.

Frequently Asked Questions

1. What is Gemini CLI?

Gemini CLI is Google’s AI-powered command-line tool that helps developers code, debug, automate tasks, and interact with projects directly from the terminal.

2. How do I install Gemini CLI?

You can run it instantly with npx or install it globally using npm install -g @google/gemini-cli on systems with Node.js 18 or higher.

3. Is Gemini CLI free to use?

Yes, Gemini CLI offers free usage options through Google login or API keys, with request limits depending on the authentication method used.

4. What can Gemini CLI do?

It can write code, explain files, debug errors, automate workflows, manage Git tasks, and answer technical questions inside your terminal.

5. Can Gemini CLI understand large codebases?

Yes, Gemini CLI is designed to analyze large projects and help developers navigate unfamiliar code faster.

6. Who should use Gemini CLI?

Developers, DevOps engineers, students, and technical teams who want AI assistance directly in the command line can benefit from Gemini CLI.

Author-Sharmila Ananthasayanam
Sharmila Ananthasayanam

I'm an AIML Engineer passionate about creating AI-driven solutions for complex problems. I focus on deep learning, model optimization, and Agentic Systems to build real-world applications.

Share this article

Phone

Next for you

3,000 Tokens/Sec on Two RTX 4090s for Free Cover

AI

May 22, 20267 min read

3,000 Tokens/Sec on Two RTX 4090s for Free

We had 475,000 candidate profiles to synthesise for HuntVox, our internal tool. The data came from multiple sources, including LinkedIn, Weekday, resume parsing pipelines, and Lemlist, resulting in duplicate fields, inconsistent formats, and noisy profile information. Our goal was simple: convert raw profiles into semantic summaries, structured skills, and domain tags that could improve search quality and retrieval. At this scale, hosted APIs became difficult to justify. Rate limits reduced th

TRT-LLM vs vLLM vs SGLang: What to Choose in 2026 Cover

AI

May 15, 202611 min read

TRT-LLM vs vLLM vs SGLang: What to Choose in 2026

Running LLMs efficiently is one of the most important engineering challenges in today’s world. We need to choose the right inference engine. The wrong choice can mean slow responses, wasted GPU memory, and poor user experience. This blog documents what we learned after benchmarking three inference engines on a RTX 4090 server: NVIDIA TensorRT-LLM, vLLM, and SGLang. We explain not just the numbers, but why each engine behaves the way it does at the GPU level. What Are These Engines? Before co

Speculative Speculative Decoding Explained Cover

AI

May 25, 202612 min read

Speculative Speculative Decoding Explained

If you have worked with large language models in production, you have probably faced this problem: Models are powerful, but they are slow. Even with good GPUs, generating responses one token at a time adds latency. For real-world applications like chat systems, copilots, or voice assistants, this delay is noticeable and often unacceptable. Several techniques have been proposed to speed up inference. One of the most effective is speculative decoding, which uses a smaller model to guess the nex