Skip to main content
  1. Posts/

Discover Gemini-CLI: A Terminal Tool to Accelerate Your Workflows

·458 words·3 mins
Terminal OpenSource Gemini AI
Nofal Briansah
Author
Nofal Briansah
Holaaa :)
App Insights - This article is part of a series.
Part : This Article

TL;DR
#

Quick guide to installing and using Gemini-CLI, Google’s new open-source AI terminal tool.


Introduction
#

Just like Terminals are an essential part of Linux, AI tools are also making their way into the terminal. Recently, Google released an open-source project called Gemini-CLI: a command-line tool that allows you to interact with their AI models directly from your terminal.

This article covers how to install Gemini-CLI and some example commands you can try.

Gemini-CLI
#

Gemini-CLI is an open-source terminal tool by Google that lets you interact with Gemini AI models directly from your terminal. With a free license, you get access to Gemini 2.5 Pro and its powerful 1 million token context window. Connect it with a Google AI Studio API key to unlock higher limits.

Prerequisites
#

Make sure you have Node.js version 18 or higher installed.
For example, on Linux systems:

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 22

# Verify the Node.js version:
node -v # Should print "v22.17.0".
nvm current # Should print "v22.17.0".

# Verify npm version:
npm -v # Should print "10.9.2".

Install
#

  1. Install Gemini-CLI globally via NPM:

    # Install
    npm install -g @google/gemini-cli
    
    # Run Gemini-cli
    gemini
    
  2. On first launch:

    • Select a theme using arrow keys.
    • Press Tab and Enter to confirm.

    google ai studio

  3. Log in using your Google account or by providing an API key from Google AI Studio.

  4. Gemini-CLI is now ready to use.

    google ai studio

Increase Usage Limit
#

  1. Generate your API key from Google AI Studio.

    google ai studio

  2. Set it as an environment variable in your terminal. Replace YOUR_API_KEY with your generated key.

    export GEMINI_API_KEY="YOUR_API_KEY"
    

CLI commands
#

You can view the full list of available commands here.
Some basic ones include:

# Start a chat session   
/chat 

# Clear chat history
/clear

# Change the CLI theme
/theme

# Exit the CLI
/exit

# Display help information
/help

Example usage
#

You can use Gemini-CLI directly in your terminal:

  • At the prompt, simply type a question like what is Linux? and get an instant response.

  • You can also use it to generate files, like a README.md for your dotfiles project.

    Here’s an example folder structure for mydotfiles:

    google ai studio
    I used Gemini-CLI to help create a README.md for this dotfiles project:
    google ai studio
    google ai studio
    google ai studio

    And this was the resulting README.md file created by Gemini:

    google ai studio

Notes
#

  • With AI, your workflow can become faster and more efficient. However, always make sure you understand the fundamentals.
  • If you encounter issues, check the troubleshooting guide.

Youtube Demo
#

soon.


References
#

App Insights - This article is part of a series.
Part : This Article