LIVEReading: Chat with Gemini AI in Your Terminal — Free Tier IncludedTotal time: 7 minSteps: 5Worked first time: 85% LIVEReading: Chat with Gemini AI in Your Terminal — Free Tier IncludedTotal time: 7 minSteps: 5Worked first time: 85%
CBW
Chat with Gemini AI in Your Terminal — Free Tier Included
Easygithub.com/google-gemini/gemini-cli2026-06-03

Chat with Gemini AI in Your Terminal — Free Tier Included

Install Google's Gemini CLI to get a free AI agent running in your terminal. Ask questions, read files, and automate tasks — no coding required.

// Build stats

  • Total time7 min
  • Number of steps5
  • DifficultyEasy
  • Worked first time85%
// Before you start

What you need

  • A computer running macOS, Linux, or Windows (with WSL)
  • Node.js 18+ installed (check with: node --version)
  • A personal Google account (for the free tier)
  • Internet connection
01
Step 1 of 5

Install Gemini CLI globally

2 min

This command downloads and installs the Gemini CLI tool on your machine so you can run it from any folder. The -g flag means 'global' — it becomes available everywhere, not just in one project folder.

Terminal · mac
$ npm install -g @google/gemini-cli
What you should see
A few lines of progress text ending with something like: added 1 package in Xs
This might happen

'npm: command not found' error

Node.js is not installed. Go to https://nodejs.org, download the LTS version, install it, then re-run this command.

02
Step 2 of 5

Confirm the install worked

1 min

Run this to make sure the CLI installed correctly and check what version you have. If it prints a version number, you are ready to go.

Terminal · mac
$ gemini --version
What you should see
A version number such as: 0.1.x
This might happen

'gemini: command not found' after a successful install

Your terminal's PATH may not include npm's global bin folder. Try closing and reopening your terminal, or run: npx @google/gemini-cli --version

03
Step 3 of 5

Launch Gemini and sign in with Google

3 min

Type 'gemini' to start the interactive agent. The first time you run it, it will ask how you want to authenticate. Choose 'Sign in with Google'. Your browser will open and ask you to log in with your Google account. This gives you 60 requests per minute and 1,000 requests per day for free — no credit card needed.

Terminal · mac
$ gemini
What you should see
A welcome prompt appears in your terminal asking you to choose an authentication method. After you sign in via the browser, you are returned to a chat prompt inside the terminal.
This might happen

Browser does not open automatically

The terminal will print a URL. Copy and paste it manually into your browser to complete sign-in.

04
Step 4 of 5

Ask Gemini your first question

1 min

You are now inside the Gemini chat session. Type any question and press Enter. Gemini can answer general questions, summarize files in your current folder, or help you think through a problem. It has access to the files in whatever directory you launched it from.

Terminal · mac
$ What files are in my current directory and what do they do?
What you should see
Gemini reads your directory and gives you a plain-English description of the files it finds.
05
Step 5 of 5

Ask a one-off question without opening a chat session

1 min

If you just need a quick answer without entering the interactive chat, use the -p flag followed by your question in quotes. This is useful for scripting or when you want a fast single response.

Terminal · mac
$ gemini -p "Summarize what this project does in plain English"
What you should see
Gemini prints a text answer directly in your terminal and returns you to your normal command prompt.
This might happen

Response is cut off or seems incomplete

Add --output-format json to the command to get the full structured response: gemini -p "your question" --output-format json

// Status

cooked. baked. worked.

A working AI agent in your terminal that you can chat with, ask about files in any folder, and query with one-liner commands — all on Google's free tier with no API key required.

// the honest bit

The honest part

Gemini CLI can read and modify files on your machine — always review any file changes it suggests before confirming. The free tier (1,000 requests/day) is generous for personal use but will not suit heavy automation. Google Workspace accounts may need extra configuration; see the official authentication guide at https://github.com/google-gemini/gemini-cli for details. This tool is designed for developers, so some advanced features (MCP integrations, custom GEMINI.md context files) will require comfort with config files.