By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: Complete Gemini CLI Setup Guide for Your Terminal | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > Complete Gemini CLI Setup Guide for Your Terminal | HackerNoon
Computing

Complete Gemini CLI Setup Guide for Your Terminal | HackerNoon

News Room
Last updated: 2025/07/01 at 8:21 PM
News Room Published 1 July 2025
Share
SHARE

Have you ever wished for an AI assistant right inside your terminal window? Well, your dream may have just come true because Google just released Gemini CLI. In this tutorial, I’m going to show you everything you need to know about this new open-source AI agent. We’ll cover how to use it, the pricing, and some useful tips and tricks. So, if you’re ready, let’s get started! 😉

Introducing Gemini CLIIntroducing Gemini CLI

What is Gemini CLI?

Gemini CLI is a free and open-source AI agent that works directly in your terminal. This powerful tool brings Google’s Gemini models to your command line, allowing for natural language interaction to get work done. You can ask it to:

  • Write and explain code.
  • Edit files.
  • Explain errors.
  • Run shell commands.
  • and much more!

You don’t have to constantly switch between a web app and your terminal. And the best part? It’s free, with no complicated setup.

Getting Started with Gemini CLI

Step 1: Install Gemini CLI on Linux

You can install Gemini CLI on Linux, Mac, and Windows. All the setup we will do inside the terminal. I am using Linux, but for Mac and Windows, the commands are almost the same, so you can follow my steps.

To get started, make sure you have Node.js version 18 or higher. You can check this by running:

node -v

If you don’t have it, use the following command to install it:

sudo apt update && sudo apt install nodejs npm

Then, I installed Gemini CLI globally with:

npm install -g @google/gemini-cli

If you don’t want to install it globally, you can also use:

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

Step 2: Run and Log In

After installing, just type:

gemini

After that, you need to log in with your personal Google account.

Run and Log InRun and Log In

This gives you access to a free Gemini Code Assist license, which includes:

  • Access to Gemini 2.5 Pro.
  • A massive 1 million token context window.
  • 60 model requests per minute.
  • 1,000 model requests per day at no charge.

You can also use an API key from Google AI Studio if you prefer.

Step 3: Try It Out

Now you are ready to start asking questions and running tasks. You can ask the Agent to create a project, fix the bugs, explain the code in specific files, etc. Ensure that you run the agent within your project folder.

> What does the file index.js do?

It read the file, analyzed it, and gave a clear explanation.

> Add error handling to index.js

You can also run shell commands directly by using !, like this:

!ls -al

Creating a Simple To-Do App with Google CLI

Now that we’re all set up, let’s ask the AI to create a simple to-do application using HTML, CSS, and JavaScript. I will type “create a simple to-do app using simple js and html” into the Gemini CLI.” Watch the video to see the step-by-step process and the result.

Watch on YouTube: 

Gemini CLI has some handy built-in tools. You can use commands like:

Using Built-in ToolsUsing Built-in Tools

Gemini CLI Tools Overview

  • ReadFolder (ls). Lists files and folders in a directory—just like the shell ls command.
  • ReadFile (read-file). Reads the full content of a single file, useful for summaries or analysis.
  • ReadManyFiles (read-many-files). Reads multiple files at once, typically matching a glob pattern (e.g., all .js files)
  • FindFiles (glob). Searches for files by pattern (e.g., find all config.json across your project).
  • SearchText (grep). Searches within files for text, like finding all TODO comments.
  • Edit (edit). Applies code changes via diffs. Gemini previews edits and asks for approval before applying them.
  • WriteFile (write-file). Creates new files (for example, README.md) with user-provided content.
  • Shell (shell). Runs commands you prefix with ! (e.g., !npm test) directly in the terminal .
  • WebFetch (web-fetch). Fetches content from the web (HTML or JSON), enabling Gemini to analyze external data.
  • GoogleSearch (web-search). Performs a Google search to ground responses with real-world information (e.g., explanation for an error).
  • Save Memory (memoryTool). Stores facts or preferences during a session (like “I prefer async/await”) to improve consistency

To see all available tools, you can use the /tools command.

Advanced Features

You can add specific instructions for the AI for a particular project by creating a GEMINI.md file in your project’s root directory. Inside this file, you can define project rules, code styles, and the tools the agent should use. This ensures that the generated code is consistent with your project’s standards.

GEMINI.md fileGEMINI.md file

Google CLI MCP Integration

For most day-to-day uses, the built-in tools will suffice. But what if you want Gemini CLI to do something very domain-specific, like interact with specific APIs or use a specialized model (say an image generator or a security analysis tool)? This is where MCP (Model Context Protocol) comes in.

MCP is essentially an open standard that allows developers to add new tools/abilities to the AI by running a server that the CLI can communicate with. In Gemini CLI, you can configure “MCP servers” in a JSON settings file, and the CLI will treat those as additional tools it can use.

How to Set Up the MCP Server in Google CLI

As an example, I am going to show you how to set up the GitHub MCP server in Gemini CLI.

Inside your project folder, create a folder by using the command:

mkdir -p .gemini && touch .gemini/settings.json

Inside the file, add the following code:

{  
  "mcpServers": {  
    "github": {  
      "command": "npx",  
      "args": ["-y", "@modelcontextprotocol/server-github"],  
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "[YOUR-TOKEN]" }  
    }  
  }  
}

After that /quit , from the Gemini CLI, and then reopen it.

Write /mcp command, and you will see a list of GitHub tools.

MCP in Google Gemini CLIMCP in Google Gemini CLI

Now you, Agent, can interact with GitHub. That simple! 🙂

Gemini CLI Pricing

You can try it free for personal usage, but there is also a paid version that is billed based on token usage.

Free Preview Tier

  • Cost: Free with Google account
  • Limits: Up to 60 requests/min and 1,000 requests/day
  • Great for individual developers and small-scale use

Paid / API Key Usage

  • Use your own Gemini API key for higher usage
  • Billed based on tokens consumed (model and usage dependent)

Enterprise Options

  • Available through Gemini Code Assist Standard or Enterprise plans
  • Includes advanced features like governance, audit logs, and shared quotas

Conclusion

As you can see, Gemini CLI is a really powerful tool with a lot of potential. I’m excited to see how I’ll be using it in my daily workflow.

If you write code, debug things, or manage files often, this tool is worth checking out.

If you have any feedback, please share it in the comments below. 😉

Cheers!

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Can A Text Message Land You In Prison? Yes, And Here’s How
Next Article Netflix is adding an ad-free live channel for 700 million users at no extra cost
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Progress Software (PRGS) switches off 13% after the profit performance
News
Netflix just added an eight-season sitcom for you to binge
News
Data infrastructure modernization: How NetApp fuels global innovation – News
News
Save $350 on a spec’d out Samsung Galaxy Book 5 Pro laptop
News

You Might also Like

Computing

Debian 13 Installer RC2 Fixes An Annoying Issue, Improves Btrfs Rescue Handling

2 Min Read
Computing

Steam On Linux Usage Dips Slightly For June, AMD Linux CPU Usage Hits 69%

2 Min Read
Computing

New Research Shows Classic Selfish Mining Is Outdated | HackerNoon

10 Min Read
Computing

Towards 21st Century Equitable Prosperity: From Reaganomics to the Abundance Agenda | HackerNoon

31 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?