AI 101

Gemini CLI: the agent with the free tier that actually works

Install Gemini CLI, log in with a personal Google account, get 1,000 requests a day for free, and learn the @file, !shell and /memory moves that make it a daily driver.

By the end of this page, you'll have Gemini CLI installed and authenticated with a free Google account, you'll have run an agentic task on a real repo, and you'll know how to pull files into context with @, drop into the shell with !, and persist project rules in GEMINI.md.

What Gemini CLI is

Gemini CLI is Google’s open-source terminal agent โ€” Apache 2.0, on GitHub, powered by Gemini models. It does what Claude Code and Codex CLI do: reads the repo, edits files, runs commands, iterates.

The difference is the on-ramp. A personal Google account gets you a free tier โ€” no card, no trial that expires in 14 days. That single fact is why it’s the first cloud agent most people should install.

Step 1 โ€” Install

Node.js 20+ required:

npm install -g @google/gemini-cli

Check:

gemini --version
# 0.67.0
Version note: 0.67.0 at the time of writing (November 2026). The CLI moves quickly; gemini --help and the official docs beat any pinned tutorial.

Step 2 โ€” Authenticate (pick one)

cd ~/projects/my-app
gemini

Three paths:

MethodBest forCost
Login with Googleindividuals, first runfree tier: 60 requests/min, 1,000 requests/day
Gemini API keyscripts, CI, higher limitspay per token (AI Studio key)
Vertex AIteams already on Google CloudGCP billing, enterprise controls

Choose “Login with Google”, finish the browser flow. The free tier is generous enough to learn on: 1,000 requests a day is a lot of agent turns when you’re not looping over a monorepo.

Free tier โ‰  free API. The free quota is tied to your Google account and its terms โ€” Google uses those interactions to improve its products. For client code, regulated data, or anything under NDA, use an API key with billing enabled (paid tier) or Vertex. API keys and their blast radius โ†’

Step 3 โ€” First task

Inside a git repo with a clean working tree:

git status
gemini
> read the repo, then explain how authentication works end to end

Then something with consequences:

> the /health endpoint returns 500 when the database is down โ€” reproduce it and fix it

It will read files, propose edits, and ask before running commands. Same discipline as any agent: read the diff, don’t approve blind. The agent loop, explained โ†’

Step 4 โ€” The four moves that change how you use it

@ pulls a file (or a folder) into the prompt. No copy-paste, no “here is my code:” wall:

> @src/auth/session.ts why does this token never expire?
> @docs/ explain the architecture to a new hire

! runs a shell command without leaving the session. Prefix a line with ! for a single command, or type ! alone to toggle shell mode:

! git log --oneline -15
! npm test -- --run

/memory writes durable facts the agent carries into later sessions:

/memory add This repo uses pnpm, never npm. Tests run with `pnpm test`.

/init scans the repo and proposes a GEMINI.md โ€” the project instruction file, the Gemini equivalent of CLAUDE.md and AGENTS.md.

Step 5 โ€” Commands worth memorizing

CommandWhat it does
/initgenerate GEMINI.md from the repo
/memoryshow or add persistent memory
/compresssummarize the conversation to reclaim context
/clearreset the session
/toolslist available tools
/mcpmanage MCP servers
/extensionsmanage CLI extensions
/statstoken and session stats
/restoreroll back to a checkpoint
/authswitch authentication method

Step 6 โ€” Context is a budget

Gemini models have very large context windows, and it’s tempting to dump the whole repo in. Don’t. A 1M-token window still costs money, still gets slower, and long contexts degrade instruction-following โ€” the “lost in the middle” problem is real. Context windows, demystified โ†’

Practical rules:

  • @ the three files that matter, not @src/.
  • Keep GEMINI.md under ~100 lines.
  • /compress when a session drifts, /clear when it’s lost.

Where it fits

Gemini CLIClaude CodeCodex CLI
Free tieryes, 1,000 req/daynolimited (ChatGPT Free)
Open sourceyes (Apache 2.0)noyes (Apache 2.0)
File inclusion@path@ mentions@ mentions
Local modelsnonoyes (--oss)
Best reason to pick itzero-cost startpolish, long sessionssandbox + local

The honest recommendation: install Gemini CLI first because it’s free, then add the others when a specific need shows up โ€” a Claude subscription you already pay for, or a local model you want an agent on top of.

Next in the cloud track: [GitHub Copilot โ€” the agent inside the editor you already use โ†’](/tutorials/cloud/github-copilot/)